Skip to content

Repository files navigation

IoT Campus Simulator

This repository contains a Dockerized campus IoT simulator for a 200-room building. It models rooms as independent asyncio tasks, publishes telemetry and heartbeat data over MQTT, and persists room state in Postgres so the simulation can recover after restart.

Where To Start

Project Structure

Top-level files

  • README.md Repository overview and file map.

  • simulator/main.py Package launcher used by python -m simulator.

  • Dockerfile Builds the simulator container image.

  • docker-compose.yaml Local stack:

    • postgres — simulator database (host port 5433)
    • postgres-tb — ThingsBoard database (internal only)
    • hivemq — HiveMQ Community Edition MQTT (1883)
    • thingsboard — ThingsBoard CE UI (9090 → container 8080)
    • simulator — campus engine (MQTT to HiveMQ; CoAP UDP 5693 → 5683)
    • gateway-floor-01gateway-floor-10 — Node-RED (host 1880–1882, 1890–1896)
  • requirements.txt Python dependencies used by the simulator.

  • .gitignore Git ignore rules.

  • LICENSE Project license file.

  • docs/docker_commands.md Copy/paste command reference for interacting with one room, one floor, or the whole fleet.

  • docs/manual_testing.md Full step-by-step manual testing guide for sections 1 and 2.

config/

  • config/config.yaml Main simulator configuration:
    • building size
    • simulation timing
    • thermal constants
    • MQTT settings
    • fault settings
    • heartbeat settings

simulator/

This folder contains the simulator application code.

simulator/domain/

simulator/engine/

simulator/persistence/

Typical Navigation

If you want to understand:

Performance Logging Script

Use scripts/performance.sh to run the stack and collect per-run logs under perf_logs/run_<RUN_ID>/.

Run it:

chmod +x scripts/performance.sh
./scripts/performance.sh

What it produces:

  • perf_logs/run_<RUN_ID>/simulator.log
  • perf_logs/run_<RUN_ID>/latency.log
  • perf_logs/run_<RUN_ID>/stats.log
  • perf_logs/run_<RUN_ID>/run.info

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages