This post is related to ROS (Robot Operating System) and ESP8266, and has also been cross-posted on ROS Answers and Robotics Stack Exchange.
I've ROS Melodic running on a Raspberry Pi 4 and need to send out information (as strings) over wifi to multiple ESP8266. I'm only just starting so it's just one ESP8266 for now. For communication, I'm using socket_node
found in the ROS package rosserial_server
(package wiki).
Referring to the picture below, the slave node publishes to the topic /Topic_data_over_wifi
which is subscribed by a node running on the ESP8266:
The problem is, the node /rosserial_server_socket_node
remains floating!
I've double checked names of topics and IP addresses, and at one point, got the node /rosserial_server_socket_node
to actually link to the rest of the ROS network as shown in the "What I want" section. However, that was just one time (a fluke?) and never could I again get /rosserial_server_socket_node
to join the ROS network.
rosserial_server
's socket_node
is used with its default settings (port 11411). I did try other port numbers but there was no difference. After all nodes have been launched, here's the output of rostopic list
(other than the usual /rosout and /rosout_agg):
Goal: I need to find a way to connect the ESP8266 and the Raspberry pi 4 over wifi using ROS. More specifically, I need to get data from the slave node (on Raspberry Pi) to the node running on the ESP8266.
I've already looked at this multiple-TCP-connections post but didn't find anything that could solve my problem.
Any inputs/suggestions will be very appreciated.
Depending on the software running on the ESPs, it might be an option to use the ROS MQTT bridge. The downside is that you will need an additional MQTT broker (I am not sure, but as I recall mqtt_bridge is an MQTT client and requires a broker like Mosquitto). You can add MQTT clients to the ESPs and connect them to the same broker and subscribe to MQTT messages. In other words, you create a MQTT network for the ESPs with their borker and add ROS to that network, via mqtt_bridge. If you are not running ROS specific software on the ESPs it should work fine.