Input/Output error

General discussion of using Roboclaw motor controllers
Post Reply
Posts: 1
Joined: Mon Apr 08, 2019 8:37 am

Input/Output error

Post by jphartogi » Mon Apr 08, 2019 8:45 am

Hi, I am using roboclaw product in ROS and always got this type of error :

[ERROR] [1554737677.850705]: bad callback: <bound method Node.callback_joy of <__main__.Node instance at 0xb63d9a30>>
Traceback (most recent call last):
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/", line 750, in _invoke_callback
File "/home/robot/git/robot_ws/src/mobina2/roboclaw_ros/roboclaw_node/nodes/", line 74, in callback_joy
File "/home/robot/git/robot_ws/src/mobina2/roboclaw_ros/roboclaw_node/nodes/", line 217, in calculate_encoder
enc = self.rc.ReadEncM1(self.address)
File "/home/robot/git/robot_ws/src/mobina2/roboclaw_ros/roboclaw_node/src/roboclaw_driver/", line 690, in ReadEncM1
return self._read4_1(address,self.Cmd.GETM1ENC)
File "/home/robot/git/robot_ws/src/mobina2/roboclaw_ros/roboclaw_node/src/roboclaw_driver/", line 252, in _read4_1
File "build/bdist.linux-armv7l/egg/serial/", line 584, in flushInput
File "build/bdist.linux-armv7l/egg/serial/", line 595, in reset_input_buffer
termios.tcflush(self.fd, termios.TCIFLUSH)
error: (5, 'Input/output error')

I am connecting the roboclaw to an odroid board using a USB-Hub. What could possibly be the problem??

User avatar
Basicmicro Support
Posts: 1180
Joined: Thu Feb 26, 2015 9:45 pm

Re: Input/Output error

Post by Basicmicro Support » Tue Apr 09, 2019 10:02 am

If you follow the hole trace the error is in the serial class(eg pyserial). This is not part of our code so we cant do much to debug the problem.

If you are using the USB to control the roboclaw this is the most likely cause. It appears to be a port failure in the serial port library which would happen if a USB Virtual Com Port had a glitch. Its a fact that noise from DC motors can cause problems with USB. This is most evident on Windows systems but I would not expect Linux to be able to recover 100% of the time. You may be able to modify the code to catch the exception and then re-initialize the serial port.

The easier solution, if you are using USB is to use a USB isolation adapter or switch to a TTL serial. I've had very good luck with USB Isolation adapters on Windows(not a single glitch since I started using one.

Post Reply