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

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.

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

Bidirectionally communicate a Roomba robot other than a Create model with raspberry pi

I've been trying to communicate different models of Roomba vacuum robots, 9xx and 6xx series, with a raspberry using the sci port of the roomba with no success. The sequence of steps have been:
connect pins 3 (rxd), 4 (txd), and 6 (ground) of the roomba port (5v) with a sparkfun logic level converter.
connect the output (3.3v) from the logic level converter to the gpio of the raspberry pi. Roomba Rxd to rpi txd, roomba txd to pi rxd, ground to ground.
connect rpi 5v to logic level converter HV and at the same time LV to gpio pin 1 (3.3v) for feeding high and low voltage required by the logic level converter.
disable serial console of the rpi
enable serial port hardware of the rpi
install and then open minicom in the rpi using this command
minicom -b 115200 -o -D /dev/serial0
place the roomba in the charging dock
I would now expect to read information about the charging process of the roomba in the minicom console but that's not happening.
Anyone knows if any of those steps is wrong?
My goals are to been able to read robots bump sensors in first place and then control movements of the robot from a pc using the rpi in between.
Thanks for any help.
Check this webseite. it's explaining exactly how to connect the roomba to the raspberry using an logic level converter
https://domoticproject.com/roomberry-surveillance-robot-roomba-raspberry-pi-zero-w-camera/

Is it possible to simulate a rs485 slave using pymodbus?

I've been using node-red to simulate TCP and RTU slaves on a raspberry pi and a dell gateway. So far, I've managed to get the TCP slave working, but it doesn't seem possible to do it via rs485 on node-red.
Is it possible to use pymodbus running on a raspberry pi connected to a dell gateway via rs485 to simulate a slave device, because the examples provided only specify a serial connection rather than an rs485 connection specifically? If it is possible, please could you recommend an example that I should use from the pymodbus readthedocs examples?

How to connect Raspberry PI and PROFIBUS?

I have a task to connect PROFIBUS (field bus technology by Siemens) to my Raspberry Pi. I need to make my Raspberry pi as a master and others devices as a slaves.
Let me know if you have any idea about how to make this connection. I am totally new in this topic and have no idea about this.
You might have a look at this project: https://bues.ch/cms/automation/profibus
When I understand it correctly, Profibus (Modbus) ist implemented by RS-485, that is not directly supported by the Raspberry Pi GPIOs.
You have to buy an extra shield or an USB to RS-485 Adapter.
There is also a library to send/receive data using modbus-protocol:
http://libmodbus.org/

How to interface raspberry pi and Mbed microcontroller using I2c?

I want to interface raspberrp pi and Mbed microcontroller through I2c bus. Both operate at 3.3v, I have connected Rpi SCL ----> mbed SCL, RPI SDA------> mbed SDA, RPI gnd -----> mbed gnd. After connecting all these things I run sudo i2cdetect -y 1 command its does not shows any more address connected to Rpi . Both the modules have internal pull up resistor
...
I²C is a master-slave protocol. That means one devices takes over the role of the master, and one (or multiple) devices connected to the I²C bus act as an I²C device.
In your case it seems like the raspberry pi is working as the master. To put the mbed device into I²C slave mode you have to instantiate one I2CSlave class.
Documentation and a tiny example is on the official site:
https://developer.mbed.org/users/mbed_official/code/mbed/docs/tip/classmbed_1_1I2CSlave.html