Skip to content

mapfumo/wk11-unified-monitoring

Repository files navigation

Unified IIoT Monitoring Platform

A unified industrial IoT monitoring system combining LoRaWAN and Modbus TCP sensor data into a single Grafana dashboard.

📺 Watch the demo video →

Unified IIoT Monitoring Platform

Overview

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

Architecture

┌─────────────────┐     ┌─────────────────┐
│   LoRa-1/2      │     │  Modbus-1/2     │
│  (STM32WL55)    │     │   (STM32F4)     │
└────────┬────────┘     └────────┬────────┘
         │ LoRaWAN               │ Modbus TCP
         ▼                       │
┌─────────────────┐              │
│  RAK7268V2 GW   │──MQTT──┐     │
└─────────────────┘        │     │
                           ▼     ▼
                    ┌──────────────────┐
                    │   Docker Host    │
                    │  ┌────────────┐  │
                    │  │ InfluxDB   │  │
                    │  └─────┬──────┘  │
                    │        │         │
                    │  ┌─────▼──────┐  │
                    │  │  Grafana   │  │
                    │  └────────────┘  │
                    └──────────────────┘

Quick Start

Prerequisites

  • 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

./start_services.sh

Access Dashboards

Stop Services

./stop_services.sh

Services

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

Data Model

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

Configuration

Network Settings

Edit the Python bridge scripts to match your network:

mqtt_to_influx.py:

GATEWAY_MQTT_HOST = "10.10.10.254"  # RAK7268V2 gateway

modbus_to_influx.py:

MODBUS_DEVICES = [
    {"name": "modbus1", "host": "10.10.10.100", "port": 502},
    {"name": "modbus2", "host": "10.10.10.200", "port": 502},
]

InfluxDB

INFLUXDB_TOKEN = "my-super-secret-auth-token"
INFLUXDB_ORG = "my-org"
INFLUXDB_BUCKET = "sensors"

Project Structure

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

Security

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

Related Projects

  • wk9-opcua-modbus: Original Modbus TCP implementation
  • wk10-lorawan: Original LoRaWAN implementation

License

Educational project - Part of a 4-month embedded systems learning journey.

About

Unified IIoT monitoring platform aggregating LoRaWAN and Modbus TCP sensor data into a single Grafana dashboard. Uses Docker, MQTT, InfluxDB, and Python bridges to collect, store, and visualize industrial sensor telemetry.

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages