Pico access via WiFi (serial bridge)

RP2040 based microcontroller boards running MicroPython.
Target audience: MicroPython users with an RP2040 boards.
This does not include conventional Linux-based Raspberry Pi boards.
Post Reply
JumpZero
Posts: 54
Joined: Mon Oct 30, 2017 5:54 am
Location: Arcachon - France

Pico access via WiFi (serial bridge)

Post by JumpZero » Sun Aug 29, 2021 4:35 pm

Hello,
I know there is a thread discussing how to do this in pure Python. It would be smart.
Meanwhile I have managed to have a decent access to my pico with esp-link with a simple solution
I did the following steps:
1 - Build MicroPython for the Pico with repl over serial enabled, as explained here (page 8) with this instruction

Code: Select all

#define MICROPY_HW_ENABLE_UART_REPL (1) 
2 - Flash ESP-Link  on a ESP-8266 (I used a 12E) and configure as per the doc
3 - Connect the Pico to the ESP
Now a full repl access is available via Telnet with this command from a Linux box on the same network:

Code: Select all

telnet <esp-link IP address> 23
It works but it's even better in char mode. Press ^] to access telnet prompt then type "mode char".
This is a very decent and usable REPL access.

However we can do more and have rshell access to the pico
On the linux box we make a virtual serial port (linked to esp-link tcp port 23) with this command

Code: Select all

sudo socat pty,link=/dev/ttyTCP0,ignoreeof,user=pi,group=dialout,mode=777,rawer tcp:192.168.xx.xx:23 &
Then

Code: Select all

rshell -p /dev/ttyTCP0 -e geany # geany or nano or your favorite editor
That's it! A full working rshell with the REPL and the ability to edit, modify scripts on the pico!
There is nothing really new with that as I found here and there on the web the different pieces to do it, but I found it nice to have rshell over wifi to a pico!
--

cnmcdee
Posts: 12
Joined: Sat Sep 11, 2021 10:41 pm

Re: Pico access via WiFi (serial bridge)

Post by cnmcdee » Tue Sep 21, 2021 11:22 pm

That is highly impressive and I went off immediately to study and learn about socat. Thanks for that post.

Post Reply