Life System Desk Device

An ESP8266 desk device that logs my task events to a FastAPI service over MQTT, and holds on to them when the network drops.

How it connects

ESP8266 + OLED + buttonsMQTTFastAPI serviceSQLite

CategoryEmbedded & On-device
Timeline2026
ContextPersonal project · Solo
StatusWorking prototype · personal use
16events queued on the device while offline
1-60 sbackend reconnect backoff

The product

A small desk device for my own day: an ESP8266 with a 0.96-inch OLED and two buttons. A press marks the current task complete, paused or resumed, and the event goes to my FastAPI service over MQTT. The display follows a retained MQTT topic, so it always shows the task the backend says is current.

The part I cared about is not losing presses. Each event is stamped with device time from NTP, and when MQTT is down it waits in a 16-slot ring queue on the device that drains after reconnect.

Under the hood

THE ENGINEERING

  • 01

    PlatformIO firmware in C++ for the ESP8266, with a serial provisioning CLI (Wi-Fi, MQTT, topic prefix) and settings saved to EEPROM

  • 02

    Events published as JSON with a recorded_at time from NTP, so a late delivery still carries the real time of the press

  • 03

    16-slot ring queue on the device; the oldest event is dropped only when the queue is full

  • 04

    FastAPI backend with async SQLAlchemy sessions, Pydantic v2 response models and SQLite

  • 05

    aiomqtt bridge that reconnects with exponential backoff from 1 s to 60 s and drains its own outbound queue

  • 06

    An insights endpoint asks Gemini to summarise my activity and validates the JSON with a Pydantic model, falling back to plain text

Next case study

Magic Widget →