How zedattran/smart_irrigation works
This is ESP32/Arduino IoT device firmware, not the PlatformIO platform described by the README. The visible runtime starts FreeRTOS tasks for status LEDs, temperature/humidity monitoring, and CoreIOT; its main loop checks network status and reconnects Wi-Fi and the web server. The tree also shows web-server, RS485, boot-toggle, and anomaly-model subsystems, but their implementation and wiring were not sampled. Dashed, uncited links mark those uncertain connections; the README does not document this product’s capabilities.
Main entry points: main.cpp Firmware entry · temp_humi_monitor.cpp Climate monitor · mainserver.cpp Web server · coreiot.cpp CoreIOT client
Components 21
Runtime and control
- Firmware entry
src/main.cpp - Shared state
src/global.cpp - Status check
src/task_check_info.cpp - Boot toggle
src/task_toogle_boot.cpp
Device features
- Status LED
src/led_blinky.cpp - NeoPixel LED
src/neo_blinky.cpp - Climate monitor
src/temp_humi_monitor.cpp - Anomaly model
src/dht_anomaly_model.h - TinyML runtime
src/tinyml.cpp - RS485 task
src/task_rs485.cpp
Connectivity and services
- Wi-Fi management
src/task_wifi.cpp - Web server
src/mainserver.cpp - Web-server task
src/task_webserver.cpp - Web interface script
data/script.js - CoreIOT task
src/task_core_iot.cpp - CoreIOT client
src/coreiot.cpp
Supporting libraries
- DHT20 sensor
lib/DHT20/DHT20.cpp - LCD display
lib/LCD/LiquidCrystal_I2C.cpp - ThingsBoard MQTT
lib/ThingsBoard/Espressif_MQTT_Client.cpp - MQTT client
lib/PubSubClient/PubSubClient.cpp
Other components
- Device operator
Connections 21
- Device operator → Firmware entry: starts device
- Firmware entry → Status check: checks status
src/main.cpp - Firmware entry → Status LED: starts task
src/main.cpp - Firmware entry → NeoPixel LED: starts task
src/main.cpp - Firmware entry → Climate monitor: starts task
src/main.cpp - Firmware entry → CoreIOT task: starts task
src/main.cpp - Firmware entry → Wi-Fi management: reconnects Wi-Fi
src/main.cpp - Firmware entry → Web server: reconnects server
src/main.cpp - Firmware entry → Web server: stops server
src/main.cpp - Shared state → Climate monitor: shares measurements
- Climate monitor → DHT20 sensor: reads sensor
- Climate monitor → LCD display: updates display
- Climate monitor → Anomaly model: evaluates readings
- TinyML runtime → Anomaly model: uses model
- Web-server task → Web server: runs server
- Web server → Web interface script: serves interface
- CoreIOT task → CoreIOT client: runs client
- CoreIOT client → ThingsBoard MQTT: uses transport
- CoreIOT client → MQTT client: uses MQTT
- Firmware entry → RS485 task: may start task
- Firmware entry → Boot toggle: may start task