A unified industrial IoT monitoring system combining LoRaWAN and Modbus TCP sensor data into a single Grafana dashboard.
This project integrates 4 sensor nodes using two different industrial protocols:
| Node | Protocol | Sensor | Data |
|---|---|---|---|
| LoRa-1 | LoRaWAN | SHT41 | Temperature, Humidity |
| LoRa-2 | LoRaWAN | BME680 | Temperature, Humidity, Pressure, Gas |
| Modbus-1 | Modbus TCP | SHT3x | Temperature, Humidity |
| Modbus-2 | Modbus TCP | SHT3x | Temperature, Humidity |
┌─────────────────┐ ┌─────────────────┐
│ LoRa-1/2 │ │ Modbus-1/2 │
│ (STM32WL55) │ │ (STM32F4) │
└────────┬────────┘ └────────┬────────┘
│ LoRaWAN │ Modbus TCP
▼ │
┌─────────────────┐ │
│ RAK7268V2 GW │──MQTT──┐ │
└─────────────────┘ │ │
▼ ▼
┌──────────────────┐
│ Docker Host │
│ ┌────────────┐ │
│ │ InfluxDB │ │
│ └─────┬──────┘ │
│ │ │
│ ┌─────▼──────┐ │
│ │ Grafana │ │
│ └────────────┘ │
└──────────────────┘
- Docker and Docker Compose
- Network access to:
- RAK7268V2 gateway (10.10.10.254:1883)
- Modbus nodes (10.10.10.100:502, 10.10.10.200:502)
./start_services.sh- Grafana: http://localhost:3000 (admin/admin)
- InfluxDB: http://localhost:8086 (admin/admin123456)
- Unified Dashboard: http://localhost:3000/d/unified-monitoring
./stop_services.sh| Service | Port | Description |
|---|---|---|
| InfluxDB | 8086 | Time-series database |
| Grafana | 3000 | Visualization dashboard |
| Mosquitto | 1884 | MQTT broker (local) |
| mqtt-bridge | - | LoRaWAN MQTT → InfluxDB |
| modbus-bridge | - | Modbus TCP → InfluxDB |
All sensor data is stored in the sensors bucket with two measurements:
lorawan_sensor
- Tags:
dev_eui,node,sensor,protocol=lorawan - Fields:
temperature,humidity,pressure,gas_resistance,rssi,snr,frame_count
modbus_sensor
- Tags:
node,sensor,protocol=modbus - Fields:
temperature,humidity
Edit the Python bridge scripts to match your network:
mqtt_to_influx.py:
GATEWAY_MQTT_HOST = "10.10.10.254" # RAK7268V2 gatewaymodbus_to_influx.py:
MODBUS_DEVICES = [
{"name": "modbus1", "host": "10.10.10.100", "port": 502},
{"name": "modbus2", "host": "10.10.10.200", "port": 502},
]INFLUXDB_TOKEN = "my-super-secret-auth-token"
INFLUXDB_ORG = "my-org"
INFLUXDB_BUCKET = "sensors"wk11-unified-monitoring/
├── docker-compose.yml # All service definitions
├── mqtt_to_influx.py # LoRaWAN MQTT bridge
├── modbus_to_influx.py # Modbus TCP bridge
├── mqtt_subscriber.py # CLI tool to view decoded LoRaWAN readings
├── start_services.sh # Start all services
├── stop_services.sh # Stop all services
├── mosquitto/
│ └── mosquitto.conf # MQTT broker config
├── grafana/
│ ├── provisioning/
│ │ ├── datasources/
│ │ │ └── influxdb.yml # Auto-provision datasource
│ │ └── dashboards/
│ │ └── dashboards.yml # Dashboard provider config
│ └── dashboards/
│ └── unified-dashboard.json
├── README.md # This file
├── USERGUIDE.md # Detailed usage guide
└── SECURITY.md # STRIDE threat analysis
See SECURITY.md for a comprehensive STRIDE threat analysis.
Key Points:
- Default credentials should be changed for production
- MQTT and Modbus are unencrypted protocols
- Consider network segmentation for OT devices
- wk9-opcua-modbus: Original Modbus TCP implementation
- wk10-lorawan: Original LoRaWAN implementation
Educational project - Part of a 4-month embedded systems learning journey.
