The Raspberry Pi Foundation changed single-board computing when they released the Raspberry Pi computer, now they're ready to do the same for microcontrollers with the release of the brand new Raspberry Pi Pico W. This low-cost microcontroller board features their powerful new chip, the RP2040, and all the fixin's to get started with IoT embedded electronics projects at a stress-free price.

Raspberry Pi Pico W brings WiFi to the Pico platform while retaining complete pin compatibility with its older sibling, and now as of CircuitPython 8.0.0-beta.2, there is CircuitPython WiFi support for the Pico W! This guide includes examples for testing your WiFi connection, using requests to pull JSON feeds, ping API's and log sensor data for IoT projects; all using CircuitPython!

Status Bar

As of CircuitPython 8.0.0, if you have a smart terminal program like Thonny, tio or Screen, you will see the status of your CircuitPython board in the header bar of the terminal.

If you have an error while running your code, the status bar will tell you what line of code was running when the error occurred, as well as the type of error.

Additionally, if you end the program from the shell with a KeyboardInterrupt, that information will be displayed in the status bar.

About the Code Examples

WiFi and networking are complicated and have many failure states. Rather than having extensive code to detect and recover from each specific kind of failure, the examples here use microcontroller.reset() which fully re-initialize both the microcontroller and the WiFi co-processor and start the code again with a clean slate.

The general pattern is:

try:
	your_application_here()
except Exception as e:
    print("Error:\n", str(e))
    print("Resetting microcontroller in 10 seconds")
    time.sleep(10)
    microcontroller.reset()

Parts

Angled shot of a green microcontroller with castellated pads.
The Raspberry Pi foundation changed single-board computing when they released the Raspberry Pi computer, now they're ready to...
$6.00
In Stock
Fully Reversible Pink/Purple USB A to micro B Cable
This cable is not only super-fashionable, with a woven pink and purple Blinka-like pattern, it's also fully reversible! That's right, you will save seconds a day by...
$3.95
In Stock
Adafruit AHT20 - Temperature & Humidity Sensor Breakout Board
The AHT20 is a nice but inexpensive temperature and humidity sensor from the same folks that brought us the DHT22. You can take...
$4.50
In Stock
Half-size breadboard with a soldered skinny green microcontroller.
It can be tricky to work out which pin is which when the Raspberry Pi Pico is attached to solderless...
$4.95
In Stock
Top view of JST SH 4-pin to Premium Male Headers Cable next to US quarter for scale.
This 4-wire cable is a little over 150mm / 6" long and fitted with JST-SH female 4-pin connectors on one end and premium Dupont male headers on the other. Compared with the...
Out of Stock

This guide was first published on Oct 14, 2022. It was last updated on Mar 28, 2024.

This page (Overview) was last updated on Mar 08, 2024.

Text editor powered by tinymce.