Modbus library

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
Post Reply
MauroDiam
Posts: 1
Joined: Thu Jul 23, 2020 1:38 pm

Modbus library

Post by MauroDiam » Thu Jul 23, 2020 2:24 pm

Hello people, I'm starting an IoT project and I've decided to use the NodeMCU board. The project consists of remote monitoring of electrical grids, so then it is composed of a module which takes a lot of data from a power grid analyzer and then sends that to a remote server through the internet. I decided to use NodeMCU because it has already implemented a WiFi interface and it's very cheap. However, I have realized I'm going to have problems with the communication with the power grid analyzer because that one has an RS485 interface and implements the Modbus protocol. There is no problem with the RS485 interface because I'm going to use an adaptor to UART, but I wasn't been able to find a Modbus library for MicroPython. I have just found these options:

https://pypi.org/project/uModbus/ (Intended for CPython not MicroPython)
https://github.com/techbase123/micropython-modbus (Intended justo for ESP32)
https://github.com/riptideio/pymodbus (I'm not sure if it's compatible with MicroPython and NodeMCU)

Do you know some Modbus library I can use? Or is it possible to adapt one of the mentioned library to MicroPython? :ugeek:

eiRee9e
Posts: 1
Joined: Sun Aug 09, 2020 8:31 pm

Re: Modbus library

Post by eiRee9e » Sun Aug 09, 2020 9:05 pm

I have searched all over for such a library but it's not implemented yet.
I'm assuming you need to read data from the nodemcu device running micropython.
At the present there is only modbus libraries which will make the micropython device act as a master but not as a slave, this is one of your links to ESP32.
Master = will read a modbus slave/server device on the network
Slave = will be read by a master device on the network
So exactly the same functions to work as TCP and RTU slave will be required, the link below is for a master device only.
https://github.com/techbase123/micropython-modbus
I'd like to help with this library to be implemented and by no means I'm a programmer by I can modify software and tinker with it.
Also this library would make MicroPython's entry into industrial automation communicating via modbus which is used everywhere since it is a robust and reliable means of communication.

Post Reply