nanoMODBUS icon indicating copy to clipboard operation
nanoMODBUS copied to clipboard

Modbus TCP client over Wifi for Raspberry Pi Pico W (RP2040)

Open francdoc opened this issue 1 year ago • 3 comments

Scope

The aim of this project is to implement the missing functionality needed to interact with a Modbus TCP Linux server using a Modbus TCP client via Wifi on the Raspberry Pi Pico W's on board CYW43439 wifi/bluetooth chip.

The way this is to be done is by implementing (as explained in the README.md of the original repository) a port of read_fd_pico, write_fd_pico and connect_tcp for this specific microcontroller.

Background

The development target is the RP2040 microcontroller using the C programming language that comes in the Pico W board package.

The work done so far in this branch has been achieved by implementing some lwIP functions using pico-examples as reference: lwIP WIFI source exaples.

Any help for getting a successful connection would be greatly appreciated.

francdoc avatar Jul 16 '24 23:07 francdoc

Since you are on linux a good start would be checking out the linux code in the examples folder. Is there something in particular you'd like to know?

debevv avatar Jul 24 '24 13:07 debevv

Hi @debevv, thank you for your answer. Yes, I checked them and I'm in the process of making a port of this file and this file for rp2040. I was wondering if you could help me.

As explained above, the idea is to have a modbus linux server running this program and to have the rp2040 writing modbus tcp registers as a client so the server can read them.

I would appreciate any help you can give me making this port, I started the work here.

In particular, the port is being done here. I am following the structure you detailed in the README. Where this file consumes the low level port of the specific microcontroller architecture being used.

francdoc avatar Jul 25 '24 21:07 francdoc

Hi, I've just pushed a Modbus RTU port for the RP2040 (Pico). Check it out if you are interested.

francdoc avatar Jul 27 '24 05:07 francdoc

Merged in 7e4ef3e97e39664759e14bf993ff60d51dc8d850. Thank you

debevv avatar Sep 20 '24 13:09 debevv

Great, thank you

francdoc avatar Aug 31 '25 22:08 francdoc