How th-luan05/node works
This repository contains ESP32 node firmware for a sensor-and-relay device that communicates with a master over ESP-NOW and Wi-Fi, with BLE provisioning and OTA support. The main device workflow is receiving a master command, dispatching it to relay, configuration, safety, or OTA handling, then reporting status. Most runtime behavior resides in one source file; the excerpts show command dispatch, routing, and OTA event handling, but omit much of setup, telemetry, and sensor sampling, so those connections are not inferred.
Main entry points: main.cpp Node Firmware · proto.h Packet Protocol
Components 14
Device Runtime
- Node Firmware
src/main.cpp - Sensor Sampling
src/main.cpp - Relay Control
src/main.cpp - Thermal Safety
src/main.cpp - Device Configuration
src/main.cpp
Mesh Networking
- Packet Protocol
lib/proto/proto.h - Mesh Routing
src/main.cpp - Wi-Fi UDP
src/main.cpp
Provisioning And Updates
- BLE Provisioning
src/main.cpp - Persistent Settings
src/main.cpp - Firmware Updates
src/main.cpp - OTA Event Queue
src/main.cpp
Other components
- Master
- OTA Server
Connections 11
- Node Firmware → Packet Protocol: includes definitions
src/main.cpp - Master → Node Firmware: sends commands
- Node Firmware → Relay Control: dispatches relay
src/main.cpp - Node Firmware → Device Configuration: dispatches config
src/main.cpp - Node Firmware → Thermal Safety: dispatches safety
src/main.cpp - Node Firmware → Firmware Updates: dispatches update
src/main.cpp - Relay Control → Node Firmware: sends telemetry
src/main.cpp - Mesh Routing → Mesh Routing: forwards packets
src/main.cpp - Firmware Updates → OTA Event Queue: queues events
src/main.cpp - OTA Event Queue → Node Firmware: drains events
src/main.cpp - Firmware Updates → OTA Server: checks and downloads
src/main.cpp