The webblinky demo showcases WiFi onboarding and control on the Raspberry Pi Pico 2 W (RP2350). It demonstrates how an application can expose a simple web interface to control the onboard LED, while also highlighting captive WiFi onboarding:
- On first boot (or when no WiFi credentials are configured), the Pico 2 W starts in Access Point (AP) mode.
- It creates a network with SSID:
webblinky-<MAC-ADDR>
- When a client device (phone/laptop) connects, a captive portal automatically opens.
- This portal prompts the user for their home/office WiFi SSID and PSK.
- Once provided, the Pico 2 W reconfigures itself, joins that WiFi network, and can then be controlled from the onboard web server.
This onboarding flow eliminates the need for hard-coding WiFi credentials and provides a simple, user-friendly setup path.
- Raspberry Pi Pico 2 W (RP2350)
- USB Debug Probe Kit for Raspberry Pi Pico (for flashing/debugging; available from Raspberry Pi resellers and Amazon)
- OpenOCD (portable build already included in this repository)
This project uses a west manifest to manage and resolve dependencies. Install west and Zephyr prerequisites for your platform (see Zephyr docs), then use the platform instructions below.
For more details, see the official Zephyr Getting Started Guide.
Creating a local.conf
file in the repository root is optional.
It is only needed if you want to bypass the captive WiFi onboarding flow and preconfigure the device with known WiFi credentials.
This may be useful if:
- You are deploying in an environment where the target SSID/PSK is stable and always available.
- You want to skip the captive portal step for automated testing or CI builds.
- The device will operate in a controlled lab or manufacturing setup with fixed WiFi credentials.
If the WiFi credentials are likely to change (e.g., consumer environments, field deployments), it is better to rely on the captive portal onboarding instead.
The local.conf
may contain:
CONFIG_PRECONFIG_WIFI
is a boolean. Iftrue
, sets the initial SSID and PSK to the values inCONFIG_ONBOARDING_WIFI_SSID
andCONFIG_ONBOARDING_WIFI_PSK
. Iffalse
, it will default to bringing up the WiFi as an AP for configuration.CONFIG_ONBOARDING_WIFI_SSID="<Your SSID>"
CONFIG_ONBOARDING_WIFI_PSK="<PreShared Key to Your SSID>"
local.conf
into the repository as it contains site-specific proprietary information.
On Windows, all environment setup and build/flash operations are automated through PowerShell scripts located in:
scripts/windows/
You can right-click any script → “Run with PowerShell”, or run them from a PowerShell prompt at the repo root as shown below.
⚙️ Dependencies
- These scripts use OpenOCD (included in this repository).
- The USB Debug Probe Kit for Raspberry Pi Pico is required for flashing/debugging.
.\scripts\windows\install-host-tools.ps1
.\scripts\windows\setup-env.ps1
.\scripts\windows\build.ps1
(Defaults target to rpi_pico2/rp2350a/m33/w; adjust as needed.)
.\scripts\windows\flash.ps1
Open an environment shell for ad-hoc commands:
.\scripts\windows\shell.ps1
Note: On Windows, use the scripts above for flashing/debugging. The OpenOCD paths and flags below are for Linux.
The following steps are based on the official Zephyr Getting Started Guide, tailored for Ubuntu 22.04.
sudo apt update
sudo apt install --no-install-recommends \
git cmake ninja-build gperf \
ccache dfu-util device-tree-compiler wget \
python3-dev python3-pip python3-setuptools python3-tk python3-wheel xz-utils file \
make gcc g++ pkg-config libsdl2-dev libmagic1
python3 -m venv .venv
. .venv/bin/activate
python -m pip install --upgrade pip
pip install west
# From the repository root:
west init -l manifest
west update
west zephyr-export
west blobs fetch hal_infineon --allow-regex 'img/whd/resources/firmware/COMPONENT_43439/43439a0_bin.c'
west blobs fetch hal_infineon --allow-regex 'img/whd/resources/clm/COMPONENT_43439/43439A0_clm_blob.c'
export ZEPHYR_SDK_INSTALL_DIR="$HOME/zephyr-sdk"
west sdk install -t arm-zephyr-eabi --install-dir "$ZEPHYR_SDK_INSTALL_DIR"
west build -p always -d build -b rpi_pico2/rp2350a/m33/w .
If you need to override OpenOCD paths:
west build -p always -d build -b rpi_pico2/rp2350a/m33/w . -- \
-DOPENOCD=/usr/local/bin/openocd \
-DOPENOCD_DEFAULT_PATH=/usr/local/share/openocd/scripts \
-DRPI_PICO_DEBUG_ADAPTER=cmsis-dap
west flash
deactivate
-
Connect UART to GP0 (TX) and GP1 (RX), BAUD = 115200.
-
Flash the board.
-
After boot, the device creates a WiFi AP:
webblinky-<MAC-ADDR>
-
Connect to this SSID. A captive WiFi portal will prompt for your network SSID and PSK.
-
Once connected to your network, open the UART shell and test connectivity:
uart:~$ net ping 8.8.8.8
You should see successful ping responses.
-
Windows Execution Policy If you see errors running
.ps1
files, allow script execution for the current session:Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
-
Linux USB Permissions On Ubuntu, you may need to create a udev rule for your debug probe (CMSIS-DAP/J-Link). Example rule for CMSIS-DAP:
echo 'SUBSYSTEM=="usb", ATTR{idVendor}=="2e8a", MODE="0666"' | sudo tee /etc/udev/rules.d/99-rpi-pico.rules sudo udevadm control --reload-rules sudo udevadm trigger
Then unplug and replug the probe.
-
Toolchain not found Verify
$ZEPHYR_SDK_INSTALL_DIR
is set correctly and run:west zephyr-export
-
OpenOCD not detected On Linux, install or build OpenOCD with RP2040/Pico support and ensure it’s in your
PATH
. On Windows, use the included portable build (external/openocd
).