gq-gmc-control icon indicating copy to clipboard operation
gq-gmc-control copied to clipboard

`TypeError: unicode strings are not supported, please encode to bytes: '>>'`

Open raleighlittles opened this issue 10 months ago • 0 comments

Trying to run this script, with these arguments:

$ python3 gq-gmc-control.py --serial -p /dev/ttyUSB0

Gives this traceback:

Traceback (most recent call last):
  File "/home/raleigh/Downloads/gq-gmc-control/gq-gmc-control.py", line 390, in <module>
    main()
  File "/home/raleigh/Downloads/gq-gmc-control/gq-gmc-control.py", line 302, in main
    res = gq_gmc.open_device(port=port, baud_rate=baud_rate, skip_check=skip_check,
  File "/home/raleigh/Downloads/gq-gmc-control/gq_gmc.py", line 781, in open_device
    clear_port()
  File "/home/raleigh/Downloads/gq-gmc-control/gq_gmc.py", line 96, in clear_port
    m_device.write(">>")
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 616, in write
    d = to_bytes(data)
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 65, 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: '>>'

Python version: Python 3.10.12

raleighlittles avatar Aug 13 '23 21:08 raleighlittles