How nikolai-kummer/remote-data-collection works
IoT Device and Embedded Firmware
• Firmware directories (e.g., firmware/CloudSketch, firmware/ConnectWithWPA, firmware/azure-iot, etc.) house the Arduino sketches and related code that run on the devices.
• The firmware components are responsible for sensor communications, local decision-making, and communication (via WiFi, MQTT, etc.) with the cloud.
• They include modules for managing specific hardware aspects like battery, GPS, IMU, and IoT communications.
Reinforcement Learning Core (Agent and Environment)
• Directories such as RL_nz and agent provide the RL logic. Inside RL_nz, you see different agent types (baseline_agent.py, tabular_agent.py) and environment definitions (in RL_nz/environment: gym_environment.py, custom_env.py, etc.), as well as training scripts.
• There is also a separate agent folder that contains variants of the RL agent and test suites demonstrating modular design and verifiability.
• The RL agent (a Q-learning agent as per README) uses simulated environments (battery drain, solar collection, etc.) to learn optimal behavior to maximize rewards (sending data to the cloud) and minimize penalties.
External Integration and Data Handling
• From the README, the cloud element is the IoT hub instance running on Azure. This is where sensor data is sent after local processing.
• Data directories (with CSV files) provide experimental or calibration data (such as estimates on solar gains and power consumption) that could be used for simulation inputs or subsequent analysis.
• The “paper” directory and simulation notebooks (in the “rl sim” directory) indicate that this project is research-focused—for reproducibility and further study—and assist in validating the performance of the RL agent in simulation.
A. Outline the Primary Components:
1. IoT Device Firmware Layer:
• A block for “IoT Device / Edge Hardware” where the firmware (CloudSketch, ConnectWithWPA, azure-iot, etc.) resides.
• Detail sub-components to show sensor interactions, power management (battery and solar), and wireless communications modules.
2. RL Agent and Environment:
• Agent Modules: Baseline, Tabular, and Q-learning agents (from RL_nz/agent and agent directories).
• Environment/Simulation: Components in RL_nz/environment representing simulation of battery drain, solar conditions, and sensor dynamics.
3. Cloud and Data Analytics:
• External “Azure IoT Hub” as the destination for data from the IoT devices.
• Optionally, include a “Data & Analytics” block where incoming sensor data is stored and possibly processed or used to update simulation models.
4. Supporting and Experimental Modules:
• Smaller blocks for “Simulations & Testing” (rl sim directory, tests directories) and “Data Inputs” (CSV files in data/).
• A “Documentation & Research” component (paper directory) that underscores the academic and reproducibility aspects of the project.
B. Describe the Interactions:
• The IoT device firmware sends data via wireless channels to the Azure IoT Hub.
• Simultaneously, the RL agent interacts with its simulated environment locally to learn optimal strategies.
• Testing frameworks and simulation notebooks feed into iterative improvements of the agent.
• Dependency relationships such as how configuration files (e.g., YAML config files in RL_nz) are used across simulation and training scripts.
C. Emphasize Architectural Patterns and Technologies:
• Clearly label separation between edge (firmware/Arduino) and cloud (Azure IoT Hub).
• That the reinforcement learning components adopt modular design—separating the agent logic from the environment simulation.
• Utilization of common patterns such as “separation of concerns” (distinct directories for firmware, RL agent, simulation, and tests) and interoperability between hardware and cloud components.
• Components should be clearly labeled (e.g., “RL Agent”, “Device Firmware”, “IoT Hub”, “Simulation Environment”, “Data Sources”).
• Maintain clarity and detail—include as many components as possible to capture every major module within your multifaceted structure.