How garzonsergio/iot-simulator works
Main Components
• IoT Simulator Module: Centered on the script (scripts/simulate_device.sh) that generates simulated sensor data (temperature, humidity, timestamp) and publishes JSON messages via MQTT.
• AWS IoT Core: This is the external cloud service that receives the MQTT messages.
• Deployment Environment: Since there are a Dockerfile and docker-compose.yml, the simulation can be containerized. Represent the Docker container as an execution environment for the simulator.
• Certificates & Configuration: Although not in the file tree (they’re provided externally), the simulator depends on AWS IoT certificates (device cert, private key, root CA) and environment variables (e.g., AWS_IOT_ENDPOINT) to function securely.
• Dependencies: The use of mosquitto-clients and utilities like curl are integral to the simulation process.
Relationships and Interactions
• Configuration flows by showing how environment variables and certificate files are injected into the simulator (for example, from a configuration or secrets manager node).
Architectural Patterns and Design Principles
• Separation of Concerns: The simulator script is a standalone program focusing solely on data generation and publishing, while AWS IoT Core represents the external messaging endpoint.
• Container Deployment: With Docker Compose available, the design encourages containerization for reproducible deployment.
• Security Best Practices: Highlight how certificates are managed (stored externally, permissions set appropriately) and that sensitive data is not kept in version control (note the .gitignore for certificates).
Technologies, Frameworks, and Dependencies
• MQTT communication (using mosquitto-clients).
• Docker and Docker Compose as deployment tools.
• Shell scripting (simulate_device.sh) as the logic engine.
• AWS IoT Core as the target messaging service.
Elements
• Clear labels: Name each component such as “IoT Simulator Script”, “Docker Container”, “AWS IoT Core”, and “Certificate/Configuration Manager”.
• Configuration/Data Flow: Optionally add smaller nodes to indicate configuration injection (environment variables and certificates).