Skip to content

Firmware setup

The firmware lives in open-aiq/device: Rust on ESP-IDF for the ESP32-S3.

Each firmware release has two images per OLED controller:

File Use
airmonitor-<version>-<oled>-full.bin First USB flash, written at 0x0:
Bootloader
Partition table
App
airmonitor-<version>-<oled>-ota.bin App image only, used for over-the-air updates
Terminal window
espflash write-bin 0x0 airmonitor-v0.4.2-sh1106-full.bin

Check it against SHA256SUMS first. You only flash over USB once; after that, updates arrive over the air.

You need the Xtensa Rust toolchain from espup and espflash. rust-toolchain.toml selects the esp toolchain.

Terminal window
make help # every command
make build # release build for the default SH1106 OLED
make build OLED_CONTROLLER=ssd1306
make verify # format, host tests, Clippy, both OLED builds
make flash # build, flash with partitions + rollback bootloader, monitor
make monitor # serial monitor only

Always flash with make flash. Plain espflash flash replaces the A/B partition table and rollback bootloader, so updates can’t roll back safely.

The backend URL defaults to https://api.air-iq.net/api/v1. To use your own, set BACKEND_BASE_URL at build time. HTTPS uses ESP-IDF’s built-in certificate bundle.

With make monitor open, type a line and press Enter instead of pressing buttons:

Line Same as
BTN:PAIR Holding the pair button for 3 s
BTN:LEFT / BTN:RIGHT Left / right button
BTN:HELP Lists these commands

A development build can seed empty storage, skipping the app:

Terminal window
MOCK_WIFI_SSID=... MOCK_WIFI_PASSWORD=... \
MOCK_DEVICE_ID=dev_... MOCK_DEVICE_KEY=sk_... \
MOCK_LAT=24.8607 MOCK_LON=67.0011 make build

These values are compiled into the binary, so never share or release it. WIPE_CONFIG_ON_BOOT=1 erases storage on every boot; use it only when you mean to reset.

Maintainers run make release on a clean main. It checks the version registry, runs make verify, builds both images for both OLED controllers, tags the version, and publishes a GitHub release.

Stuck on a build or flash? Open an issue in open-aiq/device and we’ll help.