Architecture Overview
Entry Point
The application starts from main, which creates a Sensor.Sensor.Sensor
instance and calls setup() followed by loop().
Configuration
Device configuration is loaded from two sources:
Static config –
Configuration/config.json, loaded byConfiguration.config.ConfigDynamic config – Fetched from the Gateway at startup via
Manager.Manager.Manager
Sensing Loop
The main loop in Sensor.Sensor.Sensor.loop() performs these steps each cycle:
Read all enabled sensors via their wrapper’s
getSensorReading()Average readings over the configured interval
Compute derived indices (WBGT, dew point, etc.)
Post data to Gateway via
Manager.Manager.Manager.sendData()Send realtime data via
Manager.Manager.Manager.sendRealtimeData()
Communication Threads
Several communication interfaces run in background threads:
Network – Continuous internet connectivity check
WebSocket – Realtime data push to dashboard
Modbus – Async sensor polling on the Modbus bus
LoRa – Long-range radio communication
Sigfox – LPWAN communication
HMI – 7-segment display updates