AYUSH~KADALI
← project index

SwarmOTA

RESEARCH · IN PROGRESS

A gossip-based peer-to-peer protocol for decentralized firmware-over-the-air updates across IoT microcontrollers — BitTorrent-style rarest-first chunk selection adapted for ESP32 and Pico W. Targeting a research paper.

ESP32 · Pico W · P2P · Gossip Protocol · FOTA · WiFi Mesh · C/C++ · Python

3 topologies under test (star, linear, mesh)
the test cluster — ESP32 and Pico W nodes A through F
the test cluster — ESP32 and Pico W nodes A through FNODES

The problem

Standard over-the-air firmware updates assume every device can reach a central server. In a dense fleet of cheap WiFi microcontrollers, that assumption is both a bottleneck and a single point of failure: the server pushes the same image N times, and if it’s unreachable, nothing updates.

SwarmOTA asks: what if devices updated each other?

The protocol

SwarmOTA is a gossip-based peer-to-peer firmware propagation protocol. The firmware image is split into chunks; nodes discover peers through gossip and exchange chunks directly, with no central server in the loop after the image first enters the swarm.

The chunk-selection strategy is adapted from BitTorrent’s rarest-first algorithm — each node preferentially fetches the chunk that fewest of its neighbors hold, so the swarm’s collective copy of the firmware spreads evenly instead of every node hammering the same source. Getting that to fit on resource-constrained MCUs, with their RAM and flash budgets, is most of the engineering. Every chunk transfer is CRC-verified before it touches flash.

The experiments

I’ve implemented the protocol on ESP32 and Raspberry Pi Pico W nodes over a WiFi mesh — the cluster photo shows test nodes A through F. The experimental design compares three network topologies — star, linear, and mesh — and measures propagation time, chunk distribution uniformity, and recovery when nodes fail mid-update.

Where it stands

This is research in progress: the methodology is complete and the experiment campaign is pending. The goal is a paper comparing decentralized FOTA against the server-centric baseline for embedded networks.