0

I am currently learning Python and started using it on a Raspberry Pi 3. I have managed to read all the sensor data into variables (the data is read by a network of Arduino Nanos, each with its own sensors and transmitted with the help of NRF24L01+).

Now, my big issue is sending this data from Raspberry to a SCADA system that uses Modbus TCP.

Could someone direct me in the direction of implementing a Modbus TCP server that populates the holding registers with the values from the sensors? Also, the SCADA system will write into some holding registers in order for Raspberry to have some setpoints established, so Raspberry will be reading those particular registers.

Thanks in advance!

  • Please post the code you have so far. – Gabriel Apr 16 '18 at 14:31
  • I don't have code for modbus yet, that is why I wanted some directions into implementing it. – Voicu Mihuţ STĂNESE Apr 16 '18 at 15:20
  • You can try pyModbusTCP, they have a server (Modbus slave) implementation. – algrid Apr 30 '18 at 18:08
  • Pymodbus has a rich set of examples on how to create various servers with customisable data fields . refer https://pymodbus.readthedocs.io/en/latest/source/example/synchronous_server.html – Sanju May 02 '18 at 04:35
  • So far, I was able to make the pyModbus work and with a client read the data stored inside. Separately I made the NRF24L01 library work and read from an Arduino the data from a DHT22 sensor. Now, when I want to read multiple sensors, I get "Unhandled error in Deferred: " in the debug console. The code I am using is here: [link](https://pastebin.com/ChBwtP1f) and the debug is here [link](https://pastebin.com/DA5pfJnv) The library I am using for NRF24L01 is a slightly tweaked version of Barraca's pynrf24 [link](https://pastebin.com/XaX7WuTt) – Voicu Mihuţ STĂNESE May 24 '18 at 09:09

0 Answers0