rosserial
rosserial copied to clipboard
"Mismatched protocol version in packet" when building from source in ROS kinetic
I need to build rosserial for kinetic from source as I want to implement my own custom package, which includes a custom message (more to come in the future). Prebuilt rosserial libraries for kinetic work well and I am able to establish connection.
However, I tried building rosserial from source having the extra package. It builds successfully but when I run rosserial_python, it gives me the following:
[ERROR] [1516956433.836973]: Mismatched protocol version in packet: lost sync or rosserial_python is from different ros release than the rosserial client [INFO] [1516956433.837802]: Protocol version of client is unrecognized, expected Rev 1 (rosserial 0.5+)
The exact same code from the arduino side works perfectly with the prebuilt libraries. I even tried not using my custom message and use a tf message without success.
Any ideas?
A small update on this: I am using ESP32 for my tests. I noticed that I couldn't call setBaud() either, so I changed the #include ArduinoTcpHardware to #include ArduinoHardware. Sure enough, setBaud() is recognized and the connection is established successfully.
That was on the d288a48c3fa22a417b0ae227dd823f12e8c59c9a commit when ESP32 support was added. Now I will try on the latest commit, but that should be the issue.
Plus, having 512B buffers on the ESP32 is quite conservative. Maybe they should be increased.
Are you using the WiFi connection or a serial port?
Because there is no baudrate in a TCP connection (ArduinoTcpHardware
).
I want to use the serial port. Is there a flag somewhere to trigger this? Because at the moment, ArduinoTcpHardware seems to be replacing rather than extending ArduinoHardware.
Yes exactly, sadly, using an ESP8266 or ESP32, the TCP version is automatically chosen, see here:
https://github.com/ros-drivers/rosserial/blob/c58e2f11b2ff8060b86a9c50982e31ce02f802ab/rosserial_arduino/src/ros_lib/ros.h#L40-L44
One should add a new #define
to for using the classic ArduinoHardware
.
But as @mikepurvis already mentioned several times, there is already too much defines
in that code, we should try to find a cleaner way to do all theses selections.
But I think that for now, a new #define
could be added.
Ok, fair enough!
I've been having the same issue with an Adafruit ESP32 feather. Changing to #include "ArduinoHardware.h
as @AgtCain suggested seems to solve it. Before the change, e.g HelloWorld program worked only on Arduino while on ESP32 it was throwing Protocol mismatch
I got this same error message from a Teensy board that was programmed from a laptop with Ubuntu 18.04 and Melodic. The other code that was running on the robot used Ubuntu 20.04 and Noetic. I thought the versions should be fine but Rosserial worked for only 10 seconds before throwing the error and quitting.
This message comes up from Rosserial when there is a problem with the communications. It may be reporting a performance issue and not actually a version mismatch. It's just a general error message, actually. Try slowing down the communications (using less bandwidth) and it may straighten out. It did for me.
This issue still persists. I am running ROS Noetic on Ubuntu 20.04
I have the same problem with communication between Ros noetic and ESP32-poe-ISO. Does anyone have a solution for this, I have tried every solution found on google (change protocol version, tried with different baud) but still the same problem.
[ERROR] [1659340352.999949]: Mismatched protocol version in packet (b'\xce'): lost sync or rosserial_python is from different ros release than the rosserial client
My ESP-32 was running at 240Mhz, when I changed it to 160Mhz this error was gone. You change it in the Arduino IDE tools>CPU frequency
I am experiencing the error 'Unable to sync with device;' however, it is a random occurrence, usually happening when I upload the code to the ESP, start the roscore, and then run rosrun. It works sometimes, but then the error keeps happening every time. I am using nh.getHardware()->setBaud(115200);, I have checked the ROS version with the rosserial version, and I have tried modifying the ros.h in the library, but nothing seems to work :(
I have the same error with my ESP32 WROOM. I make as the @joedavid-tuni said and I changed to 160Mhz and work it!
@HerickDallagnol @Trushal23 @tsadarsh Did yall manage to solve the error , if yes please do share
@HerickDallagnol @Trushal23 @tsadarsh Did yall manage to solve the error , if yes please do share
The only way I managed to make it work was by resetting the ESP32 during the connection with rosserial. After running and encountering this error, I hold the reset button on the ESP, and magically it works. I've tried several other methods, but this was the only one that worked in my case. I'm exploring possibilities to reset the ESP32 programmatically without the need to press the button