Is there any example for sending simple messages via the Tool Communication Interface?
I tried to communicate from a UR10e with my laptop via a RS485-USB-Adapter with a slightly changed mydaemonswing example.
in That example i just added this to the get_message method :
def get_message(name):
if str(name):
return "Hello Mr. " + str(name) + “, welcome to PolyScope!”
else:
return “No name set”
ser = serial.Serial(port='/dev/ttyTool',baudrate=115200)
ser.isOpen()
ser.write("hi")
ser.close()
The pyserial library is in the same daemon folder as the hello_world.py file. The library-version is 3.4. I expect to get
a “hi”-message everytime i use the program node but my laptop is not receiving any message.
How far am i from the proper approach of using this Interface?
Did you enable the Tool Communication Interface in PolyScope?
By default, the TCI is disabled, and the pins are acting as analog inputs.
The /dev/ttyTool resource is activated by enabling the TCI in PolyScope, or by the according URScript command.
I did enable the TCI manually in Polyscope. Is my approach of using the Interface fundamentally correct?
Or could it be a problem with the pyserial version?
I discovered the problem. It was my mistake.
The part of the serial communication was after the the return statement of the method so it wasn’t really executed.
Now it is working.
I connected RS485 wire of wrist 3 to a USB converter and into my pc in order to see If I can simply read a message. I was planning on running PuTTY to establish a connection for reading.
However, I cannot even run the program because in the Installation Node it states My Deamon Swing Failed. I can’t seem to figure out the problem.
It seems like the location on the pyserial library is in
/home/ur/.local/lib/python2.7/site-packages
And it is the serial folder.
Also, you stated that the deamon runs successfully when using '/dev/ttyUSB0. Out of curiosity, were you running ths ont he UR simulator? Because I cannot seem to find /dev/ttyUSB0
Ahhh I see, so you connected a USB to your laptop which leads to a serial device. Which I assume creates that “/dev/ttyUSB0” port.
What I was doing was using a physical UR robot and connected its Tool Communication Interface to my laptop using a RS485 to USB converter so I had to use “/dev/ttyTool” since it is the built in port on the robot.
(NOTE: first you have to enable this since it is default is disabled)