chaim-zax / gq-gmc-control

Control tool for the GQ GMC Geiger Counters.
GNU General Public License v3.0
55 stars 18 forks source link

Unicode strings are not supported #6

Closed c0r3dump3d closed 3 years ago

c0r3dump3d commented 3 years ago

Hi, I'm trying to use with a GMC-500+ model, but I have this error when I try to connect with the hardware:

Traceback (most recent call last): File "./gq-gmc-control.py", line 390, in <module> main() File "./gq-gmc-control.py", line 302, in main res = gq_gmc.open_device(port=port, baud_rate=baud_rate, skip_check=skip_check, File "/root/gq-gmc-control/gq_gmc.py", line 781, in open_device clear_port() File "/root/gq-gmc-control/gq_gmc.py", line 96, in clear_port m_device.write(">>") File "/usr/lib/python3.8/site-packages/serial/serialposix.py", line 532, in write d = to_bytes(data) File "/usr/lib/python3.8/site-packages/serial/serialutil.py", line 63, in to_bytes raise TypeError('unicode strings are not supported, please encode to bytes: {!r}'.format(seq)) TypeError: unicode strings are not supported, please encode to bytes: '>>'

with python version 3.8.6:

# python Python 3.8.6 (default, Sep 30 2020, 04:00:38) [GCC 10.2.0] on linux

chaim-zax commented 3 years ago

Unfortunately from revision GMC-500+Re 2.x on they changed to protocol, the library was designed using the Re 1.x firmware. See issue #3 for more info.

auwsom commented 1 year ago

I got this message until I used python2 in front of the py file command.