Introduction: High availability in resource-constrained Internet of Things (IoT) deployments is often achieved through centralized message brokers or distributed consensus services. Although effective, these approaches increase architectural complexity, infrastructure requirements, and dependence on external components. This study presents a lightweight brokerless clustering library for ESP8266-based edge IoT systems, designed to support autonomous coordination and local recovery.
Methods: The library was implemented in C++ for PlatformIO and the Arduino development environment. ESP-NOW broadcast frames were used for peer discovery and periodic heartbeat exchange. Each node maintained a bounded peer table and independently elected the node with the lowest MAC address as cluster master. A boot identifier differentiated restarted nodes from records associated with their previous execution sessions. Functional evaluation covered initial cluster formation, master-node failure, node restart, dynamic node addition, and node rejoining. Firmware build statistics and main-loop timing measurements were used to estimate memory and computational overhead.
Results: Under stable communication conditions, all participating nodes converged to the same master and elected a replacement automatically after master loss. Restarted and newly introduced nodes rejoined the cluster without manual reconfiguration. The complete evaluated firmware used 34.9% of the available RAM and 26.3% of the program flash memory. Cluster-maintenance operations accounted for approximately 31% of the measured main-loop execution time. The system operated without an MQTT broker, centralized coordinator, or persistent backend infrastructure.
Conclusions: The proposed library provides a practical coordination layer for small ESP8266-based sensing and control clusters that require autonomous local recovery with limited memory, processing capacity, and supporting infrastructure. The results demonstrate the feasibility of lightweight brokerless coordination on constrained edge devices, while further evaluation under packet loss, interference, larger cluster sizes, and prolonged operation remains necessary.