rosserial running please

asked 2016-05-01 08:02:29 -0600

Emilien gravatar image

updated 2016-05-02 14:13:06 -0600

hi, I use ROS indigo. when i run rosrun rosserial_python /dev/ttyACM0, i receive this error:

$ rosrun rosserial_python /dev/ttyACM0
[INFO] [WallTime: 1461764416.016787] ROS Serial Python Node
[INFO] [WallTime: 1461764416.185233] Connecting to /dev/ttyACM0 at 57600 baud
Traceback (most recent call last):
  File "/home/pi/catkin_ws/install/lib/rosserial_python/", line 80, in <module>
    client = SerialClient(port_name, baud)
  File "/home/pi/catkin_ws/install/lib/python2.7/dist-packages/rosserial_python/", line 382, in __init__
  File "/home/pi/catkin_ws/install/lib/python2.7/dist-packages/rosserial_python/", line 389, in requestTopics
  File "/usr/lib/python2.7/dist-packages/serial/", line 500, in flushInput
    termios.tcflush(self.fd, TERMIOS.TCIFLUSH)
termios.error: (5, 'Input/output error')

What can i do please?

edit retag flag offensive close merge delete


Are you running Arduino on the same Baud rate (57600)?

Muhammed Alsayadi gravatar image Muhammed Alsayadi  ( 2016-05-01 16:02:46 -0600 )edit

yes on the same.

Emilien gravatar image Emilien  ( 2016-05-01 17:20:48 -0600 )edit

Are you sure that your device is connected to your machine and assigned to /dev/ttyACM0? Do you have permission to read and write from that device? Further, are you sure that no other program is using that device?

jarvisschultz gravatar image jarvisschultz  ( 2016-05-02 17:13:48 -0600 )edit

i add :

cmake_minimum_required(VERSION 2.8.3)


# Remove this if using an Arduino without native USB (eg, other than Leonardo)

  SRCS chatter.cpp ${ROS_LIB_DIR}/time.cpp
  BOARD uno
  PORT /dev/ttyACM0
Emilien gravatar image Emilien  ( 2016-05-03 03:09:01 -0600 )edit

but i don't know where is the problem

Emilien gravatar image Emilien  ( 2016-05-03 03:10:30 -0600 )edit

Have you checked the points I mentioned? When you google the Input/output error you're getting it seems like permissions/incorrect ports/locked ports are the most common issues.

jarvisschultz gravatar image jarvisschultz  ( 2016-05-03 07:17:41 -0600 )edit

how? can you explain it more please?

Emilien gravatar image Emilien  ( 2016-05-03 07:51:38 -0600 )edit

Incorrect Port Make sure when the device is connected a new file, /dev/ttyACM0 is created. You can find this by looking at the output of ls -la /dev/ttyACM* before and after connecting your device. You can also look at dmesg. A command I often use is watch -n 0.2 "dmesg |tail -n 20".

jarvisschultz gravatar image jarvisschultz  ( 2016-05-03 14:41:33 -0600 )edit