Distributed sensor mesh network for agricultural/industrial monitoring, built on painlessMesh.
| Role | Board |
|---|---|
| Root gateway | M5Stack Core2 |
| Sensor node | M5Stack Atom, ESP32-C3 Super Mini, XIAO ESP32-C3, XIAO ESP32-S3 |
- Self-healing mesh — nodes auto-route through each other if out of direct range
- Root display shows all nodes: location, sensor values, hop count, last-seen
- Per-node status circle: green (active), blue (idle), grey (offline)
- Offline detection — stale nodes sorted to bottom and flagged OFFLINE
- Web dashboard at root IP (
/— live table,/data— JSON) - WiFi + mesh coexist on root (painlessMesh AP+STA mode)
- Open
meshy_espcode.inoin Arduino IDE - Select the correct board under Tools → Board
- Edit
config.h(see below) then upload
Edit config.h before flashing:
IS_ROOT— uncomment for root build (M5Stack Core2); leave commented for nodesBOARD_xxx— uncomment the board being flashed (one at a time)NODE_LOCATION— unique label per device (shown on display and dashboard)MESH_SSID/MESH_PASSWORD— shared across all devicesWIFI_SSID/WIFI_PASSWORD— external WiFi for root onlySEND_INTERVAL— how often nodes broadcast sensor data (ms)
| File | Purpose |
|---|---|
config.h |
All tunable parameters |
mesh_module.h |
painlessMesh init, node registry, topology parsing |
sensors.h |
AHT10, potentiometer, button (ifdef-gated) |
display.h |
M5Core2 touch display (no-op stub for node build) |
webserver.h |
ESPAsyncWebServer dashboard (no-op stub for node build) |
mqtt_stub.h |
MQTT no-op stub (phase 2) |
Replace mqtt_stub.h body with PubSubClient. Interface (setupMQTT(), publishMQTT(topic, payload)) stays identical. Call publishMQTT() from _onReceive() in mesh_module.h.