Ros Serial arduino is working fine with Arduino UNO but when using ESp8266 instead of arduino UNO its throws the error of "Unable to sync with device"

asked 2020-11-14 23:02:48 -0500

Arvind Pandit gravatar image

Uploaded Code

/* * rosserial Publisher Example * Prints "hello world!" */

#include <ros.h> #include <std_msgs string.h="">

ros::NodeHandle nh;

std_msgs::String str_msg; ros::Publisher chatter("chatter", &str_msg);

char hello[13] = "hello world!";

void setup() { nh.initNode(); nh.advertise(chatter); }

void loop() { str_msg.data = hello; chatter.publish( &str_msg ); nh.spinOnce(); delay(1000); }

ERROR

Unable to sync with device; possible link problem or link software version mismatch such as hydro rosserial_python with groovy Arduino

edit retag flag offensive close merge delete

Comments

Hey, I am facing the same issue..please let me know if you find any solution

vassi_3997 gravatar image vassi_3997  ( 2022-02-20 00:48:01 -0500 )edit

You can try by commenting the following block of code from one file of the library

File path : /Arduino/Libraries/ros_lib/ros.h

/*

#if defined(ESP8266) or defined(ESP32) or defined(ROSSERIAL_ARDUINO_TCP)

#include "ArduinoTcpHardware.h"

#else

#include "ArduinoHardware.h"

#endif

*/

and add this

#include "ArduinoHardware.h"

Save and reupload the code to ESP again

Arvind Pandit gravatar image Arvind Pandit  ( 2022-02-23 09:47:13 -0500 )edit