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.

Hello @Abdu ,

1. Run the socat command (sudo socat pty,link=/dev/ttyUSB0,raw,ignoreeof,waitslave tcp:<robot-ip>:54321) on your ROS machine and confirm that you have /dev/ttyUSB0 device afterwards. Also, make sure to replace <robot-ip> with the true IP address of your robot.
2. Still on your ROS machine, run: "chmod 777 /dev/ttyUSB0" to provide the symbolic link read and write permissions
3. Then, ssh into the ur controller (with username=root and password=easybot) and confirm there is a /dev/ttyUSB0 device there too.
4. Still on the UR Robot, give read and write permissions to the device for everybody: sudo chmod 777 /dev/ttyUSB0
5. Then run the following socat command meant specifically for the ur: socat tcp-l:54321,reuseaddr,fork file:/dev/ttyUSB0,nonblock,raw,waitlock=/var/run/tty
6. Then, back on your ROS machine: rosrun robotiq_2f_gripper_control /dev/ttyUSB0 which hopefully will run with no errors (only a warning). You should now also see the gripper's led color switch from red to blue.
7. On your ROS machine, you can now try running the simple controller script: rosrun robotiq_2f_gripper_control to interact with the gripper.

This method is very much inspired from how peripheral forwarding works on eseries UR robot. Basically, what this does is the redirection of everything was trying to send to /dev/ttyUSB0 directly to your robot, using its IP address and a free arbitrary port (54321). Then, on the robot side, everything your robot will receive on port 54321 will be redirected to /dev/ttyUSB0, which should be your physical device. Please note that you should make sure both socat commands run at the same time on both ends (your computer & the UR controller). Make sure /dev/ttyUSB0 exists on both ends too. Additionally, for debug purposes and/or to make sure everything is alright, you could ssh in the robot, run its associated socat command (see step #5 above) and then check the output of:

sudo netstat -tulpn | grep LISTEN | grep 54321

This command should output only one line, confirming that the port "54321" is indeed opened and listening. If you are able to see the gripper's led switching from red to blue at step #6 above, this is a very good sign (i.e. communication is working). However, chances are you could still suffer from latency issues afterwards too. If you reach that point however, I will most likely be able to provide a patch for you to make it work. 

I know this is a lot of information and I would still recommend to connect your gripper directly to your ROS machine if possible. Doing so, you will most probably avoid a lot of potential troubles. However, if it is impossible for you to do so, I'll be happy to assist you the best I can, however without any guarantee unfortunately I'm afraid.

Please don't hesitate to write back to me, should you have any other questions or concerns.

Best regards,

Jean-Philippe Roberge,
ROS Package Developper / Maintainer


@jproberge I sucessfully ran `` and `` following your instructions which is extremely detailed, thanks so much!!  I'm using a AUBO i5 robot instead UR robot. At first `rosrun robotiq_2f_gripper_control /dev/ttyUSB0` gave me an Attribute Error:

xxwang@MS-7A54:~/ROS_Workspaces/ros_k4a_auboi5_ws$ rosrun robotiq_2f_gripper_control /dev/ttyUSB0

Traceback (most recent call last):

  File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_2f_gripper_control/nodes/", line 89, in <module>


  File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_2f_gripper_control/nodes/", line 75, in mainLoop

    status = gripper.getStatus()

  File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_2f_gripper_control/src/robotiq_2f_gripper_control/", line 107, in getStatus

    status = self.client.getStatus(6);

  File "/home/xxwang/ROS_Workspaces/ros_k4a_auboi5_ws/src/robotiq/robotiq_modbus_rtu/src/robotiq_modbus_rtu/", line 95, in getStatus

    output.append((response.getRegister(i) & 0xFF00) >> 8)

AttributeError: 'ModbusIOException' object has no attribute 'getRegister'

Then I found I'm not the only one running into this trouble, plenty of users reported the same or similar issues on github, and I found no general solution to this. I reckoned then this `getRegister` error is quite obscure, and it can be due to a bunch of more specific errors. I tried every method [previously mentioned]( but none did resolve this issue. I finally found the true error for me is that the gripper not being 'connected' with the AUBO Robot (controller) —— 'connect' button inside gripper plugin must be pressed on Robot teach pendant before running ``.

Above is my feedback and a little supplementary, and thank you for your suggestions!