How servayejc/esp8266_espnow works
This is ESP8266 firmware for a wireless temperature-monitoring and thermostat node. At startup it restores persistent settings, initializes ESP-NOW, discovers 1-Wire sensors, and then pairs with a server; while paired, it reads temperatures, applies thermostat setpoints, controls outputs, and sends device data. Incoming setpoints are handled by the registered receive callback. The graph follows the sampled source; the README is empty, and hardware and server-side behavior are represented only where the excerpts show an interface.
Main entry points: main.cpp ESP8266 node · esp_now_pairing.cpp ESP-NOW pairing · Temperatures.cpp Sensor discovery and readings · Utils.cpp Settings persistence
Components 12
Firmware runtime
- ESP8266 node
src/main.cpp
Wireless pairing
- ESP-NOW pairing
src/esp_now_pairing.cpp
Temperature sensing
- Sensor discovery and readings
src/Temperatures.cpp
Control and state
- Device state and messages
src/global.h - Thermostat output control
src/Control.cpp - Settings persistence
src/Utils.cpp - EEPROM
Other components
- Pairing server
- ESP-NOW service
- 1-Wire sensors
- I2C output expander
- ESP8266 GPIO
Connections 19
- ESP8266 node → Settings persistence: restores settings
src/main.cpp - ESP8266 node → ESP-NOW pairing: initializes radio
src/main.cpp - ESP8266 node → Sensor discovery and readings: discovers sensors
src/main.cpp - ESP8266 node → ESP-NOW pairing: checks pairing
src/main.cpp - ESP8266 node → Sensor discovery and readings: requests readings
src/main.cpp - ESP8266 node → Device state and messages: uses message state
src/main.cpp - ESP-NOW pairing → Pairing server: requests pairing
src/esp_now_pairing.cpp - Pairing server → ESP-NOW pairing: provides pairing data
src/esp_now_pairing.cpp - ESP-NOW pairing → ESP-NOW service: registers callbacks
src/esp_now_pairing.cpp - ESP8266 node → ESP-NOW service: sends device data
src/main.cpp - ESP-NOW pairing → ESP8266 node: dispatches received data
src/esp_now_pairing.cpp - Sensor discovery and readings → 1-Wire sensors: reads sensors
src/Temperatures.cpp - Sensor discovery and readings → Thermostat output control: sets thermostat output
src/Temperatures.cpp - Thermostat output control → I2C output expander: writes output
src/Control.cpp - Thermostat output control → ESP8266 GPIO: writes GPIO
src/Control.cpp - Sensor discovery and readings → Device state and messages: uses setpoints and status
src/Temperatures.cpp - Settings persistence → EEPROM: reads and writes
src/Utils.cpp - ESP-NOW pairing → Settings persistence: saves channel
src/esp_now_pairing.cpp - ESP8266 node → Settings persistence: updates simulation
src/main.cpp