diff --git a/data-flow-diagram.html b/data-flow-diagram.html new file mode 100644 index 00000000..2c16f4f4 --- /dev/null +++ b/data-flow-diagram.html @@ -0,0 +1,464 @@ + + + + + + Smart City Digital Twin - Flux de Données + + + + +
+ +
+
+
+

Smart City Digital Twin — Flux de Données

+
+

Martinique • Simulator → Brokers → Context Brokers → Visualization

+
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + 📡 COUCHE 1 : SOURCES DE DONNÉES + + + + + Smart City Simulator + Python • 10 capteurs + MQTT + REST API + + + 📡 COUCHE 2 : MQTT BROKERS + + + + + EMQX + Port 11883 (MQTT) + + + + + Mosquitto + Port 1883 (MQTT) + + + + + BunkerM + Port 1900 (MQTTS) + + + 🔄 COUCHE 3 : CONTEXT BROKERS (NGSI-LD) + + + + + Orion-LD + NGSI-LD + Port 1026 + Entities: Traffic, Air + + + + + Stellio + NGSI-LD + Port 8080 + 14 payloads entities + + + + + FROST-Server + SensorThings API + 21k+ observations + PostgreSQL+Timescale + + + 🏠 COUCHE 4 : PLATEFORME IOT (OpenRemote) + + + + + OpenRemote Manager + Realm: Smart City + 33 assets IoT + Port 8080 + Keycloak + + + + + Keycloak + Auth OpenID + + + 💾 COUCHE 5 : STOCKAGE & MÉTRIQUES + + + + + InfluxDB + IoT Data Bucket + + + + + Prometheus + Metrics + Alerting + + + + + GeoServer + WMS/WFS + PostGIS + + + 📊 COUCHE 6 : VISUALISATION & ANALYSE + + + + + Grafana + Dashboards + Datasources: + InfluxDB, FROST, Orion + + + + + MapStore + Cartographie + Sources: + GeoServer WMS + + + + + OpenRemote UI + Manager Interface + Realm: Smart City + + + + + + MQTT + + + + + + + + NGSI-LD + + + + + + + + REST API + + + + HTTP + + + + Query + + + + + + + + WMS/WFS + + + + DB Sync + + + + API Query + + + + Metrics + + + Légende + + + Source de données + + + MQTT Broker + + + Context Broker + + + IoT Platform + + + Stockage / Métriques + + + Visualisation + + + Flux de données + + + MQTT + + + REST API + + +
+ + +
+
+
+
+

Sources & Simulator

+
+
    +
  • • Smart City Simulator (Python)
  • +
  • • 10 capteurs : Traffic, Air, Parking, Noise, Weather, Light
  • +
  • • Intervalle : 10 secondes
  • +
  • • Protocoles : MQTT + REST API
  • +
+
+ +
+
+
+

MQTT Brokers

+
+
    +
  • • EMQX : Port 11883 (public)
  • +
  • • Mosquitto : Port 1883 (Traefik)
  • +
  • • BunkerM : Port 1900 (TLS)
  • +
  • • OpenRemote : Port 1883 (interne)
  • +
+
+ +
+
+
+

Context Brokers (NGSI-LD)

+
+
    +
  • • Orion-LD : 10 entités NGSI-LD
  • +
  • • Stellio : 14 payloads entités
  • +
  • • FROST-Server : 21k+ observations
  • +
  • • Smart Data Models utilisés
  • +
+
+ +
+
+
+

OpenRemote Platform

+
+
    +
  • • Realm : Smart City Martinique
  • +
  • • 33 assets IoT configurés
  • +
  • • Keycloak pour l'authentification
  • +
  • • REST API pour les capteurs
  • +
+
+ +
+
+
+

Stockage & Métriques

+
+
    +
  • • InfluxDB : Bucket iot_data
  • +
  • • Prometheus : Metrics brokers
  • +
  • • GeoServer : PostGIS + WMS
  • +
  • • PostgreSQL : OpenRemote + FROST
  • +
+
+ +
+
+
+

Visualisation & Analyse

+
+
    +
  • • Grafana : Dashboards (port 3001)
  • +
  • • MapStore : Cartographie WMS
  • +
  • • OpenRemote UI : Manager Smart City
  • +
  • • Datasources : InfluxDB, FROST, Orion
  • +
+
+
+ + + +
+ + diff --git a/data-flow-diagram.md b/data-flow-diagram.md new file mode 100644 index 00000000..80bcd910 --- /dev/null +++ b/data-flow-diagram.md @@ -0,0 +1,191 @@ +# Smart City Digital Twin — Diagramme des Flux de Données + +## Vue d'ensemble + +Ce diagramme illustre le flux complet des données IoT du simulateur vers les différentes couches de traitement, de stockage et de visualisation. + +--- + +## Diagramme Mermaid + +```mermaid +graph TB + %% ===== COUCHE 1 : SOURCES DE DONNÉES ===== + subgraph Sources["📡 COUCHE 1 : SOURCES DE DONNÉES"] + SIM[Smart City Simulator
Python • 10 capteurs
MQTT + REST API] + end + + %% ===== COUCHE 2 : MQTT BROKERS ===== + subgraph Brokers["📡 COUCHE 2 : MQTT BROKERS"] + EMQX[EMQX
Port 11883
MQTT] + MOSQ[Mosquitto
Port 1883
MQTT] + BUNKER[BunkerM
Port 1900
MQTTS] + end + + %% ===== COUCHE 3 : CONTEXT BROKERS (NGSI-LD) ===== + subgraph Context["🔄 COUCHE 3 : CONTEXT BROKERS (NGSI-LD)"] + ORION[Orion-LD
NGSI-LD
Port 1026
10 entités] + STELLIO[Stellio
NGSI-LD
Port 8080
14 payloads] + FROST[FROST-Server
SensorThings API
Port 8080
21k+ observations] + end + + %% ===== COUCHE 4 : PLATEFORME IoT ===== + subgraph IoT["🏠 COUCHE 4 : PLATEFORME IoT (OpenRemote)"] + OR[OpenRemote Manager
Realm: Smart City
33 assets IoT
Port 8080] + KC[Keycloak
Auth OpenID
Token endpoint] + end + + %% ===== COUCHE 5 : STOCKAGE & MÉTRIQUES ===== + subgraph Storage["💾 COUCHE 5 : STOCKAGE & MÉTRIQUES"] + INFLUX[InfluxDB
IoT Data Bucket
Port 8086] + PROM[Prometheus
Metrics + Alerting
Port 9090] + GEO[GeoServer
WMS/WFS + PostGIS
Port 8080] + end + + %% ===== COUCHE 6 : VISUALISATION & ANALYSE ===== + subgraph Viz["📊 COUCHE 6 : VISUALISATION & ANALYSE"] + GRAF[Grafana
Dashboards
Port 3001
Datasources: InfluxDB, FROST, Orion] + MAP[MapStore
Cartographie
WMS/WFS
GeoServer] + ORUI[OpenRemote UI
Manager Interface
Realm: Smart City] + end + + %% ===== FLUX DE DONNÉES ===== + + %% Simulator → MQTT Brokers + SIM -->|MQTT| EMQX + SIM -->|MQTT| MOSQ + SIM -->|MQTTS| BUNKER + + %% MQTT Brokers → Context Brokers + EMQX -->|NGSI-LD| ORION + EMQX -->|NGSI-LD| STELLIO + EMQX -->|SensorThings| FROST + + %% Simulator → OpenRemote (REST) + SIM -.->|REST API| OR + OR -.-> KC + + %% Simulator → InfluxDB + SIM -->|HTTP| INFLUX + + %% Context Brokers → Visualization + ORION -->|Query| GRAF + STELLIO -->|Query| GRAF + FROST -->|Query| GRAF + + %% Context Brokers → GeoServer (DB Sync) + ORION -.->|PostGIS| GEO + STELLIO -.->|PostGIS| GEO + FROST -.->|PostGIS| GEO + + %% GeoServer → MapStore + GEO -->|WMS/WFS| MAP + + %% OpenRemote → Grafana + OR -->|API Query| GRAF + + %% All → Prometheus (Metrics) + EMQX -.->|Metrics| PROM + ORION -.->|Metrics| PROM + STELLIO -.->|Metrics| PROM + OR -.->|Metrics| PROM + + %% Style + classDef simulator fill:#1e293b,stroke:#fb923c,stroke-width:2px,color:#fff + classDef broker fill:#0f172a,stroke:#22d3ee,stroke-width:2px,color:#fff + classDef context fill:#0f172a,stroke:#34d399,stroke-width:2px,color:#fff + classDef iot fill:#0f172a,stroke:#a78bfa,stroke-width:2px,color:#fff + classDef storage fill:#0f172a,stroke:#fbbf24,stroke-width:2px,color:#fff + classDef viz fill:#0f172a,stroke:#22d3ee,stroke-width:2px,color:#fff + + class SIM simulator + class EMQX,MOSQ,BUNKER broker + class ORION,STELLIO,FROST context + class OR,KC iot + class INFLUX,PROM,GEO storage + class GRAF,MAP,ORUI viz +``` + +--- + +## Description des flux + +### 1. **Génération des données (Simulator)** +- **Smart City Simulator** (Python) génère des données pour 10 capteurs (Traffic, Air Quality, Parking, Noise, Weather, Light) +- Intervalle de publication : 10 secondes +- Protocoles : MQTT + REST API + +### 2. **Ingestion MQTT (Brokers)** +- **EMQX** (port 11883) : Broker public, reçoit tous les capteurs +- **Mosquitto** (port 1883) : Via Traefik, accès externe +- **BunkerM** (port 1900) : MQTTS (TLS), accès sécurisé + +### 3. **Context Brokers (NGSI-LD & SensorThings)** +- **Orion-LD** : Reçoit les données au format NGSI-LD + - 10 entités (TrafficFlowObserved, AirQualityObserved, etc.) + - Smart Data Models utilisés +- **Stellio** : Alternative NGSI-LD + - 14 payloads entités + - Contexte : `https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-context.jsonld` +- **FROST-Server** : SensorThings API + - 21 256+ observations + - PostgreSQL + TimescaleDB + +### 4. **Plateforme IoT (OpenRemote)** +- **OpenRemote Manager** (realm `smartcity`) + - 33 assets IoT configurés + - Carte Martinique (mapsettings.json) +- **Keycloak** : Authentification OpenID Connect + - Client `openremote` avec Service Account + - Token endpoint : `/auth/realms/smartcity/protocol/openid-connect/token` + +### 5. **Stockage & Métriques** +- **InfluxDB** : Stockage temporel pour Grafana + - Bucket : `iot_data` + - Datasource dans Grafana +- **Prometheus** : Collecte des métriques + - MQTT brokers, Context brokers, OpenRemote +- **GeoServer** : Données géospatiales + - PostGIS pour centralisation + - WMS/WFS pour MapStore + +### 6. **Visualisation & Analyse** +- **Grafana** (port 3001) + - Dashboard : `smartcity-martinique-2026` + - Datasources : InfluxDB, FROST, Orion-LD +- **MapStore** : Cartographie + - Sources WMS/WFS depuis GeoServer +- **OpenRemote UI** : Manager Interface + - Visualisation des assets realm Smart City + +--- + +## Technologies clés + +| Composant | Technologie | Port | Statut | +|-----------|-------------|------|--------| +| Simulator | Python + paho-mqtt | Interne | ✅ Actif | +| EMQX | MQTT Broker | 11883 | ✅ Connecté | +| Orion-LD | NGSI-LD Broker | 1026 | ⚠️ À vérifier | +| Stellio | NGSI-LD Broker | 8080 | ⚠️ À vérifier | +| FROST-Server | SensorThings API | 8080 | ⚠️ À vérifier | +| OpenRemote | IoT Platform | 8080 | ⚠️ 403 (Service Account) | +| InfluxDB | Time Series DB | 8086 | ✅ Configuré | +| Grafana | Visualization | 3001 | ✅ Dashboard créé | +| GeoServer | GeoServer | 8080 | ⚠️ À intégrer | +| Prometheus | Metrics | 9090 | ✅ En cours | + +--- + +## Fichiers associés + +- **Simulator** : `~/smart-city-digital-twin-martinique/simulator.py` +- **Dashboard Grafana** : `~/smart-city-digital-twin-martinique/grafana_dashboard_smartcity.json` +- **Ce diagramme** : `~/smart-city-digital-twin-martinique/data-flow-diagram.md` +- **Session Resume** : `~/smart-city-digital-twin-martinique/session_resume_2026-05-04.md` + +--- + +**Dernière mise à jour :** 04 Mai 2026 +**Projet :** Smart City Digital Twin Martinique +**URL Grafana :** http://localhost:3001/d/smartcity-martinique-2026 diff --git a/data-flow-diagram.pdf b/data-flow-diagram.pdf new file mode 100644 index 00000000..85d350cc Binary files /dev/null and b/data-flow-diagram.pdf differ