This document describes the over-the-air (OTA) update system used by the Research And Desire wireless Remote (RADR), including the update chain, state machine flow, and what components get updated.Documentation Index
Fetch the complete documentation index at: https://docs.researchanddesire.com/llms.txt
Use this file to discover all available pages before exploring further.
Overview
RADR uses a two-part OTA update system:| Component | Description | Binary |
|---|---|---|
| Firmware | ESP32 application binary | firmware.bin |
| Filesystem | LittleFS partition containing device registry and protocol specs | littlefs.bin |
Update Architecture
Update Server
Updates are served from Supabase Storage. The server URL is defined inplatformio.ini:
- Firmware:
{UPDATE_SERVER_URL}/master/firmware.bin - Filesystem:
{UPDATE_SERVER_URL}/master/littlefs.bin
State Machine Flow
Updates are managed by the RADR state machine. The update flow is triggered from the Settings menu.State Transitions
| From | To | Condition |
|---|---|---|
settings_menu | update | User selects “Update Device” + WiFi connected |
settings_menu | update.wifi | User selects “Update Device” + WiFi not connected |
update.wifi | update | WiFi connection established |
update | update.filesystem | hasFilesystemUpdate guard returns true |
update | update.software | hasSoftwareUpdate guard returns true (no filesystem update) |
update | update.done | No updates available |
update.filesystem | update.software | Filesystem update complete + software update available |
update.filesystem | restart | Filesystem update complete, no software update |
update.software | restart | Software update complete (always restarts) |
update.done | restart | User acknowledges |
What Gets Updated
Firmware Update
The firmware update replaces the ESP32 application binary. This includes:- Core application logic
- UI and display code
- Bluetooth stack and device communication
- State machine and navigation
- Input handling (encoders, buttons, bumpers)
updateSoftwareTask() in src/tasks/update.cpp
Filesystem Update
The filesystem update replaces the LittleFS partition, which contains:| File | Purpose |
|---|---|
/registry.json | Maps BLE service UUIDs to protocol spec files |
/protocols/*.json | Buttplug.io v4 device configuration files |
updateFilesystemTask() in src/tasks/update.cpp
The filesystem update does not trigger an automatic reboot. This allows both filesystem and firmware to be updated in sequence before restarting.
Registry Update Chain
When the filesystem is updated, the Buttplug.io device registry is refreshed: The registry is loaded at boot time byinitRegistry() in src/devices/registry.cpp:
- Hardcoded devices are registered first (e.g., OSSM)
/registry.jsonis read from LittleFS- Each service UUID is mapped to a
ButtplugIODeviceFactory - Protocol specs are loaded on-demand when devices are discovered
Update Availability
Update availability is determined by guard functions insrc/state/guards.hpp:
| Flag | Set When |
|---|---|
isSoftwareUpdateAvailable | FORCE_UPDATE compile flag, or server indicates update |
isFilesystemUpdateAvailable | FORCE_UPDATE compile flag, or server indicates update |
Key Source Files
| File | Purpose |
|---|---|
src/tasks/update.cpp | Update task implementations (updateSoftwareTask, updateFilesystemTask) |
src/tasks/update.h | Update task declarations and availability flags |
src/state/machine.h | State machine definition with update states |
src/state/guards.hpp | Guard functions for update availability |
src/devices/registry.cpp | Registry initialization from LittleFS |
data/registry.json | Service UUID to protocol spec mappings |
data/protocols/*.json | Buttplug.io v4 device specifications |
Development Notes
Forcing Updates
For development and testing, use theFORCE_UPDATE compile flag:
isSoftwareUpdateAvailable and isFilesystemUpdateAvailable to true.
Local Filesystem Updates
When developing locally, use PlatformIO’s “Upload Filesystem” feature:data/ directory to the LittleFS partition.
Related Documentation
Device Registry
How RADR discovers and creates device instances from BLE service UUIDs.
Web Flasher
Manual firmware flashing via browser.

