I am trying to make a serial to ethernet server, similar to a regular pi board and ser2net, using a pico variant. I am using a Waveshare RP2040-ETH Mini Development Board, but there is very little out there on this and the Waveshare wiki seems to be missing information or is just poorly translated. I have the network configured but getting one serial device to pass to the ethernet is what I am missing. I am primarily trying to do this in micropython.
1 Answer
You need to start by setting up the RP2040 as a TCP server, for example to echo back everything that is sent to it. You can test this using a suitable TCP client, e.g. Telnet, putty, Teraterm etc.
I can't comment on the Waveshare documentation, but setting up a TCP server is quite basic stuff, so you should be able to find a simple example somewhere.
Once that that is working, you can link the incoming & outgoing data streams to the serial port. You'll probably find that data has to be Carriage Return terminated in order to be sent; if that isn't OK you need to implement some simple Telnet negotiation to disable buffered mode, but using a fixed termination character on your strings is generally not a bad idea anyway.