Hi all,
I work in the electronics industry. For me it lacks a great standard to introduce micropython into this field: modbus
It would be very easy to integrate a new Modbus slave on an existing network. (modbus master is rarely a small microcontroller)
Thanks,
I'm searching a modbus library
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: I'm searching a modbus library
This is something of a FAQ and there is evident interest in a library. As far as I can see the Pyboard could support Modbus but nobody has written a library. It needs someone with access to a Modbus master to roll up their sleeves and get coding.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: I'm searching a modbus library
I just want to clarify what you are asking:
You want to setup a Pyboard as a modbus slave on an existing TCP network so that it can be controlled by a master device on same network. I presume you want to be able to use the digital inputs/outputs as well as analog in/out.
In the past I have used standard linux computers (acting as master) with modbustcp (python) to control modbus devices such as Advantech ADAM modules. I think I have recently seen some code which allows a Raspberry PI to act as a Modbus slave. Maybe such a code can be adapted for your use.
You want to setup a Pyboard as a modbus slave on an existing TCP network so that it can be controlled by a master device on same network. I presume you want to be able to use the digital inputs/outputs as well as analog in/out.
In the past I have used standard linux computers (acting as master) with modbustcp (python) to control modbus devices such as Advantech ADAM modules. I think I have recently seen some code which allows a Raspberry PI to act as a Modbus slave. Maybe such a code can be adapted for your use.
Re: I'm searching a modbus library
Exactly, in RTU moderpr wrote:You want to setup a Pyboard as a modbus slave on an existing TCP network so that it can be controlled by a master device on same network. I presume you want to be able to use the digital inputs/outputs as well as analog in/out.
Yesrpr wrote:In the past I have used standard linux computers (acting as master) with modbustcp (python) to control modbus devices such as Advantech ADAM modules. I think I have recently seen some code which allows a Raspberry PI to act as a Modbus slave. Maybe such a code can be adapted for your use.
I have already programmed modbus servers to control the slave (with minimalmodbus) but never in slave mode (I haven't found library).
Today I will be able to decode all the frames and then send the answers in the right format and with the CRC (manualy) but a library help me a lot
thanks,
Re: I'm searching a modbus library
That is fantastic. I'd be interested in seeing the resulting code. If possible, may I ask what is the application that you are developing? Thanks.P@T wrote: ↑Fri May 10, 2019 7:37 am
Yes
I have already programmed modbus servers to control the slave (with minimalmodbus) but never in slave mode (I haven't found library).
Today I will be able to decode all the frames and then send the answers in the right format and with the CRC (manualy) but a library help me a lot
thanks,
Re: I'm searching a modbus library
Hi!
Not sure if this help but a few years ago I used pymodbus on Raspberry pi it was not very difficult and worked well, it's Python not microPython but may help
Also there is this micropython-modbus for ESP32 (never tested) https://github.com/techbase123/micropython-modbus
Not sure if this help but a few years ago I used pymodbus on Raspberry pi it was not very difficult and worked well, it's Python not microPython but may help
Also there is this micropython-modbus for ESP32 (never tested) https://github.com/techbase123/micropython-modbus
Re: I'm searching a modbus library
I have already programmed modbus servers to control the slave (with minimalmodbus) on a PC with python not micropython and with VB6 without libraryrpr wrote:That is fantastic. I'd be interested in seeing the resulting code. If possible, may I ask what is the application that you are developing? Thanks.
Sorry, i have not clarify