Source: https://mokxi.com/learn/path/micropython-iot
Updated: 2026-11-20

All paths

# Connected devices in MicroPython

Network-ready MicroPython on the Pico W: every WiFi state and failure, HTTP status codes and headers, a web server from a bare socket, JSON both ways, asyncio servers, backoff and the watchdog, ending in an ocean buoy dashboard.

Raspberry Pi Pico W Free 7 lessons 7 h 4 chapters 3,190 XP Embedded engineering · Advanced +250 XP

0 of 7 done

Start the course free The network module Lesson plan for teachers

What you will build

## 3 projects, built step by step

7 lessons in 4 chapters, about 7 hours on a simulated Raspberry Pi Pico W. Free, in your browser, every step checked by the simulator.

Chapter 1 project

### urequests in depth

Every answer has a status: 200 and 201 for success, 4xx for your mistake, 5xx for the server’s. Headers, bodies, a fetch() that always closes, failures before any answer, and a POST with your own headers.
Open it in the simulator

Chapter 2 project

### JSON both ways

The language devices and dashboards speak: parse a space weather feed into dicts and lists, survive bad JSON and missing keys, turn your own readings into JSON, and serve them at /api.
Open it in the simulator

Chapter 3 project

### Error recovery

A device that keeps working when the network does not: retries with exponential backoff for joining and for requests, running on the last good value, and a hardware watchdog that restarts a hung board.
Open it in the simulator

The map

## Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

## The board as a client

The network module and HTTP requests, failures included.

Open 303 XP

### The network module

Past "connected": every state a station passes through, a connect function with a timeout that fails fast, the address, mask, gateway and DNS server, the hostname and MAC, and names that do not resolve.

0 of 7 steps

Start What is in it

Project Locked 682 XP

### urequests in depth

Every answer has a status: 200 and 201 for success, 4xx for your mistake, 5xx for the server’s. Headers, bodies, a fetch() that always closes, failures before any answer, and a POST with your own headers.

0 of 8 steps

4 questions, graded as you go.

Chapter 2

## The board as a server

A web server from a socket, and JSON for programs.

Locked 242 XP

### A tiny web server

The board as the server, from a bare socket: bind, listen, accept, read the request line, route the path, send a status line, headers and a page, and switch the Pico W’s LED from a browser.

0 of 6 steps

Project Locked 652 XP

### JSON both ways

The language devices and dashboards speak: parse a space weather feed into dicts and lists, survive bad JSON and missing keys, turn your own readings into JSON, and serve them at /api.

0 of 7 steps

4 questions, graded as you go.

Chapter 3

## Robust devices

asyncio servers, and recovering from every failure.

Locked 265 XP

### asyncio servers

A server that does not stop the world: asyncio.start_server with one coroutine per connection, a blinker task that never pauses, and the rule that makes it all work: await, never sleep.

0 of 6 steps

Project Locked 682 XP

### Error recovery

A device that keeps working when the network does not: retries with exponential backoff for joining and for requests, running on the last good value, and a hardware watchdog that restarts a hung board.

0 of 8 steps

4 questions, graded as you go.

Chapter 4

## Boss project

An ocean buoy dashboard on a Pico W.

Locked 364 XP

### Boss: an ocean buoy dashboard

A Pico W on a buoy: a BME280 read by an asyncio task, a sea forecast fetched with backoff, an HTML dashboard and a JSON API served at once, and a storm light driven by the forecast and the pressure.

0 of 8 steps

3 questions, graded as you go.

Syllabus

## Every lesson in the course

All 7 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

### The board as a client

- The network module Past "connected": every state a station passes through, a connect function with a timeout that fails fast, the address, mask, gateway and DNS server, the hostname and MAC, and names that do not resolve.
- urequests in depth Every answer has a status: 200 and 201 for success, 4xx for your mistake, 5xx for the server’s. Headers, bodies, a fetch() that always closes, failures before any answer, and a POST with your own headers.

Chapter 2

### The board as a server

- A tiny web server The board as the server, from a bare socket: bind, listen, accept, read the request line, route the path, send a status line, headers and a page, and switch the Pico W’s LED from a browser.
- JSON both ways The language devices and dashboards speak: parse a space weather feed into dicts and lists, survive bad JSON and missing keys, turn your own readings into JSON, and serve them at /api.

Chapter 3

### Robust devices

- asyncio servers A server that does not stop the world: asyncio.start_server with one coroutine per connection, a blinker task that never pauses, and the rule that makes it all work: await, never sleep.
- Error recovery A device that keeps working when the network does not: retries with exponential backoff for joining and for requests, running on the last good value, and a hardware watchdog that restarts a hung board.

Chapter 4

### Boss project

- Boss: an ocean buoy dashboard A Pico W on a buoy: a BME280 read by an asyncio task, a sea forecast fetched with backoff, an HTML dashboard and a JSON API served at once, and a storm light driven by the forecast and the pressure.

Kits

## Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

Have a kit already?

### Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.
See every kit

Questions

## About Connected devices in MicroPython

Is Connected devices in MicroPython free?

Yes. All 7 lessons of Connected devices in MicroPython are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Raspberry Pi Pico W?

No. Every lesson runs on a simulated Raspberry Pi Pico W with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Connected devices in MicroPython take?

About 7 hours: 7 lessons in 4 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: urequests in depth, JSON both ways and Error recovery.

Where do I start?

With "The network module", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.
