T O P I C R E V I E W |
mbowser |
Posted - 02/12/2013 : 05:34:28 I am interested in reading data in from the GMC300 into my own application for post processing, but I am having a little trouble reading anything from the port. I wrote a simple python script that should access the data, but I'm not seeing any data when I run it. Right now it is running on a Debian Linux dist. (Raspberry Pi), but I could easily try it on a windows system using C# or similar language.
Has anyone done this or could point me in the correct direction?
Image Insert:
20.65 KB |
5 L A T E S T R E P L I E S (Newest First) |
ZLM |
Posted - 03/05/2013 : 22:02:26 sorry. My mistake, it shuld be 57600 baud. I am keeping mixed with my another project. :-) |
phgphd |
Posted - 03/05/2013 : 19:53:35 ZLM, why are you insisting on 38400 baud. My software uses 57600 and works at that baudrate. mbowser, why don't you look at my C++/Ubuntu Linux software at h**p://sourceforge.net/p/gqgmc/wiki/Home/. You should be able to read the C++ fairly easily and convert to Python. The ICD documentation and documentation embedded in the code is comprehensive. |
ZLM |
Posted - 03/05/2013 : 19:23:56 baud rate should be 38400. |
jd |
Posted - 03/05/2013 : 19:16:15 quote: Originally posted by mbowser
Has anyone done this or could point me in the correct direction?
Here the USB serial device of the GMC-300 appears as /dev/ttyUSB0 and communication uses the following serial settings: 57600 baud 8 data bits No parity 1 stop bit No hardware control lines
Except for the baud rate these settings may already match the default settings of the python serial class. Therefore, you'd only need to specify the device and the baud rate. For example:
import serial
s = serial.Serial( "/dev/ttyUSB0", 57600 )
s.write("<GETVER>>")
version = s.read(14)
print version
It also helps to have read/write access to "/dev/ttyUSB0":
$ ls -l /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Mar 5 20:57 /dev/ttyUSB0
$ groups
user dialout cdrom audio video
|
ZLM |
Posted - 02/15/2013 : 20:39:24 The baud rate shoudl be 38400 |