Pico MicroPython with networking over USB
Pico MicroPython with networking over USB
Code currently is too bad for commit+push to my fork.
But running Pico Micropython on core0 and lwip networking plus webserver on core1 just works for the first time. You can download firmware.uf2 and try out yourself, see this posting for details:
https://www.raspberrypi.org/forums/view ... 1#p1854481
Webpage hosted on Pico 192.168.7.1 (left) in Pi4B (192.168.178.2) browser.
UART minicom session turning on Pico led (right).
16MP smartphone photo: https://stamm-wilbrandt.de/en/forum/mp/ ... 220347.jpg
Scaled to 15%:
But running Pico Micropython on core0 and lwip networking plus webserver on core1 just works for the first time. You can download firmware.uf2 and try out yourself, see this posting for details:
https://www.raspberrypi.org/forums/view ... 1#p1854481
Webpage hosted on Pico 192.168.7.1 (left) in Pi4B (192.168.178.2) browser.
UART minicom session turning on Pico led (right).
16MP smartphone photo: https://stamm-wilbrandt.de/en/forum/mp/ ... 220347.jpg
Scaled to 15%:
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
Re: Pico MicroPython with networking over USB
I am done with cleanup and commited+pushed the changes to my micropython fork with this commit (it shows nicely what all needed to be changed and where):
https://github.com/Hermann-SW/micropyth ... 192ab2a123
In case you just want to try without building MicroPython yourself, here is prebuilt firmware.uf2:
https://github.com/Hermann-SW/micropyth ... rmware.uf2
For building MicroPython for the Pico with USB networking from source
https://datasheets.raspberrypi.org/pico ... pdf#page=5
lwip submodule needs to be inited as well:
I added fork mission statement as well:
https://github.com/Hermann-SW/micropyth ... -statement
Pi4B with official display Screenshot:
https://github.com/Hermann-SW/micropyth ... 192ab2a123
In case you just want to try without building MicroPython yourself, here is prebuilt firmware.uf2:
https://github.com/Hermann-SW/micropyth ... rmware.uf2
For building MicroPython for the Pico with USB networking from source
https://datasheets.raspberrypi.org/pico ... pdf#page=5
lwip submodule needs to be inited as well:
git submodule update --init -- lib/pico-sdk lib/tinyusb lib/lwip
I added fork mission statement as well:
https://github.com/Hermann-SW/micropyth ... -statement
Pi4B with official display Screenshot:
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: Pico MicroPython with networking over USB
This looks like a lot of development effort and it's great that it works, but I can't find a reason for this? Maybe you can explain it to me. What's the point of forwarding the network of a PC to the Pico? I could just do anything on the PC directly and any PC would be an expensive network adapter.
Why not use an Esp32 for the network?
Why not use an Esp32 for the network?
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Pico MicroPython with networking over USB
I may be wrong but my understanding of this project is that the Pico/ESP8266-01 combination hosts an HTTPS website on one core while running arbitrary Python code on the other. The Python side supports a REPL over UART for debugging. This could have plenty of applications.
As you say, I imagine you could do similar on an ESP32 using threading. The Pico solution may offer higher performance with processing shared between two cores and the ESP8266. The MicroPython architecture on ESP32 means that much of the work would be done on one core.
As you say, I imagine you could do similar on an ESP32 using threading. The Pico solution may offer higher performance with processing shared between two cores and the ESP8266. The MicroPython architecture on ESP32 means that much of the work would be done on one core.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Pico MicroPython with networking over USB
I connected ESP01 to Pico for enabling Pico to do HTTPS GET requests over ESP01's Wifi -- but that was not real networking between Pico and ESP01. See thread pointed to in my signature.
The point is to give Pico MicroPython networking, so that any usocket code will work on it as is.kevinkk525 wrote: ↑Wed Apr 21, 2021 8:49 pmThis looks like a lot of development effort and it's great that it works, but I can't find a reason for this? Maybe you can explain it to me. What's the point of forwarding the network of a PC to the Pico?
The webserver is only there (as of now) as 3rd layer of testing [ ifconfig usb / ping 192.168.7.1 / curl http://192.168.7.1 ] .
When I will have usocket running with lwIP over USB, I will revisit the connected ESP01 and get hopefully "real" Wifi networking for the Pico.
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Pico MicroPython with networking over USB
Light dawns
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Pico MicroPython with networking over USB
I hope so
Can you help on MicroPython networking client examples (with and without ssl) only working with google. com?
viewtopic.php?f=15&t=10318
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
-
- Posts: 969
- Joined: Sat Feb 03, 2018 7:02 pm
Re: Pico MicroPython with networking over USB
Awesome, that was the long term goal I was hoping for!HermannSW wrote:
When I will have usocket running with lwIP over USB, I will revisit the connected ESP01 and get hopefully "real" Wifi networking for the Pico.
Would be great if you get lwip over uart using an esp01/esp8266/Esp32 working.
Kevin Köck
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Micropython Smarthome Firmware (with Home-Assistant integration): https://github.com/kevinkk525/pysmartnode
Re: Pico MicroPython with networking over USB
I identified root cause -- Micropython network http[s] examples are too sloppy, most webservers need "Host" header presented.HermannSW wrote: ↑Thu Apr 22, 2021 7:48 amCan you help on MicroPython networking client examples (with and without ssl) only working with google. com?
viewtopic.php?f=15&t=10318
I committed and pushed fix for both examples on my fork, for details see commit:
https://github.com/Hermann-SW/micropyth ... cf85fbb86d
Both examples now work with MicroPython Unix port as well as python3:
Pico-W Access Point static file webserver:
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
https://github.com/Hermann-SW/pico-w
Tiny MicroPython robots (the PCB IS the robot platform)
viewtopic.php?f=5&t=11454
webrepl_client.py
https://github.com/Hermann-SW/webrepl#webrepl-shell
Re: Pico MicroPython with networking over USB
Ultimately it will be great when 'lwip' is running on a Pico alongside MicroPython with the REPL available via USB Virtual Serial Port, supporting network interfacing via USB, ENC28J60 NIC, LAN8720 RMII PHY, UART+ESP and UART+SLIP - Ideally all, configurable at build time.kevinkk525 wrote: ↑Thu Apr 22, 2021 10:39 amWould be great if you get lwip over uart using an esp01/esp8266/Esp32 working.
Currently there is proof of concept for all of that, nothing perfectly integrated with MicroPython so far, but I am sure it will come.