Back to work

Atech

Firmware & backend · electronics kits

Describe what an ESP32-S3 board should do in plain English and get working firmware over Wi-Fi: generated, compiled, signed, rolled back if it fails.

Role
Firmware & backend
Timeline
Oct 2026 – present
Stack
C++ on ESP32-S3, PlatformIO, Node.js, Web Bluetooth, mbedTLS, Docker, Vercel
An Atech starter kit laid out on white: the 14-port motherboard surrounded by screen, knob, speaker, sensor and camera modules
  • 3ways an image reaches a board
  • P-256signature on every image
  • 7firmware libraries, 9.1K lines of C++
  • 50test files, firmware to dashboard
On this page
  1. Overview
  2. What I built
  3. By the numbers
  4. From prompt to board
  5. Architecture
  6. Decisions
  7. Edge cases

Overview

Atech sells modular electronics kits built around ESP32-S3 boards, and its pitch is that you describe what you want and the firmware gets written for you. I built that side of the product: a builder where you type what a board should do in plain English, Claude writes the C++, PlatformIO compiles and validates it, and the board receives it over Wi-Fi with no cable after the first setup.

The hard part is not generating a blinking LED. It is letting generated code onto a device safely. Generated code runs in its own FreeRTOS task behind a small application API, every image is signed with the backend's ECDSA P-256 key and verified on the board, a failed update rolls back on its own, and a board that loses the cloud opens its own hotspot for a signed local update.

As of the last commit it compiles for every environment, passes the automated suites and works end to end against simulated boards. Validation on physical hardware is the next step, and the repo carries the benchmark protocol for it. Every number on this page is counted from the repo.

What I built

  • The builder: the prompt plus the application API header go to Claude, the returned file passes a static source policy, PlatformIO compiles it in an isolated workspace, compiler errors and policy violations are fed back for up to three repair rounds, and the image is checked (chip id, flash header, app descriptor, slot size, identity markers) before a build is marked ready.
  • One-time Wi-Fi setup over an encrypted Bluetooth session from desktop Chrome, including WPA2-Enterprise networks with the authentication server's certificate validated; a network with a sign-in page is reported as captive instead of as a TLS failure.
  • Three ways an image reaches a board through one install engine: a cloud pull over HTTPS with ranged downloads, an HMAC-authenticated push from the backend on the LAN, and a signed package uploaded on the board's own hotspot page.
  • Firmware signing: an ECDSA P-256 signature over a manifest (build id, demo, size, SHA-256, app version, downgrade flag, target device), verified with mbedTLS on the board, with the public key compiled into every image and pinned in NVS. Downgrades need the owner's confirmation.
  • Recovery: the bootloader rollback is cancelled only after the board reports the expected build, the app loop counter advances and an authenticated echo is answered; repeated crashes drop the board into safe mode, and USB stays the recovery path.
  • Board-to-board sync over ESP-NOW: two boards keep a small key-value state and events in agreement with no router or backend in the path, with acknowledged delivery, a deterministic conflict rule and AES-128-GCM frames.
  • Docker packaging for the backend on a DigitalOcean server, the dashboards on Vercel, and simulated boards so the whole flow runs in the test suites without hardware.

By the numbers, counted from the repo

  • 258backend tests passing, 3 skipped
  • 253host-compiled checks of the sync engine
  • 27backend modules in builder/lib
  • 10design docs, from OTA to benchmarking

From prompt to board

Promptplain English in the dashboard
Claudewrites user_app.cpp against a small app API
Compile, check, signsource policy, PlatformIO, ≤3 repair rounds, P-256 manifest
Cloud pullHTTPS, ranged download
LAN pushHMAC-authenticated
Hotspot uploadsigned package on the board's page
Board verifies, flashes, rebootssignature, target, downgrade rule
Health checkbuild id, loop counter, echo → confirm or rollback
Bluetooth carries only the one-time Wi-Fi setup and recovery controls; USB stays the recovery path.

Architecture

Firmware
C++ on ESP32-S3 with PlatformIO; seven shared libraries for the core, Bluetooth provisioning, cloud, LAN and hotspot OTA, firmware signing (mbedTLS) and ESP-NOW sync
Builder
Node backend: Anthropic SDK or the claude CLI, source policy, PlatformIO workspaces, image checks, P-256 signing, job progress over SSE with a polling fallback
Dashboards
Static HTML dashboards with Web Bluetooth and a shared builder card, jsdom tests, hosted on Vercel
Transport
Cloud poll over HTTPS, LAN push with HMAC, the board's hotspot page at 192.168.4.1, mDNS discovery
Deploy
Docker on a DigitalOcean droplet with HTTPS for the hosted dashboards

Decisions

  1. Code owns the sandbox, the model only fills it

    Generated files may include one header, must define appSetup and appLoop, and run on their own task on core 1. Every GPIO call goes through runtime guards that refuse reserved pins, so a hallucinated pin or a blocking delay cannot take down Bluetooth, OTA or the hotspot page.

  2. Bluetooth never carries firmware

    Bluetooth does the one-time Wi-Fi setup and the recovery controls; images travel over Wi-Fi. The demos' original Bluetooth OTA writers compile only in a lab build. Wi-Fi is faster, and Safari has no Web Bluetooth, so the hosted dashboard works everywhere.

  3. Sign every image, verify on the board

    The board refuses unsigned images, images for another board and images with a lower app version than it has run. A board with no key refuses signed and unsigned images alike with a clear message instead of falling back to unsigned.

Edge cases the code handles

  • A key carried by a LAN or hotspot upload is used to verify that upload first and pinned only once the image was accepted, so a refused package never locks the board to a foreign key.
  • The hotspot starts by itself when the board has no Wi-Fi or has lost the cloud for 90 seconds, and closes 60 seconds after the cloud is back.
  • A failed Wi-Fi transfer is reported with the next available method offered; nothing switches transports by itself.
  • Builds generated before firmware signing landed are refused at deploy time and must be generated again.