Hermann Stamm-Wilbrandt Gives the Raspberry Pi Pico Web Server, Client Over USB Capabilities

Building on the TinyUSB and lwIP projects, Stamm-Wilbrandt has successfully demonstrated both client and server modes over a USB link.

Gareth Halfacree
3 years ago β€’ Internet of Things

Developer Hermann Stamm-Wilbrandt is continuing to add functionality to the Raspberry Pi Pico, and by extension other boards based around the same RP2040 microcontroller, this time releasing practical web server and web client examples.

Launched earlier this year, the Raspberry Pi Pico has proven popular - but that doesn't mean there isn't room for improvement. Stamm-Wilbrandt offered just such an improvement a fortnight again with the release of a software modification to allow "No-Button Boot" β€” the ability to switch between the board's two boot modes without physically touching the BOOTSEL button, instead simply changing the UART baud rate.

Now, Stamm-Wilbrandt is back with another useful code snippet: Functional web server and web client examples, which make up for a lack of on-board Ethernet capabilities by networking the microcontroller over its USB port.

Over the weekend, a port of the TinyUSB web server code to the Raspberry Pi Pico was released to GitHub and announced on the Raspberry Pi forum. While basic - the software simply loads a web page with a graphic of the Raspberry Pi Pico and allows the user to clock the LED to toggle its physical equivalent on and off, and to click the BOOTSEL button to reboot in flash mode β€” the tool was functional, and Stamm-Wilbrandt extended it further by having the picture of the LED represent the real LED's current status.

The project raised Stamm-Wilbrandt's curiosity, though: Would it be possible to have the Raspberry Pi Pico act as a web client, as well as a web server? "I thought if Pico can be a web server with TCP/IP over USB," he explains, "then it should be able to be a TCP client as well thanks to powerful LwIP [Lightweight IP, an open source Internet Protocol stack designed for embedded use]."

The answer, it turns out, is yes. Stamm-Wilbrandt has demonstrated the ability for the Raspberry Pi Pico to download and process web data, though with a few caveats. The first is that it can only access plain-text HTTP sites, though the use of a HTTPS-to-HTTP proxy on the host can overcome this; the second is that accessing sites external to the host machine requires a proxy or bridge to be in place.

Stamm-Wilbrandt has published his web server code to GitHub under the same MIT license as the original work; a repository had been created for the web client code but at the time of writing it had not yet been committed, with the developer promising to upload some time this evening local time.

Gareth Halfacree
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles