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

Rosserial arduino connectivity problem

asked 2015-08-11 14:35:42 -0500

luketheduke gravatar image

I am using rosserial with the Arduino libs and am having some connection problems. When I run the command rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 it does one of two things. Either it (A) connects as normal and runs. Or (B) it sits for 15 seconds and then outputs the following: [ERROR] [WallTime: 1439320837.046067] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino If I change the usb port it is plugged into it doesn't help. If I reupload the firmware on the Arduino it sometimes works. I would say that it works in total 1 in 15 tries. I am using Ubuntu 14.04LTS with Indigo and an Arduino Mega 2560. All the firmware and packages and Arduino libs are the newest versions from the repos. Here is what it looks like when it doesn't connect:

 lukas@lukas-Inspiron-N7010:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0
[INFO] [WallTime: 1439320819.907501] ROS Serial Python Node
[INFO] [WallTime: 1439320819.935958] Connecting to /dev/ttyACM0 at 57600 baud
/opt/ros/indigo/lib/python2.7/dist-packages/rosserial_python/SerialClient.py:336: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.pub_diagnostics = rospy.Publisher('/diagnostics', diagnostic_msgs.msg.DiagnosticArray)
[ERROR] [WallTime: 1439320837.046067] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

Here is what it looks like when it connects:

lukas@lukas-Inspiron-N7010:~$ rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0
[INFO] [WallTime: 1439319913.790014] ROS Serial Python Node
[INFO] [WallTime: 1439319913.808376] Connecting to /dev/ttyACM0 at 57600 baud
/opt/ros/indigo/lib/python2.7/dist-packages/rosserial_python/SerialClient.py:336: SyntaxWarning: The publisher should be created with an explicit keyword argument 'queue_size'. Please see http://wiki.ros.org/rospy/Overview/Publishers%20and%20Subscribers for more information.
  self.pub_diagnostics = rospy.Publisher('/diagnostics', diagnostic_msgs.msg.DiagnosticArray)
[INFO] [WallTime: 1439319916.480911] Note: subscribe buffer size is 512 bytes
[INFO] [WallTime: 1439319916.481547] Setup subscriber on cmd_vel [geometry_msgs/Twist]
[ERROR] [WallTime: 1439320269.651536] Lost sync with device, restarting...
^C (Note: I pressed Ctrl+C because it did not resync.)

[INFO] [WallTime: 1439320298.806795] Send tx stop request

Also I have noticed that when the package loses sync with the Arduino it can't resync and I have to restart the node... If needed I can post the Arduino code. Any ideas?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-03-25 19:19:18 -0500

kramer gravatar image

No idea if this is related to your issue, but I was seeing something similar (also 14.04 and Mega2650). As it turns out, I had debugging turned on with a 3rd-party (i.e., non-ROS, non-arduino-supplied) object that was attempting to send data over the USB (as you know, on a Mega2650 board, no ethernet or bluetooth).

As was obvious to me once I realized what was happening, when another object fills the serial line with data, ROS won't be able to sync. Since your board does connect (at least sometimes), it can't be quite that easy; but, since your question was "Any ideas?", maybe the data line is being utilized by a non-ROS object?

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2015-08-11 14:35:42 -0500

Seen: 2,402 times

Last updated: Mar 25 '16