Rosserial arduino connectivity problem
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?