The program started, the messages ROS serial Python node and Connecting to /dev/ttyCORE2 at 57600 Baud appeared, but after a few seconds there appears an error message:
Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
“roscore” is running on the RPi and shows kinetic as distro, After starting “ros-core-client” “rosnode list” shows an additional node “/serial_node”.
Working offline or online don’t have any matters here. If you don’t mind I would like to see all your code to check what the problem is. After that I will can give you some more info.
It will work offline, you only need internet access for first setup. If you want to avoid internet access at all, you can disable it and connect ROS directly to CORE2 serial port.
First disable Husarion service (systemctl disable husarion-shield) and reboot (you can reenable it later with systemctl enable husarion-shield). Then change the program to connect directly to the serial port:
void hMain()
{
//platform.begin(&RPi); // comment this line
nh.getHardware()->initWithDevice(&RPi); // change here
nh.initNode();
nh.subscribe(sub);
// ...
Later, use /opt/husarion/tools/rpi-linux/ros-core2-client /dev/ttyS1 to connect CORE2 to ROS network.
Also, please make sure you have updated your system (apt-get update; apt-get dist-upgrade -y) - I have also pushed update fixing other possible problem.
That works.
But after a short time I get “Lost sync with device” messages and I have to restart Core2.
I am publishing a “sensor_msgs/Range” and a “sensor_msgs/BatteryState” message with a delay of 100ms.
Running the “/opt/husarion/tools/rpi-linux/ros-core2-client /dev/serial0” command gives me the following output:
Unable to register with master node [http://localhost:11311]: master may not be running yet. Will keep trying.
[INFO] [1512504303.906058]: ROS Serial Python Node
[INFO] [1512504303.955650]: Connecting to /dev/serial0 at 500000 baud
[ERROR] [1512504321.072081]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
[ERROR] [1512504336.076856]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
I just did a apt update and upgrade before trying the command.
As you can also see I forgot to start roscore at first, but starting roscore before doing the command also doesn’t work.
Yes I use a pi3, I want it to work with the cloud at the moment. Is there a default baudrate the core2 uses? Or can I just set my own baudrate with rosserrial_python and match it with the core2?
Now I’m getting the following messages:
[WARN] [1512548579.110756]: Serial Port read failure: device reports readiness to read but returned no data (device disconnected ormultiple access on port?)
[ERROR] [1512548586.069841]: Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino
I know that I need to run roscore first, that was just a small mistaken which I only did once.
I got my code working now :).
I was using the /dev/serioal0, and that doesn’t work when I’m connected to the cloud.
I also did try with /dev/ttyCORE2 but that had failed all the times, I’m not sure what I’m doing different now.
But with rqt_graph I could se that the serial node was there but not connected to the /cmd_vel.
First I tried the code from the tutorial and then my previous code which now also works.
I can upload my code if someone else has trouble with getting this to work.