GQ Electronics Technical Support Forum Active Users: / Visits Today:
Highest Active Users:
GQ Electronics Technical Support Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 GQ Electronics Forums
 2.GQ Geiger Muller Counter
 GMC-800 terminal interface
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bmomjian

USA
4 Posts

Posted - 03/20/2024 :  11:01:27  Show Profile  Reply with Quote
I was able to successfully connect to the GMC-800 using the Linux terminal interface 'cu'. I used the command:

cu --nostop -l /dev/ttyUSB3 -s 115200 dir


The "--nostop" is needed so binary data coming from the GMC-800 is not interpreted as xon/xoff flow control commands. You might also need to set 'raw' mode using stty.

I used speed 115200, and the commands listed in this forum at:

https://www.gqelectronicsllc.com/forum/topic.asp?TOPIC_ID=10394

I am specifically using "<GETCPM>>". The AT commands did not work for me.

https://momjian.us

Edited by - bmomjian on 03/21/2024 06:12:10
Reply #1

EmfDev

2219 Posts

Posted - 03/21/2024 :  09:42:31  Show Profile  Reply with Quote
AT commands are not supported on hte GMC-800. It does not have WiFi feature.
Go to Top of Page
Reply #2

bmomjian

USA
4 Posts

Posted - 03/26/2024 :  06:47:36  Show Profile  Reply with Quote
quote:
Originally posted by EmfDev

AT commands are not supported on hte GMC-800. It does not have WiFi feature.



Ah, good to know about AT not being supported.

I ended up realizing that 'cu' was overkill for my purposes so I went with a simpler Linux shell script. It just sends the command to the device and gets the reply. I found that each time I reconnect the USB cable to the device, I have to send ">>" to get the connection established; if I don't the first command I send is ignored:

# connected?
[ ! -e /dev/"$GEIGER" ] && exit 1

stty -F /dev/"$GEIGER" raw -echo 115200

# Was tty reconnected?  Reset so we get a reading on the second try.
if ! stty -F /dev/"$GEIGER" | grep -q 'rprnt = ^K'
then    # send dummy command
        echo -n '>>' > /dev/"$GEIGER"

        # set a dummy settings so we can detect reconnection
        stty -F /dev/"$GEIGER" rprnt '^K'
fi

CPM=$(perl << 'END'
        use strict;
        use warnings;

        use Momjian_us;

        # could hang, allow two seconds for read
        # https://unix.stackexchange.com/questions/559235/read-stdin-with-timeout
        local $SIG{ALRM} = sub { exit(1) };
        alarm(2);

        my $device = "/dev/$ENV{GEIGER}";
        open(my $geiger, '+<', $device) or
          sysdie("cannot open $device");

        print({$geiger} '<GETCPM>>');

        sysdie("cannot read four bytes from $device")
          if (read($geiger, my $byte4, 4) != 4);
        # Network/big endian ordering 4-byte integer
        # Newer models use 4-byte CPM for the GMC-500+, not 2
        # https://www.gqelectronicsllc.com/forum/topic.asp?TOPIC_ID=10394
        # https://www.gqelectronicsllc.com/forum/topic.asp?TOPIC_ID=9682
        print unpack('N', $byte4) . "\n";

        alarm 0;
END
)

echo "$CPM"

https://momjian.us

Edited by - bmomjian on 05/18/2024 06:45:26
Go to Top of Page
Reply #3

ullix

Germany
1134 Posts

Posted - 03/27/2024 :  09:26:57  Show Profile  Reply with Quote
I think you would be better off coding in Python. Code as simple as your current is e.g : "geigerlog_simple.py"
you find here: https://sourceforge.net/projects/geigerlog/files/
There are some nuanced increases in complexity in files on the same site.

Pre-releases of developments are: https://sourceforge.net/p/geigerlog/discussion/devel/
Go to Top of Page
Reply #4

bmomjian

USA
4 Posts

Posted - 03/27/2024 :  16:28:34  Show Profile  Reply with Quote
quote:
Originally posted by ullix

I think you would be better off coding in Python. Code as simple as your current is e.g : "geigerlog_simple.py"
you find here: https://sourceforge.net/projects/geigerlog/files/
There are some nuanced increases in complexity in files on the same site.

Pre-releases of developments are: https://sourceforge.net/p/geigerlog/discussion/devel/




Looks interesting, though on the GMC-800 the CPM is four bytes, so the script would need modification. Fortunately my script is working.

https://momjian.us
Go to Top of Page
Reply #5

bmomjian

USA
4 Posts

Posted - 03/30/2024 :  03:42:59  Show Profile  Reply with Quote
The API for the GMC-800 is at http://www.gqelectronicsllc.com/download/GQ-RFC1801.txt

https://momjian.us
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
GQ Electronics Technical Support Forum © Copyright since 2011 Go To Top Of Page
Generated in 0.07 sec. Snitz's Forums 2000