Python library issue
Posted: Thu Feb 07, 2019 1:34 pm
Hi all I have some issues with python library, hope some1 can help me out:
I'm trying to use the python library on a software called touchdesigner(windows 10) to control an engine from serial port.
it supports python and external modules.
I'm trying to do some basic functions but i cant communicate with the board.
At the moment i m still connected via usb serial.
this is the code I m trying to use:
from roboclaw import Roboclaw
#Windows comport name
rc = Roboclaw("COM7",38400)
#Linux comport name
#rc = Roboclaw("/dev/ttyACM0",115200)
rc.Open()
address = 0x80
rc.ForwardM1(address,32)
i got some errors as output:
python >>>
Traceback (most recent call last):
File "</project1/text1:op('/project1/text1').run()>", line 1
td.Error: File "/project1/text1", line 12
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\roboclaw.py", line 647, in ForwardM1
return self._write1(address,self.Cmd.M1FORWARD,val)
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\roboclaw.py", line 311, in _write1
self._sendcommand(address,cmd)
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\roboclaw.py", line 126, in _sendcommand
self._port.write(chr(address))
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\serial\serialwin32.py", line 308, in write
data = to_bytes(data)
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\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: '\x80'
Results of run operation resulted in exception. <type:textDAT path:/project1/text1> <class 'td.textDAT'>
python >>>
Can someone help me to figure out what s happening?
I'm trying to use the python library on a software called touchdesigner(windows 10) to control an engine from serial port.
it supports python and external modules.
I'm trying to do some basic functions but i cant communicate with the board.
At the moment i m still connected via usb serial.
this is the code I m trying to use:
from roboclaw import Roboclaw
#Windows comport name
rc = Roboclaw("COM7",38400)
#Linux comport name
#rc = Roboclaw("/dev/ttyACM0",115200)
rc.Open()
address = 0x80
rc.ForwardM1(address,32)
i got some errors as output:
python >>>
Traceback (most recent call last):
File "</project1/text1:op('/project1/text1').run()>", line 1
td.Error: File "/project1/text1", line 12
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\roboclaw.py", line 647, in ForwardM1
return self._write1(address,self.Cmd.M1FORWARD,val)
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\roboclaw.py", line 311, in _write1
self._sendcommand(address,cmd)
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\roboclaw.py", line 126, in _sendcommand
self._port.write(chr(address))
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\serial\serialwin32.py", line 308, in write
data = to_bytes(data)
File "C:\Program Files\Derivative\TouchDesigner099\bin\lib\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: '\x80'
Results of run operation resulted in exception. <type:textDAT path:/project1/text1> <class 'td.textDAT'>
python >>>
Can someone help me to figure out what s happening?