Anvil Launches a Framework to Bring Python Web App Support to the Raspberry Pi Pico W

Designed to allow a web app to be built in Python in under five minutes, Anvil now offers support for talking to the Raspberry Pi Pico W.

Python-based web app specialist Anvil has announced the launch of a toolkit designed for the new Raspberry Pi Zero W microcontroller board — allowing for rapid development and deployment of hardware-connected web apps with integrated security.

"Today, we're launching an easy, secure way to connect the [Raspberry Pi] Pico W to apps on the Anvil platform — all in Python," explains company co-founder Meredydd Luff of Anvil's latest release. "You get a drag-and-drop web UI builder, a built-in database, user authentication, email integration, HTTP APIs, and more – and it all talks to your Pico W."

Released last week, the Raspberry Pi Pico W is a $6 successor to the immensely popular $4 Raspberry Pi Pico microcontroller development board and module. Like its predecessor, it's built around the dual-core RP2040 microcontroller with its flexible programmable input/output (PIO) blocks but now includes a radio module with Wi-Fi and Bluetooth capability — though the latter has yet to be enabled in the firmware.

"We have released a firmware image for the Pico W that connects to the Anvil Uplink, so you can call functions on your Pico from your Anvil web app, and vice versa," Luff explains. "When you install this image, your Pico will show up as an extra USB drive, with sample Python code already present. Open it up, set your Wi-Fi password and Uplink key, and reboot: your Pico will now connect to your app, and you can call functions on your Pico from a web UI!"

Like the Anvil framework itself, the firmware and libraries have been released under a permissive open source license — though Anvil is, naturally, hoping that developers will choose to use its hosted version for their projects. Web apps are developed in the same interface as existing Anvil apps, while the company has released a series of tutorials both for newcomers to Anvil and those who want to add microcontroller support to existing Anvil applications.

Those interested in trying the new framework out can find instructions on the Anvil website, though they'll need to sign up in order to use Anvil Uplink and build the web app side — with the company's free tier offering unlimited apps with cloud hosting and local deployment at no cost, though a $15-a-month "Personal" tier offering a full Python server, custom domain support, and the removal of the company's advertising banner.

Luff has also confirmed that a number of improvements made during the development of the framework — including Network Time Protocol (NTP) support, TLS certificate validation in the RP2040 port of MicroPython, and USB Mass Storage functionality to allow Python code to be edited directly on-device — have been contributed upstream. "We hope that the additional security benefits will soon show up across the fast-growing Pico W ecosystem," he writes, "even if they don’t use Anvil."

The source code for the Anvil Pico MicroPython libraries, meanwhile, have been published to GitHub under the permissive MIT license.

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