Image by Thomas Amberg, CC BY-SA 2.0, via Wikimedia Commons

The Game-Changing Pi Pico W

With an On-board 2.4GHz 802.11n Wireless LAN Adapter

Mike Riley
3 min readSep 7, 2022

--

https://pragprog.com/newsletter/

Long-time readers of my posts on Medium may recall an article I wrote over a year ago titled Frozen Pi that detailed how I used the Pi Pico to monitor the temperature of my freezer. Unfortunately, one of the major limitations at the time was the Pico’s lack of a wireless network interface. That meant that any data collected needed to be stored on the Pico’s meager 2 MB of on-board QSPI flash RAM. While that was fine for a couple days of monitoring (depending on sampling rate), it still required the stored data to be manually offloaded via a USB cable connecting the Pi to a computer.

Capture, Visualize, and Communicate Data

Now, thanks to the recent release of the Pi Pico W with its on-board 2.4GHz 802.11n wireless LAN adapter, that local storage can be used as a temporary cache. You can now access and remove the data via a simple HTTP server configuration using MicroPython.

Better yet, crafting a JSON payload allows the Pico to expose REST endpoints that can offer a slew of functions based on the Pico’s operating situations. You can couple these REST endpoints with a custom Prometheus exporter running on a Raspberry Pi 3 or above that polls these exposed endpoints on a regular basis.

Then, using the Raspberry Pi version of Grafana installed on that same Pi to visualize the collected data, you can show some remarkable trends that would have previously required a much more expensive and complex hardware configuration. Setting alert thresholds on this data collection within Grafana takes the Pico capture to a whole new level by offering a broad choice of communication pathways to convey details of data outliers.

Cost Saving and Security Benefits

A decade ago, I used an Arduino connected to a Zigbee module that wirelessly communicated with another Zigbee attached to a cheap PC decoding the inbound data. At that time, this less-than-ideal configuration cost over three-hundred dollars.

Today, thanks to the inexpensive yet remarkably powerful capabilities of the Raspberry Pi and Pi Pico W, a fully open standards-compliant information capture and processing stack costs less than forty dollars. I have already begun replacing some Pi Zero 2 Ws on my home network with functionally dedicated Pi Pico Ws. Not only has this upgrade reduced my rate of energy consumption, but it also has dramatically reduced the attack surface of my network. I no longer need to manage a full-blown Linux stack with daily patches, threat monitoring, and node exporter management.

The Pi Pico W truly is a game-changer.

Be sure to pick up a copy of Portable Python Projects by Mike Riley, available from The Pragmatic Bookshelf. You can save 35 percent with promo code python_automation_2022 now through September 30, 2022. Promo codes are not valid on prior purchases.

--

--