rosserial_server wifi connection Raspberry pi ESP8266 - raspberry-pi

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):
/commands_from_master_node
/topic_data_over_wifi
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.

Related

How to send data between two already configured HC-05 modules pi pico

I'm building an small project in which I'd like to send information from a master HC-05 bluetooth module to an slave one (both of them connected to different pi pico's), I've already synced them following Bluetooth HC-05 master-slave configuration using CircuitPython tutorial, I've finished the set up and now both modules (master and slave) seem to be properly connected, now the problem is that I don't know how to send data from one to the other.
All the tutorials that I've found that imply bluetooth communication seem to do it from a mobile Android app to the slave module, but what I'd like to do is to read data from an analog joystick with one pi pico and send it to through my master HC-05 the slave module (which would be connected to another pico) and then control an electric motor with this received data.
As I understand, the configuration process was finished in CircuitPython but this DOES NOT obligate me to continue with CircuitPython, I mean, I could do my implementation with microPython for example as Circuit Python was used only for the configuration process, is this correct?
My main question is, what is the library/process I could use to send data from master module to slave module?
Pd: I know there is a Raspberry Stack Exchange site but I posted my question here for visibility and also it is related to software too!.

Is it possible to install three mqtt broker server on a raspberry pi

I am looking for a way to install three mqtt broker server on a raspberry-pi hoping that it is going to work , according to the book that the title is 'CEH v10_ EC-Council Certified E - IP Specialist' specially on the page 637 it is written that there are some kind of models in the iot environment like the device to device model , the device to cloud model , the device to gateway model and the back end data sharing model in this model , devices are communicating with the application servers. so in my implementation i want to install 3 application servers (mqtt broker server ) on a raspberry and try to connect them if possible , so can someone please tell me what to do

Ideas to communciate with a BMS and a PLC on RPI using RS 485

I am currently working on a project that involves communication between a PLC , Raspberry Pi 4 and a BMS (Battery Management System) system on a battery.All three device use RS485 for communication using minimalmodbus via python on the RPI.
The Raspberry pi has a generic CAN/RS485 HAT (similar to this : https://www.waveshare.com/rs485-can-hat.htm)
Currently I am able to communicate with the PLC to receive and send data from the RPI with the PLC as a master and the RPI as a slave.
As per my understanding , in order to read data from the BMS using the Pi, the RPI has to be a master. But in this case, as the RPI is a slave to the PLC, and the PLC cannot be used to read data from the BMS.
I would like to know if it is possible for the RPI to function as a Master to the BMS when being a Slave to the PLC at the same time ?
Assuming that it is possible able to connect another RS 485 HAT to the same RPI and run separate scripts for each HAT.

Passive WiFi detection system using WiFi router

As part of my project requirement I want to make a system which will detect all the WiFi devices in my router range either its connected or not, I did some research on it then I found something like wireshark ,kismate etc I just tried the wireshark by making my Mac machine's WiFi as an adhoc network and its all fine I am able to list all the WiFi devices in wireshark, now I want to make a real-time system based on a real WiFi router I don't know how I will configure my router using my PC and how I will monitor the router from my PC , one more thing if I am using this wireshark how I will use this data for my requirement. If any one worked with similar scenarios please help me..thanks in advance
To do that you will need more than the usual API that you have on commercial WiFi routers (by that I mean a full SSH access). I would:
flash my router with OpenWRT (you can search for your router on this page for detailed instructions)
Install the aircrack-ng suite on the flashed router with
opkg update
opkg install aircrack-ng
Put my WiFi card in monitor mode and run the airodump service:
airmon-ng start wlan0 #Put your NIC in monitor mode
airodump-ng mon0 #Sniff surrounding packets
You don't necessarily have to install aircrack-ng, you can just put your card in monitor mode using command line (look at the documentation for your WiFi driver) and then run tcpdump (command line equivalent to wireshark) but aircrack works very well and has a nice format.
Also, I should warn you that you can brick your router by flashing it. I never had such a problem when flashing router mentioned on the OpenWRT wiki and there are (most of the times) ways to restore a bricked router depending on the brand but I am not responsible if you break it ;)

How to Stream data over TCP to a Windows 7 laptop?

Im acquiring data from a sensor using RaspberryPi. Now the idea is to get the data streaming over an ethernet link to my Windows 7 laptop and do the monitoring and recording on the laptop. Can I get some advice on how to implement this in C/C++.
The idea is to get the signal from a sensor streamed to a Windows GUI.
You can push data from your raspberry PI to you Windows
You can have some sort of service on your Windows box and your raspberry PI can push information to your software running on your Windows.
or
you can pull data from your raspberry PI to you Windows
In this case, raspberry PI would be a passive provider and Windows would ask for data.
Hard to give you more information without more details but basically you decide who is going to the passive and active and program that way.
I personally would request data from the raspberry PI to Windows as I can have my service running and just update when I need instead of having my service running and suddenly have my data changing.
That said, it's hard to say without more details.
You need to tell what kind of programming language are you going to use.
According to your question, you need to dig into socket programming.
Recently,I linked my two Raspberry-Pi by writing a python script to establish a TCP connection between them.
and there is this protocol called "RTSP(Real Time Streaming Protocol)" to (as the name says) stream data in real-time.
(If you are to use python , there is this module called gst-python for streaming).
I think the above infos would give you where to start.