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

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!.

Related

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.

rosserial_server wifi connection Raspberry pi ESP8266

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.

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.

How to control modems inside a GoIP gateway with AT commands

We have acquired a 4 channel GSM Gateway, model GoIPx4-G610 (the manual is titled "GoIP Series SIM Card for GSM Voice Gateway - GSM VOIP Gateway").
We are looking to develop a custom application to control the GOIP gateway. We have developed in the past custom applications that controlled simple GSM modems through AT commands for sending/receiving SMS messages in particular.
Although the gateway can be controlled through SIP we would like to control the GSM modems embedded in the gateway through AT commands if possible. This is because of the fine grained control AT commands offer and because we do not need VoIP features since we need only to send/receive SMS messages.
The gateway runs an unknown Linux instance to which we can connect through telnet. Unfortunately we do not have the credentials to authenticate to it. The gateway also has a web http administration interface to which we can authenticate but we can't find there settings/information related to channels that we can use for AT commands.
The documentation is very poor and the provider could not offer us any helpful information regarding this.
If anyone knows how we can send AT commands to the modems inside the gateway it is highly appreciated.
Up to now we have tried a brute force attack on the telnet interface to find the credentials with no success. We hope that once we can connect to the Linux instance driving the gateway we can connect from there to the modems through serial connections (to send AT commands) and we can reconfigure it to redirect the connections outside of the modem or to make an interface for sending commands to the modems.
The device has an update firmware option (through the web interface) which always gives the error "download failed". Downloaded the firmware (.pkg file) manually from their update pages and extracted the files from the embedded Linux distribution that should correspond to the ones placed on the gateway. The files were kept in the pkg file as an ROMFS compressed image which we mounted on a test station to see the files (probably the running OS on the gateway is an uClinux distribution).
Did this hoping that we can find there the /etc/passwd file which could be cracked with classic attack. However didn't found it and probably that file is placed on the gateway flash memory (contrary to the Linux files which are stored on the ROM memory). So if there is a way to erase / reset this flash memory that could be a solution (in case the gateway doesn't refuse to boot without those files). Another solution would be to be able to access the flash memory with the passwd file if there is such thing.
You might take the lid off and see what parts are inside.
If it's a general purpose processor with a published data sheet and without a lot of code security features, you might be in luck. For example, you might find:
By guessing headers or tracing from known pins, a console serial port, either logic level or RS232, hopefully with a shell listening
A boot mode pin for the micro connected to a resistor, which you could jumper to cause the micro to boot to a uart bootloader where you could download a new system image, or patch the existing one. If you are lucky the bootloader would be something known, like u-boot.
A JTAG port for the processor
A removable storage device which you could remove and alter
an SPI flash which you could carefully tap into and alter
A flash chip which you could desolder and transplant to a programmer
You could also make a GPL sources request for the kernel and whatever else from the vendor. Or even just trying to identify versions of things like a web server could help you look up any known exploits. Since it seems you have a similar system image to that which is installed, looking through it could be helpful - look for additional daemons running, listening on ports you weren't previously aware of, left over debug support, etc.
I am the developer of the GoIP you've purchased. Instead of trying to hack the GoIP, did you contact us to support your development of custom applications? Here are the updates of GoIP for you.
GoIP now supports SMPP. This could be an alternative to using AT commands to send and receive SMS.
API (Application Programming Interface) for GoIP is now available to support your custom application development.
If AT commands are still the preferred method, please contact us and I would be happy to discuss with you further.