Architecture Overview ===================== Entry Point ----------- The application starts from :mod:`main`, which creates a :class:`Sensor.Sensor.Sensor` instance and calls ``setup()`` followed by ``loop()``. .. automodule:: main :members: Configuration ------------- Device configuration is loaded from two sources: 1. **Static config** -- ``Configuration/config.json``, loaded by :class:`Configuration.config.Config` 2. **Dynamic config** -- Fetched from the Gateway at startup via :class:`Manager.Manager.Manager` Sensing Loop ------------ The main loop in :meth:`Sensor.Sensor.Sensor.loop` performs these steps each cycle: 1. Read all enabled sensors via their wrapper's ``getSensorReading()`` 2. Average readings over the configured interval 3. Compute derived indices (WBGT, dew point, etc.) 4. Post data to Gateway via :meth:`Manager.Manager.Manager.sendData` 5. Send realtime data via :meth:`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