DoF - a Robotiq Community
Warning sign
The Dof Community was shut down in June 2023. This is a read-only archive.
If you have questions about Robotiq products please reach our support team.
matthewd92

@jensss I am not sure what is happening, I recreated your code but did it slightly different as I was getting some errors but I do not see the message received error that you are seeing.

Here is my python code

import socket
import time
host = "127.0.0.1"
port = 5001

print("Program Start")
tel = 0

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((host, port))
s.listen(1)
c, addr = s.accept()

while (tel < 10):
try:
msg = c.recv(1024)
print(msg)
c.send("Messsage '"+msg+"' was received")
if msg == "Stop":
tel = 10
print(tel)
except socket.error as socketError:
tel = 10
print(socketError)
print(tel)

c.close()
s.close()
print("Program Finished")

One thing I will note, in testing with SocketTest I never could enter the condition for "Stop", the string received never had equality to the string "Stop", not a python programmer so not sure what is up there.

Here is my Polyscope program, you can see in the variables the result of where the server sent back a response string

zoom
Also, I think you will run into an issue when you try to send your move command to the robot, that will stop the execution of the program that you are running.  The controller can only have one program controlling the main thread at one time.  By sending that single line program in it will halt the program running on the robot to run that single line.  Generally when we are doing something like this we are asking for position data, the server then sends the position data as a list and then the robot is responsible for putting it back together into a pose for use in a move command.

I am currently running Python 2.7.16