From 4667d8873c63b66b4b67b895f2ea4bba3312d697 Mon Sep 17 00:00:00 2001 From: Eric FELIXINE Date: Wed, 6 May 2026 17:22:21 -0400 Subject: [PATCH] docs: Update HTML diagram - 3 IoT Agents architecture --- data-flow-diagram.html | 471 ++++++++--------------------------------- 1 file changed, 91 insertions(+), 380 deletions(-) diff --git a/data-flow-diagram.html b/data-flow-diagram.html index 3f6c7cd1..a9fe118c 100644 --- a/data-flow-diagram.html +++ b/data-flow-diagram.html @@ -1,408 +1,119 @@ -

Smart -City Digital Twin Martinique — Diagramme des Flux de Données

-

Dernière mise à jour : 06 Mai 2026
-Projet : Smart City Digital Twin Martinique
-Architecture : IoT-Agent intégré, QuantumLeap + CrateDB -pour l’analyse avancée

-
-

Architecture Globale -(Mise à jour 06/05/2026)

-
graph TB
-    subgraph Simulateur["🖥️  Simulateur (Host Python)"]
-        SIM[Smart City Simulator<br/>10 capteurs<br/>Intervalle: configurable]
+
+
+
+    Smart City Data Flow Diagram
+    
+    
+    
+
+
+    

Smart City Digital Twin - Data Flow Diagram

+

Updated: 2026-05-06 - Architecture with 3 IoT Agents (one per MQTT broker)

+
+graph TB + subgraph Simulateur["🖥️ Simulateur (Host Python)"] + SIM[Smart City Simulator
10 capteurs
Intervalle: configurable] end - subgraph MQTT_Brokers["📡 MQTT Brokers"] - EMQ[EMQX<br/>port 11883] - MOS[Mosquitto<br/>port 1883] - BUN[BunkerM<br/>port 1900<br/>MQTTS/TLS] + subgraph MQTT_Brokers["📡 MQTT Brokers"] + EMQ[EMQX
port 11883] + MOS[Mosquitto
port 1883] + BUN[BunkerM
port 1900
MQTTS/TLS] end - subgraph IoT_Agent["🤖 IoT Agent (NGSI-LD)"] - IOTA[IoT Agent JSON<br/>port 4041<br/>Transforme MQTT → NGSI-LD] + subgraph IoT_Agent["🤖 3 IoT Agents (NGSI-LD)"] + IOTA_EMQ[IoT-Agent-EMQX
port 4041
Ecoute EMQX] + IOTA_MOS[IoT-Agent-Mosquitto
port 4042
Ecoute Mosquitto] + IOTA_BUN[IoT-Agent-BunkerM
port 4043
Ecoute BunkerM] end - subgraph CB["🔗 Context Brokers (NGSI-LD)"] - ORI[Orion-LD<br/>NGSI-LD<br/>port 1026] - STE[Stellio<br/>NGSI-LD<br/>port 8080] - FRO[FROST-Server<br/>SensorThings<br/>port 8080] + subgraph CB["🔗 Context Brokers (NGSI-LD)"] + ORI[Orion-LD
NGSI-v2
port 1026] + STE[Stellio
NGSI-LD
port 8080] + FRO[FROST-Server
SensorThings
port 8080] end - subgraph Analytics["📈 Analytics & Time-Series"] - QL[QuantumLeap<br/>NGSI-LD → CrateDB<br/>port 8668] - CRATEDB[CrateDB<br/>PostgreSQL-compatible<br/>port 4200/5432] + subgraph Analytics["📈 Analytics & Time-Series"] + QL[QuantumLeap
NGSI-LD → CrateDB
port 8668] + CRATEDB[CrateDB
PostgreSQL-compatible
port 4200/5432] end - subgraph Storage["💾 Stockage & Métriques"] - INF[InfluxDB<br/>Bucket: iot_data<br/>port 8086] - PRO[Prometheus<br/>Scrape: /metrics<br/>port 9090] - GEO[GeoServer<br/>WMS/WFS/WMTS<br/>port 8080] + subgraph Storage["💾 Stockage & Métriques"] + INF[InfluxDB
Bucket: iot_data
port 8086] + PRO[Prometheus
Scrape: /metrics
port 9090] + GEO[GeoServer
WMS/WFS/WMTS
port 8080] end - subgraph IoT_Platform["🏢 Plateforme IoT"] - ORM[OpenRemote Manager<br/>MQTT Agent<br/>port 8080] - KC[Keycloak<br/>port 8080] + subgraph IoT_Platform["🏢 Plateforme IoT"] + ORM[OpenRemote Manager
MQTT Agent
port 8080] + KC[Keycloak
port 8080] end - subgraph VIZ["📊 Visualisation"] - GRA[Grafana<br/>Dashboards<br/>port 3001] - MAP[MapStore<br/>WMS/WFS<br/>port 8080] + subgraph VIZ["📊 Visualisation"] + GRA[Grafana
Dashboards
port 3001] + MAP[MapStore
WMS/WFS
port 8080] end %% ── Flux Simulateur ────────────────────────────────────────── - SIM -->|"1️⃣ MQTT publish<br/>city/sensors/{type}/{id}"| EMQ - SIM -->|"1️⃣ MQTT publish"| MOS - SIM -->|"1️⃣ MQTT publish"| BUN - SIM -->|"5️⃣ InfluxDB v2 API<br/>async non-bloquant"| INF + SIM -->|"1️⃣ MQTT publish
smartcity-api-key/{id}/attrs"| EMQ + SIM -->|"1️⃣ MQTT publish"| MOS + SIM -->|"1️⃣ MQTT publish"| BUN + SIM -->|"5️⃣ InfluxDB v2 API
async non-bloquant"| INF - %% ── Flux MQTT → IoT Agent ────────────────────────────────── - EMQ -->|"MQTT subscribe<br/>city/sensors/#"| IOTA - MOS -->|"MQTT subscribe"| IOTA - BUN -->|"MQTT subscribe"| IOTA + %% ── Flux MQTT → IoT Agents ────────────────────────────────── + EMQ -->|"MQTT subscribe
smartcity-api-key/#"| IOTA_EMQ + MOS -->|"MQTT subscribe"| IOTA_MOS + BUN -->|"MQTT subscribe"| IOTA_BUN - %% ── Flux IoT Agent → Context Brokers ─────────────────────── - IOTA -->|"2️⃣ NGSI-LD POST<br/>/ngsi-ld/v1/entities"| ORI - IOTA -->|"2️⃣ NGSI-LD POST"| STE + %% ── Flux IoT Agents → Context Brokers ─────────────────────── + IOTA_EMQ -->|"2️⃣ NGSI-v2 POST
/v2/entities"| ORI + IOTA_MOS -->|"2️⃣ NGSI-v2 POST"| ORI + IOTA_BUN -->|"2️⃣ NGSI-v2 POST"| ORI %% ── Flux Context Brokers → QuantumLeap ─────────────────── - ORI -->|"NGSI-LD Subscription<br/>→ QuantumLeap"| QL - STE -->|"NGSI-LD Subscription<br/>→ QuantumLeap"| QL + ORI -->|"NGSI-v2 Subscription
→ QuantumLeap"| QL %% ── Flux QuantumLeap → CrateDB ──────────────────────────── - QL -->|"Insert<br/>PostgreSQL wire"| CRATEDB + QL -->|"Insert
PostgreSQL wire"| CRATEDB %% ── Visualisation ─────────────────────────────────────────── - CRATEDB -->|"PostgreSQL Datasource"| GRA - INF -->|"Datasource Flux IoT"| GRA - ORI -->|"NGSI-LD Datasource"| GRA - STE -->|"NGSI-LD Datasource"| GRA - GEO -->|"WMS/WMTS"| MAP - ORM -->|MapSettings<br/>Martinique| MAP - ORM -->|"Live assets<br/>REST"| GRA + CRATEDB -->|"PostgreSQL Datasource"| GRA + INF -->|"Datasource Flux IoT"| GRA + ORI -->|"NGSI-v2 Datasource"| GRA + GEO -->|"WMS/WMTS"| MAP + ORM -->|MapSettings
Martinique| MAP + ORM -->|"Live assets
REST"| GRA %% ── OpenRemote MQTT Agent ─────────────────────────────────── - EMQ -->|"6️⃣ Subscribe<br/>city/sensors/#"| ORM - MOS -->|"6️⃣ Subscribe"| ORM - BUN -->|"6️⃣ Subscribe"| ORM + EMQ -->|"6️⃣ Subscribe
city/sensors/#"| ORM + MOS -->|"6️⃣ Subscribe"| ORM + BUN -->|"6️⃣ Subscribe"| ORM - %% ── Métriques Prometheus ──────────────────────────────────── - SIM -->|"7️⃣ /metrics<br/>port 8001"| PRO - EMQ -->|"/api/v5/metrics"| PRO - STE -->|"/actuator/prometheus"| PRO - INF -->|"/metrics"| PRO - ORM -->|"/actuator/prometheus"| PRO - GRA -->|"/metrics"| PRO - IOTA -->|"/metrics"| PRO - QL -->|"/metrics"| PRO
-
-

Flux Détaillés (Mise à jour -06/05/2026)

-

1️⃣ Flux MQTT — Brokers

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BrokerPortProtocolTopics
EMQX11883MQTTcity/sensors/{type}/{id}
Mosquitto1883MQTTcity/sensors/{type}/{id}
BunkerM1900MQTTS (TLS)city/sensors/{type}/{id}
-

Le simulateur publie simultanément sur les 3 brokers vers IoT -Agent.

-

2️⃣ Flux IoT Agent — NGSI-LD

- -

3️⃣ Flux Context -Brokers → QuantumLeap → CrateDB

-
    -
  1. Orion-LD / Stellio : Reçoivent les -entités NGSI-LD de IoT Agent
  2. -
  3. QuantumLeap (port 8668) : Souscrit aux mises à jour -NGSI-LD via Subscription
  4. -
  5. CrateDB (port 5432/4200) : Stockage temporel -PostgreSQL-compatible
  6. -
  7. Grafana : Dashboards connectés à CrateDB -(PostgreSQL datasource)
  8. -
-

4️⃣ Flux InfluxDB — Temps Réel

- -

5️⃣ OpenRemote — MQTT Agent

-

L’agent MQTT d’OpenRemote souscrit aux topics -city/sensors/# sur les brokers MQTT. Les payloads sont -automatiquement parsés et les attributs des assets sont mis à jour.

-

6️⃣ Flux Prometheus — Métriques

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ServiceEndpoint /metricsStatut
Simulatorlocalhost:8001
EMQXemqx_emqx_1:8081/api/v5/metrics
Stelliostellio-api-gateway:8080/actuator/prometheus
InfluxDBsmart-city-influxdb:8086/metrics
OpenRemoteopenremote-manager-1:8080/actuator/prometheus
Grafanasmart-city-grafana:3000/metrics
IoT Agentiot-agent:4041/metrics⚠️ À vérifier
QuantumLeapquantum-leap:8668/metrics⚠️ À vérifier
-
-

Nouveaux Composants -(06/05/2026)

-

🤖 IoT Agent JSON

- -

📈 QuantumLeap

- -

🗄️ CrateDB

- -
-

Tableau Récapitulatif (Mise à -jour)

- ------ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ComposantTechnologiePortStatut
SimulatorPython + paho-mqttHost:8001 (metrics)✅ Actif
EMQXMQTT Broker11883✅ Connecté
MosquittoMQTT Broker1883✅ Connecté
BunkerMMQTTS Broker1900✅ Connecté
IoT AgentNGSI-LD Bridge4041❌ Erreur MongoDB
Orion-LDNGSI-LD Broker1026⚠️ À vérifier
StellioNGSI-LD Broker8080⚠️ Ports occupés par OpenRemote
FROST-ServerSensorThings API8080⚠️ À vérifier
QuantumLeapNGSI-LD → CrateDB8668✅ Interne
CrateDBPostgreSQL Time-Series4200/5432✅ Opérationnel
OpenRemoteIoT Platform8080⚠️ 403 (Service Account)
InfluxDBTime Series DB8086✅ Bucket iot_data
GrafanaVisualisation3001✅ Dashboards + CrateDB
GeoServerGeo Data8080✅ REST OK
MapStoreCartographie8080✅ WMS/WMTS
-
-

Actions Prioritaires

-
    -
  1. Corriger IoT Agent : Ajouter MongoDB et configurer -IOTA_MONGO_URL
  2. -
  3. Exposer QuantumLeap : Mapper le port 8668 dans -docker-compose
  4. -
  5. Déployer Orion-LD : Créer le service s’il n’existe -pas
  6. -
  7. Libérer les ports : Résoudre le conflit -Stellio/OpenRemote sur le port 8080
  8. -
  9. Configurer CrateDB : Créer les tables pour -QuantumLeap
  10. -
  11. Mettre à jour le simulateur : -ENABLE_PULSAR=false (recommandé)
  12. -
-
-

Commandes Utiles

-
# Vérifier IoT Agent
-curl -s http://localhost:4041/iot/services -H 'fiware-service: smartcity'
-
-# Vérifier QuantumLeap
-curl -s http://localhost:8668/version
-
-# Vérifier CrateDB
-psql -h localhost -p 5432 -U crate -c "SELECT * FROM ql_entities LIMIT 5;"
-
-# Vérifier Orion-LD
-curl -s http://localhost:1026/version
-
-# Voir les logs IoT Agent
-docker logs smart-city-iot-agent --tail 30
-
-

Fichiers associés : - Simulateur : -~/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-07.md

+ %% ── Métriques Prometheus ─────────────────────────────────── + SIM -->|"7️⃣ /metrics
port 8001"| PRO + EMQ -->|"/api/v5/metrics"| PRO + STE -->|"/actuator/prometheus"| PRO + INF -->|"/metrics"| PRO + ORM -->|"/actuator/prometheus"| PRO + GRA -->|"/metrics"| PRO + IOTA_EMQ -->|"/metrics"| PRO + IOTA_MOS -->|"/metrics"| PRO + IOTA_BUN -->|"/metrics"| PRO + QL -->|"/metrics"| PRO + + +