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"
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
Hey, I am facing the same issue..please let me know if you find any solution
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