ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

No able to use rosserial_arduino

asked 2016-03-21 04:08:17 -0500

nishthapa gravatar image

updated 2016-03-29 01:25:56 -0500

Hello guys, I built ROS indigo on my pi 2 and tried to use the rosserial_arduino (after making my workspace having rosserial metapackage with catkin_make install). The problem is that whenever i try to initialize serial communication with an arduino with rosrun rosserial_python /dev/ttyACM0,it just says : No such file or directory. I checked my ports with ls /dev and my arduino is on ttyACM0. Please help me out.


This problem was solved by rebuilding my workspace with catkin_make install but new errors have crept up again :

This is the error now on executing rosrun rosserial_python /dev/ttyACM0

Traceback (most recent call last):
File "/home/pi/ros_catkin_ws/src/rosserial/rosserial_python/nodes/", line 39, in <module>
from rosserial_python import SerialClient, RosSerialServer
File "/home/pi/ros_catkin_ws/devel/lib/python2.7/dist-packages/rosserial_python/", line 35, in <module>
File "<string>", line 1, in <module>
File "/home/pi/ros_catkin_ws/src/rosserial/rosserial_python/src/rosserial_python/", line 51, in <module>
import diagnostic_msgs.msg
ImportError: No module named diagnostic_msgs.msg
edit retag flag offensive close merge delete


It looks like part of the error message is missing; can you edit your question to include the command you're running and the full error message?

ahendrix gravatar image ahendrix  ( 2016-03-22 01:15:29 -0500 )edit

No. I copy pasted the error message. That's all it says. Nothing more. I checked.

nishthapa gravatar image nishthapa  ( 2016-03-23 01:42:41 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2016-03-29 02:53:04 -0500

nishthapa gravatar image

updated 2016-03-29 02:53:50 -0500

Hey guys i solved it. All i had to do was rebuild my workspace with catkin_make install and install the diagnostic_msgs package into a source built ROS distribution. Thank you all for your help.

edit flag offensive delete link more

answered 2016-03-23 11:58:18 -0500

ahendrix gravatar image

updated 2016-03-29 02:25:20 -0500

There are a couple of possible error scenarios here: either it can't open your serial port, or you don't have a good version of python installed (or something else). Since it still looks like you haven't pasted the complete output from the program, it's hard to tell exactly what is wrong.

If I run rosserial_python and my serial port doesn't exist, I get this message:

$ rosrun rosserial_python /dev/ttyACM0
[INFO] [WallTime: 1458751932.062218] ROS Serial Python Node
[INFO] [WallTime: 1458751932.064663] Connecting to /dev/ttyACM0 at 57600 baud
[ERROR] [WallTime: 1458751932.065596] Error opening serial: could not open port /dev/ttyACM0: [Errno 2] No such file or directory: '/dev/ttyACM0'

If I run rosserial_python and my version of python is broken, I get this message:

$ rosrun rosserial_python /dev/ttyACM0
/usr/bin/env: python: No such file or directory


It now looks like you're missing the common_msgs package (which includes diagnostic_msgs). This seems like a step backwards.

edit flag offensive delete link more


Yes but currently, I dont need the common_msgs but only diagnostic_msgs so I only installed diagnostic_msgs.

nishthapa gravatar image nishthapa  ( 2016-03-29 23:57:59 -0500 )edit

Question Tools

1 follower


Asked: 2016-03-21 04:08:17 -0500

Seen: 1,212 times

Last updated: Mar 29 '16