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

rosserial arduino Serial Port read failure

asked 2014-06-13 08:28:38 -0600

honky gravatar image

Hi, I've written a small sensor_msgs::Imu publisher on a arduino micro which works for a short time but crashes after some seconds with following status:

[INFO] [WallTime: 1402665675.175567] Note: publish buffer size is 512 bytes
[INFO] [WallTime: 1402665675.176102] Setup publisher on /imu_data [sensor_msgs/Imu]
[WARN] [WallTime: 1402665687.484972] Serial Port read returned short (expected 1 bytes, received 0 instead).
[WARN] [WallTime: 1402665687.485703] Serial Port read failure: 
[ERROR] [WallTime: 1402665699.934101] Lost sync with device, restarting...

I supposed this might be some buffer overflow, which is why I increased the nh.spinOnce() during the loop to no effect.

What does the message mean and how can I fix it? Thnx in advance.

edit retag flag offensive close merge delete


You can check how much RAM you actually use with avr-size, see here : and the rosserial documentation :

al-dev gravatar image al-dev  ( 2014-06-13 09:20:12 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-06-13 11:15:32 -0600

honky gravatar image

updated 2014-06-13 11:16:14 -0600

The library I used had some weird Serial.print()'s in the middle of the code which kinda scrambled the communication with ros. Removing them all fixed the problem.

Thanks to al-dev for the link in the comments, had been an interesting read anyhow.

edit flag offensive delete link more


i have the same problem: lost sync , port read failure. How did you solve it please? I passed a message with 3 float members to arduino mega and it seems lost sync error all the time

dmngu9 gravatar image dmngu9  ( 2015-07-20 05:38:14 -0600 )edit

answered 2016-09-02 01:40:58 -0600

bob gravatar image

I had this problem and found GORT which is a serial monitor program was the error. Just having GORT installed caused the connection to behave erratically so you have to completely uninstall gort and restart the computer

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2014-06-13 08:28:38 -0600

Seen: 2,750 times

Last updated: Sep 02 '16