0
$\begingroup$

Rosanswers logo

I'm practising rosserial-arduino. When I first boot my virtual machine running Ubuntu14.04 with Indigo installed, and run serial_node.py, It is OK.

root@ling-virtual-machine:~# rosrun rosserial_python serial_node.py /dev/ttyACM0 

[INFO] [WallTime: 1448193768.523920] ROS Serial Python Node

[INFO] [WallTime: 1448193768.534337] Connecting to /dev/ttyACM0 at 57600 baud

[INFO] [WallTime: 1448193773.248642] Note: publish buffer size is 280 bytes

[INFO] [WallTime: 1448193773.249588] Setup publisher on chatter [std_msgs/String]

Then I abort it (^c) and connect arduino to win7(host) and upload another program. When I reconnect to ubuntu and try to open serial port, this error occur.

root@ling-virtual-machine:~# rosrun rosserial_python serial_node.py /dev/ttyACM0

[INFO] [WallTime: 1448195076.373184] ROS Serial Python Node

[INFO] [WallTime: 1448195076.451019] Connecting to /dev/ttyACM0 at 57600 baud

[ERROR] [WallTime: 1448195093.843222] Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

And I rebooted ubuntu and redo the same thing. results are the same. succeed on first try and fail on the second. I'm using ros_lib generated by catkin. I really wonder why.


Originally posted by Gure Ling on ROS Answers with karma: 3 on 2015-11-22

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi! I also encountered the same problem and fixed it, finally. It displays "Connecting to /dev/ttyACM0 at 57600 baud" while the baud rate in my Arduino code was set to be 115200. Hence, set the baud rate as it was in your arduino code (In my case it is 115200) by adding _baud:=X (where 'X' is the baud rate between your computer and the Arduino) to the same command as follows:

rosrun rosserial_python serial_node.py _port:=/dev/ttyACM0 _baud:=115200

The other reason could be that your port is different from that of the above command. For example, check if your port to which the Arduino is connected, is as entered in the above command i.e, ttyACM0 or ttyACM1 etc . Hope this helps!


Originally posted by Karthikeya Parunandi with karma: 78 on 2016-05-27

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by adelleodel on 2016-06-02:
hey, how do you know setting of baudrate in Arduino? in my case when i follow these tutorial, i don't see any baudrate set. how do you know which baudrate of your arduino then?

Comment by Karthikeya Parunandi on 2016-06-02:
Hi! In my case, it was set or rather changed in my code already. If it is not, as in your case, I guess it would be a default of 57600 which means you need not enter your baud rate. Again, this is my guess!

Comment by Gure Ling on 2016-06-02:
Hi! thank you for your advice but there is something wrong with my PC these days and get no chance to have a try (bad luck). When I fixed my mass I'll pick up that practise again. Thank you again.

Comment by adelleodel on 2016-06-02:
@karthikeya, it has default baudrate 57600, and it was success connected at first, but in the middle time when i move my servo, sometimes it suddenly break the connection. so i guess the rate is being too high, i want to change it a bit slower like 9600.. er, thanks for your response earlier anyway

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.