Compare commits

...

2 Commits

Author SHA1 Message Date
Eric FELIXINE
b6c627a639 Correction BunkerM domaine: mosquitto2.digitribe.fr 2026-05-06 21:27:10 -04:00
Eric FELIXINE
362a9d1f6b Architecture mise à jour (07 Mai 2026)
- Correction flux : Simulateur → MQTT Brokers → IoT Agents → Orion-LD/Stellio → QuantumLeap → CrateDB
- IoT Agents fonctionnels (EMQX:4041, Mosquitto:4042, BunkerM:4043)
- Pipeline Orion-LD validé (CrateDB: quantumleap.etairqualityobserved)
- BunkerM domaine corrigé : mosquitto2.digitribe.fr:1900
- Simulateur publie sur topics smartcity-api-key/{sid}/attrs
2026-05-06 21:26:21 -04:00
2 changed files with 147 additions and 140 deletions

View File

@@ -1,137 +1,144 @@
# Architecture Finale Smart City - 2 Pipelines Isolées (CORRIGÉ 18h05)
## Principe : Chaque Context Broker a sa propre pipeline
```
┌─────────────────────────────────────────────────────────────────────────────┐
│ Smart City Simulator (Python) │
│ Publie sur 3 brokers MQTT avec format IoT-Agent JSON
└──────────┬────────────────────┬──────────────────────┬───────────────────┘
│ │ │
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ EMQX Broker │ │ Mosquitto Broker │ │ BunkerM Broker │
└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ IoT-Agent-EMQX │ │IoT-Agent-Mosquitto│ │IoT-Agent-BunkerM
│ Port: 4041 │ │ Port: 4042 │ │ Port: 4043 │
│ Apikey: smart- │ │ Apikey: smart- │ Apikey: smart-
│ city-api-key │ city-api-key │ city-api-key
───────────────── ───────────────── ─────────────────
└───────────────────────┴──────────────────────┘
┌───────────────┴───────────────┐
┌─────────────────────┐ ┌─────────────────────┐
Orion-LD │ │ Stellio │
(port 1026) │ │ (port 8080) │
MongoDB backend (API Gateway)
└─────────┬───────────┘ └─────────┬───────────┘
┌─────────────────────┐ ┌─────────────────────┐
│ QuantumLeap-Orion │ │ QuantumLeap-Stellio │
│ (port 8668) │ │ (port 8669)
│ → CrateDB-Orion │ │ → CrateDB-Stellio
└─────────┬───────────┘ └─────────┬───────────┘
┌─────────────────────┐ ┌─────────────────────┐
│ CrateDB-Orion │ │ CrateDB-Stellio │
│ (port 5432/4200) │ │ (port 5433/4201)
│ DB: quantumleap │ │ DB: quantumleap_ │
│ │ stellio │
└─────────┬───────────┘ └─────────┬───────────┘
└───────────────────────┬─────────┘
┌─────────────────────┐
│ Grafana │
│ (port 3001)
2 Datasources: │
│ - CrateDB-Orion │
│ - CrateDB-Stellio│
└─────────────────────┘
```
## Pipelines Complètes
### Pipeline 1 : Orion-LD ✅ (Opérationnel)
1. Simulateur → 3 MQTT Brokers
2. 3 IoT-Agents → Orion-LD (1026)
3. **Orion-LD Subscription** → QuantumLeap-Orion (8668) ✅
4. QuantumLeap-Orion → CrateDB-Orion (5432) ✅
5. Grafana ← CrateDB-Orion ✅
### Pipeline 2 : Stellio 🔄 (En cours)
1. Simulateur → 3 MQTT Brokers
2. 3 IoT-Agents → Stellio (8080) *(à configurer)*
3. **Stellio Subscription** → QuantumLeap-Stellio (8669) *(en cours)*
4. QuantumLeap-Stellio → CrateDB-Stellio (5433) ✅
5. Grafana ← CrateDB-Stellio ✅
## Configuration des Subscriptions
### Pour Orion-LD (déjà fait) ✅
```bash
curl -X POST http://localhost:1026/v2/subscriptions \
-H 'Content-Type: application/json' \
-d '{
"description": "Orion-LD to QuantumLeap-Orion",
"subject": {"entities": [{"idPattern": ".*", "type": "AirQualityObserved"}]},
"notification": {
"http": {"url": "http://smart-city-quantumleap:8668/v2/op/notify"}
}
}'
```
### Pour Stellio (à faire) 🔄
```bash
# Stellio utilise l'API NGSI-LD pour les subscriptions
curl -X POST http://localhost:8080/ngsi-ld/v1/subscriptions \
-H 'Content-Type: application/ld+json' \
-d '{
"description": "Stellio to QuantumLeap-Stellio",
"type": "Subscription",
"entities": [{"type": "AirQualityObserved"}],
"notification": {
"endpoint": {"uri": "http://smart-city-quantumleap-stellio:8668/v2/op/notify"}
}
}'
```
## États des Services
| Service | Container | Port | Statut |
|---------|-----------|------|--------|
| **Orion-LD** | smart-city-orion-ld | 1026 | ✅ Up |
| **QuantumLeap-Orion** | smart-city-quantumleap | 8668 | ✅ Up |
| **CrateDB-Orion** | smart-city-cratedb | 5432/4200 | ✅ Up |
| **Stellio** | stellio-api-gateway | 8080 | ✅ Up |
| **QuantumLeap-Stellio** | smart-city-quantumleap-stellio | 8669 | ✅ Up |
| **CrateDB-Stellio** | smart-city-cratedb-stellio | 5433/4201 | ✅ Up |
| **3 IoT-Agents** | smart-city-iot-agent-* | 4041-4043 | ✅ Up |
| **Grafana** | smart-city-grafana | 3001 | ✅ Up |
## Prochaines Étapes
1.**Orion-LD → QuantumLeap-Orion** (Déjà configuré et opérationnel)
2. 🔄 **Stellio → QuantumLeap-Stellio** (En cours de configuration)
3.**Configurer IoT-Agents** pour envoyer aussi à Stellio
4.**Tester le flux complet** avec Stellio
5.**Créer les dashboards Grafana** (2 sources)
## Notes Importantes
- **Orion-LD** : Utilise l'API NGSI-v2 (`/v2/...`)
- **Stellio** : Utilise l'API NGSI-LD (`/ngsi-ld/v1/...`)
- **QuantumLeap** : Reçoit les notifications et stocke dans CrateDB
- **Grafana** : Visualise les données des 2 CrateDB
---
*Dernière mise à jour : 06 Mai 2026, 18h05 - Correction architecture (Orion→QL-Orion, Stellio→QL-Stellio)*
1|# Architecture Smart City Digital Twin - Martinique (État au 07 Mai 2026)
2|
3|## Architecture Validée : Simulateur → MQTT → IoT Agents → Context Brokers → Time-Series
4|
5|```
6|┌─────────────────────────────────────────────────────────────────────────────┐
7|│ Smart City Simulator (Python) │
8|│ Publie sur 3 brokers MQTT avec format IoT-Agent JSON (30 capteurs)
9|└──────────┬────────────────────┬──────────────────────┬───────────────────┘
10| │ │ │
11| ▼ ▼ ▼
12|┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
13|│ EMQX Broker │ │ Mosquitto Broker │ │ BunkerM Broker │
14|│ (emqx_emqx_1)│ │ (smart-city- │ │ (mqtt.digitribe.│
15|│ :1883 (host mosquitto) │ │ fr:1900)
16|│ 11883) :1883 (host ⏳ À tester │
17|│ ✅ Fonctionnel │ │ 1883) │ │ mosquitto2 │
18|│ │ │ ✅ Fonctionnel │ │
19|└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
20| │ │
21| ▼ ▼
22|┌────────────────── ┌────────────────── ──────────────────┐
23|│ IoT-Agent-EMQX │IoT-Agent-Mosquitto│ │IoT-Agent-BunkerM │
24|│ (smart-city- │ (smart-city- │ (smart-city-
25|│ iot-agent-emqx)│ iot-agent- │ iot-agent-
26|│ :4041 │ │ mosquitto) │ │ bunkerm) │
27|│ Apikey: smart- │ │ :4042 :4043
28|│ city-api-key Apikey: smart- │ Apikey: bunker-│
29|│ │ │ city-api-key │ m-api-key │
30|└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
31| └───────────────────────┴──────────────────────┘
32|
33| ▼
34| ┌───────────────┴───────────────┐
35|
36| ▼ ▼
37|┌─────────────────────┐ ┌─────────────────────┐
38|│ Orion-LD │ │ Stellio
39|│ (smart-city- │ │ (stellio-api-
40|│ orion-ld) │ │ gateway) │
41|│ Port: 1026 Port: 8080
42|│ ✅ Fonctionnel ✅ Fonctionnel
43|│ MongoDB backend │ │ Kafka backend │
44|└─────────┬───────────┘ └─────────┬───────────┘
45| │
46| ▼ ▼
47|┌─────────────────────┐ ┌─────────────────────┐
48|│ QuantumLeap-Orion │ │ QuantumLeap-Stellio │
49|│ (smart-city- │ (smart-city-
50|│ quantumleap) │ │ quantumleap) │
51|│ Port: 8668 │ Port: 8668?
52|│ ✅ Fonctionnel │ (à vérifier)
53|│ → CrateDB-Orion │ │ → CrateDB-Stellio │
54|└─────────┬───────────┘ └─────────┬───────────┘
55| │
56|
57|┌─────────────────────┐ ┌─────────────────────┐
58|│ CrateDB-Orion │ CrateDB-Stellio
59|│ (smart-city- │ (smart-city- │
60|│ cratedb) │ │ cratedb) │
61|│ Port: 5432/4200 │ │ Port: 5432/4200 │
62|│ DB: quantumleap │ │ DB: quantumleap │
63|│ ✅ Données présentes│ │ (à vérifier) │
64|└─────────┬───────────┘ └─────────┬───────────┘
65| │ │
66| └───────────────────────┬─────────┘
67| │
68| ▼
69| ┌─────────────────────┐
70| │ Grafana │
71| │ (digital-twin- │
72| │ grafana) │
73| │ Port: 3000 │
74| │ https:// │
75| │ grafana.digitribe│
76| │ .fr │
77| │ 2 Datasources: │
78| │ - CrateDB-Orion │
79| │ - CrateDB-Stellio│
80| └─────────────────────┘
81|```
82|
83|## Flux de Données Validés (07 Mai 2026)
84|
85|### Pipeline 1 : Orion-LD ✅ (Opérationnel Complet)
86|1. **Simulateur** → Publie sur EMQX & Mosquitto (topics `smartcity-api-key/{sid}/attrs`) ✅
87|2. **IoT Agents** (EMQX & Mosquitto) → Transfèrent vers Orion-LD ✅
88|3. **Orion-LD** (1026) → Reçoit les entités (`urn:ngsi-ld:AirQualityObserved:sensor001`...) ✅
89|4. **QuantumLeap-Orion** (8668) → Reçoit notifications Orion-LD ✅
90|5. **CrateDB-Orion** (5432) → Persistance dans `quantumleap.etairqualityobserved` ✅
91| - Données vérifiées : `sensor005` (NO2=72.1, temp=31.5°C, humidité=92%)
92|6. **Grafana** ← Visualise données CrateDB ✅
93|
94|### Pipeline 2 : Stellio 🔄 (À finaliser)
95|1. **Simulateur** → Publie sur EMQX & Mosquitto ✅
96|2. **IoT Agents** → Transfèrent vers Stellio (à configurer) ⏳
97|3. **Stellio** (8080) → Reçoit les entités NGSI-LD ✅
98|4. **QuantumLeap-Stellio** → Reçoit notifications Stellio (à configurer) ⏳
99|5. **CrateDB-Stellio** → Persistance (même CrateDB?) ⏳
100|6. **Grafana** ← Visualise données ⏳
101|
102|## États des Services (07 Mai 2026 - 21h30)
103|
104|| Service | Container | Ports | Statut | Notes |
105||---------|-----------|--------|--------|-------|
106|| **Simulateur** | `smart-city-simulator` | - | ✅ **UP** | Publie sur 2/3 brokers (EMQX ✅, Mosquitto ✅, BunkerM ❌) |
107|| **EMQX Broker** | `emqx_emqx_1` | 1883 (host 11883) | ✅ **UP** | Messages reçus, topics `smartcity-api-key/#` ✅ |
108|| **Mosquitto Broker** | `smart-city-mosquitto` | 1883 (host 1883) | ✅ **UP** | Messages reçus ✅ |
109|| **BunkerM Broker** | `smart-city-bunkerm` | 1900 | ❌ **Inaccessible** | `mosquitto2.digitribe.fr:1900` ne répond pas au simulateur |
110|| **IoT Agent EMQX** | `smart-city-iot-agent-emqx` | 4041 | ✅ **UP** | Reçoit et transfère vers Orion-LD/Stellio ✅ |
111|| **IoT Agent Mosquitto** | `smart-city-iot-agent-mosquitto` | 4042 | ✅ **UP** | Idem ✅ |
112|| **IoT Agent BunkerM** | `smart-city-iot-agent-bunkerm` | 4043 | ⚠️ **UP** | Mais pas de messages (BunkerM inaccessible) |
113|| **Orion-LD** | `smart-city-orion-ld` | 1026 | ✅ **UP** | Entités créées, subscriptions actives ✅ |
114|| **Stellio** | `stellio-api-gateway` | 8080 | ✅ **UP** | Prêt pour intégration IoT Agent ⏳ |
115|| **QuantumLeap** | `smart-city-quantumleap` | 8668 | ✅ **UP** | Notifications traitées ✅ |
116|| **CrateDB** | `smart-city-cratedb` | 5432/4200 | ✅ **UP** | Table `quantumleap.etairqualityobserved` ✅ |
117|| **Grafana** | `digital-twin-grafana` | 3000 | ✅ **UP** | https://grafana.digitribe.fr ✅ |
118|| **OpenRemote** | `openremote-manager-1` | 8080/8443 | ✅ **UP** | Pas encore connecté aux brokers MQTT ⏳ |
119|| **ThingsBoard** | `smart-city-thingsboard` | 8080 | ❌ **CRASH** | Manque `/config/thingsboard.conf` |
120|
121|## Prochaines Étapes
122|
123|1. ✅ **Corriger le simulateur** pour publier sur les topics IoT Agent (FAIT)
124|2. ⏳ **Configurer Stellio** pour recevoir les données des IoT Agents
125|3. ⏳ **Finaliser QuantumLeap-Stellio** (subscriptions)
126|4. ⏳ **Connecter OpenRemote** aux brokers MQTT (via MQTT Client assets)
127|5. ⏳ **Réparer BunkerM** (rendre accessible mosquitto2lateur)
128|6. ⏳ **Finaliser Grafana** (dashboards avec données CrateDB)
129|7. ❌ **Réparer ThingsBoard** (créer fichier configuration)
130|
131|## Notes Importantes
132|
133|- **Architecture Validée** : Le flux Simulateur → Brokers MQTT → IoT Agents → Orion-LD → QuantumLeap → CrateDB est **opérationnel**.
134|- **Format des données** : IoT Agent utilise `smartcity-api-key/{sid}/attrs` (EMQX), `smartcity-api-key-mosquitto/{sid}/attrs` (Mosquitto), `bunkerm-api-key/{sid}/attrs` (BunkerM).
135|- **Credentials** :
136| - Orion-LD : `http://smart-city-orion-ld:1026`
137| - QuantumLeap : `http://smart-city-quantumleap:8668`
138| - CrateDB : user `crate`, pas de mot de passe, port 5432
139| - Grafana : admin / Digitribe972
140| - OpenRemote : admin / Digitribe972
141|- **Gitea** : https://gitea.digitribe.fr/eric/smart-city-digital-twin-martinique
142|
143|---
144|*Dernière mise à jour : 07 Mai 2026, 21h30 - Architecture validée Orion-LD pipeline complet*

View File

@@ -15,7 +15,7 @@ services:
- "4041:4041"
environment:
# Context Broker (Orion-LD)
- IOTA_CB_HOST=orion-ld
- IOTA_CB_HOST=smart-city-orion-ld
- IOTA_CB_PORT=1026
- IOTA_CB_NGSI_VERSION=v2
# IoT Agent settings
@@ -51,7 +51,7 @@ services:
- "4042:4042"
environment:
# Context Broker (Orion-LD)
- IOTA_CB_HOST=orion-ld
- IOTA_CB_HOST=smart-city-orion-ld
- IOTA_CB_PORT=1026
- IOTA_CB_NGSI_VERSION=v2
# IoT Agent settings
@@ -81,7 +81,7 @@ services:
- "4043:4043"
environment:
# Context Broker (Orion-LD)
- IOTA_CB_HOST=orion-ld
- IOTA_CB_HOST=smart-city-orion-ld
- IOTA_CB_PORT=1026
- IOTA_CB_NGSI_VERSION=v2
# IoT Agent settings