May 28, 2026 · 2 min read

Shared state and diagnostics for ESP32 radio firmware

A shared state model for radios, storage, an LCD, and a browser interface on a resource-constrained device.

A shared device state

An ESP32-C6 can observe BLE, parse Wi-Fi frames, drive a display, stream browser updates, and log to storage. Each interface needs a consistent view of device activity.

Detection produces a stream of domain events that update a bounded state model. The LCD and browser render this shared state without managing it independently.

C6BLE OBSWIFI OBSSTOREINTERFACE
Radio observations update a bounded state model shared by the device interfaces.

Explicit state limits

Embedded contact history needs explicit capacity, expiry, and replacement rules to stay within available memory.

ccontact_upsert(&(contact_update_t) {
  .kind = CONTACT_REMOTE_ID,
  .identity = frame->uas_id,
  .rssi = frame->rssi,
  .seen_at_ms = now_ms,
});

The reducer owns deduplication and expiry. Interfaces receive snapshots, which makes a 500 ms WebSocket push and a 30 Hz LCD refresh coexist without coupling the radio task to either one.

Report subsystem status

Boot stages, scan health, storage state, GPS permissions, and stale contacts require explicit status reporting alongside positive detections. When a subsystem is waiting, the interface should identify the dependency.

  • Use state names that operators can interpret.
  • Limit history size and display expiry information.
  • Log state transitions without excessive repeated entries.
  • Define recovery steps for each failure state.

Defining these states during development keeps diagnostic behavior consistent as the firmware expands.

Find your way

Where would you like to go?

Find engineering expertsContractor directory · specialtiesYour workspaceAccount · dashboard · sign inYour requestsProject inquiries · request trackingYour projectsProject progress · private proposalsGroups & shared projectsContractor network · community · tasks · filesProfile & portfolioPublic profile · 3D models · showcaseConnections & messagesChat · contractors · networkingNotificationsJob updates · activityServicesExplore Ferox WorksWorkExplore Ferox WorksProductsExplore Ferox WorksNotesExplore Ferox WorksModsExplore Ferox WorksContactExplore Ferox WorksAccountExplore Ferox WorksChronicle Time & Pay WorkspaceSoftware / ToolsPip-Boy 3000 Geiger/GNSS Mod BoardHardware / EmbeddedCozy Fishing Life-SimProduct / Game DesignCustom Serial CommunicatorSoftware / ToolsESP32-C6 RF IntelligenceFirmware / EmbeddedRatTunnel Field TransportFirmware / EmbeddedPirani Physics SimulatorSoftware / Tools

Press Escape to close · ⌘ / Ctrl K to search