From 303d6f3eb274296b156857263ff9dc8dcc84ccfb Mon Sep 17 00:00:00 2001 From: Eric FELIXINE Date: Wed, 6 May 2026 15:47:07 -0400 Subject: [PATCH] docs: Update data-flow-diagram with IoT-Agent, QuantumLeap, CrateDB architecture (2026-05-06) --- data-flow-diagram.html | 739 +++++++++++++++++++---------------------- data-flow-diagram.md | 241 +++++++------- 2 files changed, 468 insertions(+), 512 deletions(-) diff --git a/data-flow-diagram.html b/data-flow-diagram.html index c5bc1345..3f6c7cd1 100644 --- a/data-flow-diagram.html +++ b/data-flow-diagram.html @@ -1,380 +1,270 @@ - - - - - - - data-flow-diagram - - - - -

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.

+

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


-

Diagramme Mermaid

+

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

graph TB
-    SIM[Smart City Simulator]
-    SENS[Capteurs IoT Reels]
-    EMQ[EMQX]
-    MOS[Mosquitto]
-    BUN[BunkerM]
-    FRO[FROST-Server]
-    ORI[Orion-LD]
-    STE[Stellio]
-    UI[OpenRemote UI]
-    ORM[OpenRemote Manager]
-    KC[Keycloak]
-    INF[InfluxDB]
-    PRO[Prometheus]
-    GEO[GeoServer]
-    GRA[Grafana]
-    MAP[MapStore]
+    subgraph Simulateur["🖥️  Simulateur (Host Python)"]
+        SIM[Smart City Simulator<br/>10 capteurs<br/>Intervalle: configurable]
+    end
 
-    SIM --> EMQ
-    SIM --> MOS
-    SIM --> BUN
-    SENS --> EMQ
-    SENS --> MOS
-    SENS --> BUN
-    SENS -.-> ORM
-    EMQ -->|via EMQX| ORI
-    EMQ -->|via EMQX| STE
-    EMQ -->|via EMQX| FRO
-    EMQ --> ORM
-    MOS -->|via Mosquitto| ORI
-    MOS -->|via Mosquitto| STE
-    MOS -->|via Mosquitto| FRO
-    MOS --> ORM
-    BUN -->|via BunkerM| ORI
-    BUN -->|via BunkerM| STE
-    BUN -->|via BunkerM| FRO
-    BUN --> ORM
-    UI --> ORM
-    ORM -.-> KC
-    SIM --> INF
-    ORI --> GRA
-    STE --> GRA
-    FRO --> GRA
-    ORI -.-> GEO
-    STE -.-> GEO
-    FRO -.-> GEO
-    GEO --> MAP
-    ORM --> GRA
-    EMQ -.-> PRO
-    ORI -.-> PRO
-    STE -.-> PRO
-    ORM -.-> PRO
+ subgraph MQTT_Brokers["📡 MQTT Brokers"] + EMQ[EMQX<br/>port 11883] + MOS[Mosquitto<br/>port 1883] + BUN[BunkerM<br/>port 1900<br/>MQTTS/TLS] + end + + subgraph IoT_Agent["🤖 IoT Agent (NGSI-LD)"] + IOTA[IoT Agent JSON<br/>port 4041<br/>Transforme MQTT → NGSI-LD] + 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] + end + + subgraph Analytics["📈 Analytics & Time-Series"] + QL[QuantumLeap<br/>NGSI-LD → CrateDB<br/>port 8668] + CRATEDB[CrateDB<br/>PostgreSQL-compatible<br/>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] + end + + subgraph IoT_Platform["🏢 Plateforme IoT"] + ORM[OpenRemote Manager<br/>MQTT Agent<br/>port 8080] + KC[Keycloak<br/>port 8080] + end + + subgraph VIZ["📊 Visualisation"] + GRA[Grafana<br/>Dashboards<br/>port 3001] + MAP[MapStore<br/>WMS/WFS<br/>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 + + %% ── Flux MQTT → IoT Agent ────────────────────────────────── + EMQ -->|"MQTT subscribe<br/>city/sensors/#"| IOTA + MOS -->|"MQTT subscribe"| IOTA + BUN -->|"MQTT subscribe"| IOTA + + %% ── Flux IoT Agent → Context Brokers ─────────────────────── + IOTA -->|"2️⃣ NGSI-LD POST<br/>/ngsi-ld/v1/entities"| ORI + IOTA -->|"2️⃣ NGSI-LD POST"| STE + + %% ── Flux Context Brokers → QuantumLeap ─────────────────── + ORI -->|"NGSI-LD Subscription<br/>→ QuantumLeap"| QL + STE -->|"NGSI-LD Subscription<br/>→ QuantumLeap"| QL + + %% ── Flux QuantumLeap → CrateDB ──────────────────────────── + QL -->|"Insert<br/>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 + + %% ── OpenRemote MQTT Agent ─────────────────────────────────── + EMQ -->|"6️⃣ Subscribe<br/>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
-

Description des flux

-

1. Génération des -données (Simulator)

- -

2. Ingestion MQTT -(Brokers)

- -

3. Context Brokers -(NGSI-LD & SensorThings)

- -

4. Plateforme IoT -(OpenRemote)

- -

5. Stockage & -Métriques

- -

6. Visualisation & -Analyse

- -
-

Technologies clés

+

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)

+ ++++++ + + @@ -385,7 +275,7 @@ Analyse - + @@ -395,6 +285,24 @@ Analyse + + + + + + + + + + + + + + + + + + @@ -404,7 +312,7 @@ Analyse - + @@ -413,6 +321,18 @@ Analyse + + + + + + + + + + + + @@ -422,44 +342,67 @@ Analyse - + - + - + - + - + - - - - + + + +
Composant Technologie Port
Simulator Python + paho-mqttInterneHost:8001 (metrics) ✅ Actif
✅ Connecté
MosquittoMQTT Broker1883✅ Connecté
BunkerMMQTTS Broker1900✅ Connecté
IoT AgentNGSI-LD Bridge4041❌ Erreur MongoDB
Orion-LD NGSI-LD Broker 1026 Stellio NGSI-LD Broker 8080⚠️ À vérifier⚠️ Ports occupés par OpenRemote
FROST-Server ⚠️ À vérifier
QuantumLeapNGSI-LD → CrateDB8668✅ Interne
CrateDBPostgreSQL Time-Series4200/5432✅ Opérationnel
OpenRemote IoT Platform 8080 InfluxDB Time Series DB 8086✅ Configuré✅ Bucket iot_data
GrafanaVisualizationVisualisation 3001✅ Dashboard créé✅ Dashboards + CrateDB
GeoServerGeoServerGeo Data 8080⚠️ À intégrer✅ REST OK
PrometheusMetrics9090✅ En coursMapStoreCartographie8080✅ WMS/WMTS

-

Fichiers associés

- +

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. +

-

Dernière mise à jour : 04 Mai 2026
-Projet : Smart City Digital Twin Martinique
-URL Grafana : -http://localhost:3001/d/smartcity-martinique-2026

- - +

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

diff --git a/data-flow-diagram.md b/data-flow-diagram.md index 64e0e6c8..aa772b09 100644 --- a/data-flow-diagram.md +++ b/data-flow-diagram.md @@ -1,11 +1,12 @@ # Smart City Digital Twin Martinique — Diagramme des Flux de Données -**Dernière mise à jour :** 05 Mai 2026 -**Projet :** Smart City Digital Twin Martinique +**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 +## Architecture Globale (Mise à jour 06/05/2026) ```mermaid graph TB @@ -19,17 +20,21 @@ graph TB BUN[BunkerM
port 1900
MQTTS/TLS] end - subgraph Stream["⚡ Event Streaming"] - PUL[Pulsar
port 6650
Topics: smartcity-*] - RED[Redpanda
port 8082 REST
Topics: traffic, air-quality, ...] + subgraph IoT_Agent["🤖 IoT Agent (NGSI-LD)"] + IOTA[IoT Agent JSON
port 4041
Transforme MQTT → NGSI-LD] end - subgraph CB["🔗 Context Brokers"] + subgraph CB["🔗 Context Brokers (NGSI-LD)"] ORI[Orion-LD
NGSI-LD
port 1026] STE[Stellio
NGSI-LD
port 8080] FRO[FROST-Server
SensorThings
port 8080] end + 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
Bucket: iot_data
port 8086] PRO[Prometheus
Scrape: /metrics
port 9090] @@ -42,139 +47,135 @@ graph TB end subgraph VIZ["📊 Visualisation"] - GRA[Grafana
Dashboards
port 3000] + GRA[Grafana
Dashboards
port 3001] MAP[MapStore
WMS/WFS
port 8080] end - subgraph Distribution["🔄 Distribution Service"] - DIST[Pulsar Distribution
Pulsar → Brokers] - end - - subgraph Consumer["📥 Redpanda Consumer"] - RCONS[Redpanda → InfluxDB
REST → InfluxDB] - end - - %% ── Flux Simulateur ────────────────────────────────────────────────── + %% ── Flux Simulateur ────────────────────────────────────────── SIM -->|"1️⃣ MQTT publish
city/sensors/{type}/{id}"| EMQ SIM -->|"1️⃣ MQTT publish"| MOS SIM -->|"1️⃣ MQTT publish"| BUN - SIM -->|"2️⃣ HTTP POST
NGSI-LD"| ORI - SIM -->|"2️⃣ HTTP POST
NGSI-LD"| STE - SIM -->|"2️⃣ HTTP POST
SensorThings"| FRO - SIM -->|"3️⃣ Pulsar client
pulsar://localhost:6650"| PUL - SIM -->|"4️⃣ HTTP REST Proxy
localhost:8082/topics/"| RED SIM -->|"5️⃣ InfluxDB v2 API
async non-bloquant"| INF - %% ── Flux Distribution (Pulsar → Brokers) ────────────────────────────── - PUL -->|"Consomme
smartcity-*"| DIST - DIST -->|"Republish
MQTT"| EMQ - DIST -->|"Republish
MQTT"| MOS - DIST -->|"Republish
NGSI-LD"| ORI - DIST -->|"Republish
NGSI-LD"| STE - DIST -->|"Republish
SensorThings"| FRO + %% ── Flux MQTT → IoT Agent ────────────────────────────────── + EMQ -->|"MQTT subscribe
city/sensors/#"| IOTA + MOS -->|"MQTT subscribe"| IOTA + BUN -->|"MQTT subscribe"| IOTA - %% ── Flux Redpanda → InfluxDB ────────────────────────────────────────── - RED -->|"REST poll
topics/{name}/offsets"| RCONS - RCONS -->|"Line Protocol
Write API"| INF + %% ── Flux IoT Agent → Context Brokers ─────────────────────── + IOTA -->|"2️⃣ NGSI-LD POST
/ngsi-ld/v1/entities"| ORI + IOTA -->|"2️⃣ NGSI-LD POST"| STE - %% ── OpenRemote MQTT Agent ────────────────────────────────────────────── + %% ── Flux Context Brokers → QuantumLeap ─────────────────── + ORI -->|"NGSI-LD Subscription
→ QuantumLeap"| QL + STE -->|"NGSI-LD Subscription
→ QuantumLeap"| QL + + %% ── Flux QuantumLeap → 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
Martinique| MAP + ORM -->|"Live assets
REST"| GRA + + %% ── OpenRemote MQTT Agent ─────────────────────────────────── EMQ -->|"6️⃣ Subscribe
city/sensors/#"| ORM MOS -->|"6️⃣ Subscribe"| ORM BUN -->|"6️⃣ Subscribe"| ORM - %% ── Métriques Prometheus ──────────────────────────────────────────────── + %% ── Métriques Prometheus ──────────────────────────────────── SIM -->|"7️⃣ /metrics
port 8001"| PRO EMQ -->|"/api/v5/metrics"| PRO STE -->|"/actuator/prometheus"| PRO - FRO -->|"/metrics"| PRO INF -->|"/metrics"| PRO - RED -->|"/public_metrics"| PRO ORM -->|"/actuator/prometheus"| PRO GRA -->|"/metrics"| PRO - - %% ── Visualisation ───────────────────────────────────────────────────── - INF -->|"Datasources
Flux IoT"| GRA - ORI -->|"NGSI-LD
Datasource"| GRA - STE -->|"NGSI-LD
Datasource"| GRA - FRO -->|"SensorThings
Datasource"| GRA - GEO -->|"WMS/WMTS"| MAP - ORM -->|MapSettings
Martinique| MAP - ORM -->|"Live assets
REST"| GRA + IOTA -->|"/metrics"| PRO + QL -->|"/metrics"| PRO ``` --- -## Flux Détaillés +## Flux Détaillés (Mise à jour 06/05/2026) ### 1️⃣ Flux MQTT — Brokers - | Broker | Port | Protocol | Topics | |--------|------|----------|--------| | EMQX | 11883 | MQTT | `city/sensors/{type}/{id}` | | Mosquitto | 1883 | MQTT | `city/sensors/{type}/{id}` | | BunkerM | 1900 | MQTTS (TLS) | `city/sensors/{type}/{id}` | -Le simulateur publie simultanément sur les 3 brokers. +Le simulateur publie simultanément sur les 3 brokers vers **IoT Agent**. -### 2️⃣ Flux HTTP REST — Context Brokers +### 2️⃣ Flux IoT Agent — NGSI-LD +- **IoT Agent JSON** : Réception MQTT → Transformation en entités NGSI-LD +- **Port** : `4041` +- **Configuration** : + ```bash + # Enregistrement service + curl -X POST http://localhost:4041/iot/services \ + -H 'Content-Type: application/json' \ + -H 'fiware-service: smartcity' \ + -d '{"services": [{"apikey": "smartcity-api-key", "cbroker": "http://orion-ld:1026", "entity_type": "Device", "ngsi_version": "ld"}]}' + ``` +- **Entités créées dans** : Orion-LD (port 1026) et Stellio (port 8080) -| Broker | Format | Port | Topics | -|--------|--------|------|--------| -| Orion-LD | NGSI-LD | 1026 | Entités par type | -| Stellio | NGSI-LD | 8080 | Entités par type | -| FROST-Server | SensorThings | 8080 | Things → Datastreams → Observations | - -### 3️⃣ Flux Pulsar — Event Streaming - -- **Topics** : `persistent://public/default/smartcity-traffic`, `smartcity-airquality`, `smartcity-parking`, `smartcity-noise`, `smartcity-weather`, `smartcity-light` -- **Port binaire** : `6650` (connectable depuis le host) -- **Distribution** : Le service `pulsar-distribution` consomme ces topics et republie vers les brokers MQTT et context brokers - -### 4️⃣ Flux Redpanda — Kafka-compatible REST - -- **REST Proxy** : `http://localhost:8082` -- **Topics** : `traffic`, `air-quality`, `parking`, `noise`, `weather`, `air-quality` -- **Payload** : Base64(JSON) dans `{"records": [{"value": ""}]}` -- **Consumer** : `redpanda/consumer.py` — poll toutes les 10s et écrit dans InfluxDB - -### 5️⃣ Flux InfluxDB — Temps Réel +### 3️⃣ Flux Context Brokers → QuantumLeap → CrateDB +1. **Orion-LD** / **Stellio** : Reçoivent les entités NGSI-LD de IoT Agent +2. **QuantumLeap** (port 8668) : Souscrit aux mises à jour NGSI-LD via Subscription +3. **CrateDB** (port 5432/4200) : Stockage temporel PostgreSQL-compatible +4. **Grafana** : Dashboards connectés à CrateDB (PostgreSQL datasource) +### 4️⃣ Flux InfluxDB — Temps Réel - **API** : `http://localhost:8086/api/v2/write` - **Bucket** : `iot_data` - **Org** : `digitribe` - **Mode** : Asynchrone (thread daemon) pour ne pas bloquer le publish MQTT -### 6️⃣ OpenRemote — MQTT Agent +### 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. -L'agent MQTT d'OpenRemote souscrit aux topics `city/sensors/#` sur les brokers MQTT (EMQX, Mosquitto, BunkerM). Les payloads sont automatiquement parsés et les attributs des assets sont mis à jour. - -**Configuration via Manager UI** (`https://openremote.digitribe.fr/manager/`) : -1. Se connecter avec `admin/Digitribe972` -2. Choisir le realm `smartcity` -3. **Assets → Agents → + Add Agent** -4. Type : **MQTT Agent** -5. Configurer : - - **MQTT Broker URI** : `tcp://emqx_emqx_1:1883` (réseau smartcity-shared) - - **Topic Filter** : `city/sensors/#` - - **QoS** : 1 - - **Enabled** : ✅ - -### 7️⃣ Flux Prometheus — Métriques - -| Service | Endpoint `/metrics` | Scrape | +### 6️⃣ Flux Prometheus — Métriques +| Service | Endpoint `/metrics` | Statut | |---------|---------------------|--------| | Simulator | `localhost:8001` | ✅ | | EMQX | `emqx_emqx_1:8081/api/v5/metrics` | ✅ | | Stellio | `stellio-api-gateway:8080/actuator/prometheus` | ✅ | -| FROST | `frost_http-web-1:8080/metrics` | ✅ | | InfluxDB | `smart-city-influxdb:8086/metrics` | ✅ | -| Redpanda | `smart-city-redpanda-console:8080/public_metrics` | ✅ | | OpenRemote | `openremote-manager-1:8080/actuator/prometheus` | ✅ | | Grafana | `smart-city-grafana:3000/metrics` | ✅ | +| IoT Agent | `iot-agent:4041/metrics` | ⚠️ À vérifier | +| QuantumLeap | `quantum-leap:8668/metrics` | ⚠️ À vérifier | --- -## Tableau Récapitulatif +## Nouveaux Composants (06/05/2026) + +### 🤖 IoT Agent JSON +- **Rôle** : Pont entre MQTT et NGSI-LD (Orion-LD / Stellio) +- **Port** : 4041 +- **Statut** : ❌ En cours de réparation (erreur MongoDB) +- **Correction** : Fournir `IOTA_MONGO_URL=mongodb://mongodb:27017/iotagent` + +### 📈 QuantumLeap +- **Rôle** : Analytics NGSI-LD → CrateDB +- **Port** : 8668 +- **Statut** : ✅ Fonctionnel (interne), port non exposé sur l'hôte +- **Action** : Exposer le port dans docker-compose + +### 🗄️ CrateDB +- **Rôle** : Base de données temporelle PostgreSQL-compatible +- **Port** : 4200 (UI), 5432 (PostgreSQL) +- **Statut** : ✅ Opérationnel +- **Usage** : Stockage des séries temporelles depuis QuantumLeap + +--- + +## Tableau Récapitulatif (Mise à jour) | Composant | Technologie | Port | Statut | |-----------|-------------|------|--------| @@ -182,42 +183,54 @@ L'agent MQTT d'OpenRemote souscrit aux topics `city/sensors/#` sur les brokers M | EMQX | MQTT Broker | 11883 | ✅ Connecté | | Mosquitto | MQTT Broker | 1883 | ✅ Connecté | | BunkerM | MQTTS Broker | 1900 | ✅ Connecté | -| Orion-LD | NGSI-LD Broker | 1026 | ✅ Données | -| Stellio | NGSI-LD Broker | 8080 | ✅ Données | -| FROST-Server | SensorThings API | 8080 | ✅ Données | -| OpenRemote | IoT Platform | 8080 | ✅ UI OK | +| **IoT Agent** | **NGSI-LD Bridge** | **4041** | **❌ Erreur MongoDB** | +| Orion-LD | NGSI-LD Broker | 1026 | ⚠️ À vérifier | +| Stellio | NGSI-LD Broker | 8080 | ⚠️ Ports occupés par OpenRemote | +| FROST-Server | SensorThings API | 8080 | ⚠️ À vérifier | +| **QuantumLeap** | **NGSI-LD → CrateDB** | **8668** | **✅ Interne** | +| **CrateDB** | **PostgreSQL Time-Series** | **4200/5432** | **✅ Opérationnel** | +| OpenRemote | IoT Platform | 8080 | ⚠️ 403 (Service Account) | | InfluxDB | Time Series DB | 8086 | ✅ Bucket iot_data | -| Redpanda | Kafka-compatible | 8082 REST | ✅ Topics actifs | -| Pulsar | Event Streaming | 6650 | ✅ Connecté | -| Prometheus | Metrics | 9090 (conf) | ⏳ Container arrêté | -| Grafana | Visualisation | 3000 | ✅ Dashboards | +| Grafana | Visualisation | 3001 | ✅ Dashboards + CrateDB | | GeoServer | Geo Data | 8080 | ✅ REST OK | | MapStore | Cartographie | 8080 | ✅ WMS/WMTS | --- +## Actions Prioritaires + +1. **Corriger IoT Agent** : Ajouter MongoDB et configurer `IOTA_MONGO_URL` +2. **Exposer QuantumLeap** : Mapper le port 8668 dans docker-compose +3. **Déployer Orion-LD** : Créer le service s'il n'existe pas +4. **Libérer les ports** : Résoudre le conflit Stellio/OpenRemote sur le port 8080 +5. **Configurer CrateDB** : Créer les tables pour QuantumLeap +6. **Mettre à jour le simulateur** : `ENABLE_PULSAR=false` (recommandé) + +--- + ## Commandes Utiles ```bash -# Redémarrer le service de distribution Pulsar -cd ~/smart-city-digital-twin-martinique -docker build -t smart-city-pulsar-distribution:latest -f pulsar/Dockerfile pulsar/ -docker compose -f docker-compose.yml -f docker-compose.distribution.yml up -d pulsar-distribution +# Vérifier IoT Agent +curl -s http://localhost:4041/iot/services -H 'fiware-service: smartcity' -# Redémarrer Prometheus (prometheus-brokers) -cd ~/smart-city-digital-twin-martinique -docker compose up -d prometheus-brokers +# Vérifier QuantumLeap +curl -s http://localhost:8668/version -# Lancer le consumer Redpanda (host) -cd ~/smart-city-digital-twin-martinique -python3 redpanda/consumer.py +# Vérifier CrateDB +psql -h localhost -p 5432 -U crate -c "SELECT * FROM ql_entities LIMIT 5;" -# Vérifier les topics Redpanda -curl -s http://localhost:8082/topics +# Vérifier Orion-LD +curl -s http://localhost:1026/version -# Vérifier les métriques simulator -curl -s http://localhost:8001/metrics | grep "^simulator_" - -# Logs distribution service -docker logs -f smart-city-pulsar-distribution +# 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`