Selected work
06 / 08Embedded systems · Resilient telemetry2026

CASE STUDY · 2026

Fault Tolerant IoT Telemetry Stack.

Keep field readings safe when the network disappears.

Offline first telemetry prototype

An ESP32 telemetry pipeline that buffers readings in SPI NOR flash during outages, then reconciles them with a concurrent Go service after reconnecting.

OVERVIEW

What it is
and who it helps.

The ESP32 firmware separates sensor polling from network work with FreeRTOS tasks. When connectivity drops, readings are queued in an external SPI NOR flash circular buffer. Once the link returns, a Go backend receives records through a strict acknowledge and advance handshake so the device can resume from the oldest unsent record.

SPI NORDurable outage buffer
1 byteExplicit record acknowledgement
ESP32 + GoDevice and gateway
THE CHALLENGE

Sensor sampling must continue through a full network outage without races, silent data loss, or a corrupt backlog. Recovery also needs to respect TCP as a byte stream: the sender cannot discard a partial record and still expect the device to advance its queue safely.

HOW I APPROACHED IT

From the first
interaction to the edge cases.

01

Separate real time sampling from networking

Used FreeRTOS task boundaries to decouple sensor polling and network work, reducing shared mutable state and avoiding races between the two paths.

02

Route outages into nonvolatile storage

Added a network finite state machine that detects link loss and appends telemetry to a circular queue in external SPI NOR flash rather than relying on volatile RAM.

03

Reconcile one record at a time

On reconnect, the ESP32 sends the oldest record and advances the flash tail only after the Go service returns a single byte acknowledgement.

04

Honor TCP record boundaries

Changed the Go receive path to wait for a complete record before validating and acknowledging it, fixing partial reads that could leave the sender waiting indefinitely.

OUTCOME

Recovery with an explicit commit point.

Each queued record stays at the head of the flash backlog until the backend confirms a complete receive. This gives reconnect logic a clear checkpoint and prevents TCP fragmentation from being mistaken for a full telemetry record.

BUILT WITH

FreeRTOSESP IDFESP32CSPI NOR FlashGoTCP/IP

UP NEXT · 07

Dual Partition OTA Bootloader.

Read case study