debevv / nanoMODBUS

A compact MODBUS RTU/TCP C library for embedded/microcontrollers
MIT License
289 stars 62 forks source link

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

Closed francdoc closed 4 weeks ago

francdoc commented 3 months ago

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.

debevv commented 2 months ago

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?

francdoc commented 2 months ago

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 commented 2 months ago

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

debevv commented 4 weeks ago

Merged in 7e4ef3e97e39664759e14bf993ff60d51dc8d850. Thank you