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) 1|# Architecture Smart City Digital Twin - Martinique (État au 07 Mai 2026)
2|
## Principe : Chaque Context Broker a sa propre pipeline 3|## Architecture Validée : Simulateur → MQTT → IoT Agents → Context Brokers → Time-Series
4|
``` 5|```
┌─────────────────────────────────────────────────────────────────────────────┐ 6|┌─────────────────────────────────────────────────────────────────────────────┐
│ Smart City Simulator (Python) │ 7|│ Smart City Simulator (Python) │
│ Publie sur 3 brokers MQTT avec format IoT-Agent JSON 8|│ Publie sur 3 brokers MQTT avec format IoT-Agent JSON (30 capteurs)
└──────────┬────────────────────┬──────────────────────┬───────────────────┘ 9|└──────────┬────────────────────┬──────────────────────┬───────────────────┘
│ │ │ 10| │ │ │
▼ ▼ ▼ 11| ▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ 12|┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ EMQX Broker │ │ Mosquitto Broker │ │ BunkerM Broker │ 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 │
│ IoT-Agent-EMQX │ │IoT-Agent-Mosquitto│ │IoT-Agent-BunkerM 18|│ │ │ ✅ Fonctionnel │ │
│ Port: 4041 │ │ Port: 4042 │ │ Port: 4043 │ 19|└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
│ Apikey: smart- │ │ Apikey: smart- │ Apikey: smart- 20| │ │
│ city-api-key │ city-api-key │ city-api-key 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 │
Orion-LD │ │ Stellio │ 30|└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
(port 1026) │ │ (port 8080) │ 31| └───────────────────────┴──────────────────────┘
MongoDB backend (API Gateway) 32|
└─────────┬───────────┘ └─────────┬───────────┘ 33| ▼
34| ┌───────────────┴───────────────┐
35|
┌─────────────────────┐ ┌─────────────────────┐ 36| ▼ ▼
│ QuantumLeap-Orion │ │ QuantumLeap-Stellio │ 37|┌─────────────────────┐ ┌─────────────────────┐
│ (port 8668) │ │ (port 8669) 38|│ Orion-LD │ │ Stellio
│ → CrateDB-Orion │ │ → CrateDB-Stellio 39|│ (smart-city- │ │ (stellio-api-
└─────────┬───────────┘ └─────────┬───────────┘ 40|│ orion-ld) │ │ gateway) │
41|│ Port: 1026 Port: 8080
42|│ ✅ Fonctionnel ✅ Fonctionnel
┌─────────────────────┐ ┌─────────────────────┐ 43|│ MongoDB backend │ │ Kafka backend │
│ CrateDB-Orion │ │ CrateDB-Stellio │ 44|└─────────┬───────────┘ └─────────┬───────────┘
│ (port 5432/4200) │ │ (port 5433/4201) 45| │
│ DB: quantumleap │ │ DB: quantumleap_ │ 46| ▼ ▼
│ │ stellio │ 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 │
│ Grafana │ 54|└─────────┬───────────┘ └─────────┬───────────┘
│ (port 3001) 55| │
2 Datasources: │ 56|
│ - CrateDB-Orion │ 57|┌─────────────────────┐ ┌─────────────────────┐
│ - CrateDB-Stellio│ 58|│ CrateDB-Orion │ CrateDB-Stellio
└─────────────────────┘ 59|│ (smart-city- │ (smart-city- │
``` 60|│ cratedb) │ │ cratedb) │
61|│ Port: 5432/4200 │ │ Port: 5432/4200 │
## Pipelines Complètes 62|│ DB: quantumleap │ │ DB: quantumleap │
63|│ ✅ Données présentes│ │ (à vérifier) │
### Pipeline 1 : Orion-LD ✅ (Opérationnel) 64|└─────────┬───────────┘ └─────────┬───────────┘
1. Simulateur → 3 MQTT Brokers 65| │ │
2. 3 IoT-Agents → Orion-LD (1026) 66| └───────────────────────┬─────────┘
3. **Orion-LD Subscription** → QuantumLeap-Orion (8668) ✅ 67| │
4. QuantumLeap-Orion → CrateDB-Orion (5432) ✅ 68| ▼
5. Grafana ← CrateDB-Orion ✅ 69| ┌─────────────────────┐
70| │ Grafana │
### Pipeline 2 : Stellio 🔄 (En cours) 71| │ (digital-twin- │
1. Simulateur → 3 MQTT Brokers 72| │ grafana) │
2. 3 IoT-Agents → Stellio (8080) *(à configurer)* 73| │ Port: 3000 │
3. **Stellio Subscription** → QuantumLeap-Stellio (8669) *(en cours)* 74| │ https:// │
4. QuantumLeap-Stellio → CrateDB-Stellio (5433) ✅ 75| │ grafana.digitribe│
5. Grafana ← CrateDB-Stellio ✅ 76| │ .fr │
77| │ 2 Datasources: │
## Configuration des Subscriptions 78| │ - CrateDB-Orion │
79| │ - CrateDB-Stellio│
### Pour Orion-LD (déjà fait) ✅ 80| └─────────────────────┘
```bash 81|```
curl -X POST http://localhost:1026/v2/subscriptions \ 82|
-H 'Content-Type: application/json' \ 83|## Flux de Données Validés (07 Mai 2026)
-d '{ 84|
"description": "Orion-LD to QuantumLeap-Orion", 85|### Pipeline 1 : Orion-LD ✅ (Opérationnel Complet)
"subject": {"entities": [{"idPattern": ".*", "type": "AirQualityObserved"}]}, 86|1. **Simulateur** → Publie sur EMQX & Mosquitto (topics `smartcity-api-key/{sid}/attrs`) ✅
"notification": { 87|2. **IoT Agents** (EMQX & Mosquitto) → Transfèrent vers Orion-LD ✅
"http": {"url": "http://smart-city-quantumleap:8668/v2/op/notify"} 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 ✅
### Pour Stellio (à faire) 🔄 93|
```bash 94|### Pipeline 2 : Stellio 🔄 (À finaliser)
# Stellio utilise l'API NGSI-LD pour les subscriptions 95|1. **Simulateur** → Publie sur EMQX & Mosquitto ✅
curl -X POST http://localhost:8080/ngsi-ld/v1/subscriptions \ 96|2. **IoT Agents** → Transfèrent vers Stellio (à configurer) ⏳
-H 'Content-Type: application/ld+json' \ 97|3. **Stellio** (8080) → Reçoit les entités NGSI-LD ✅
-d '{ 98|4. **QuantumLeap-Stellio** → Reçoit notifications Stellio (à configurer) ⏳
"description": "Stellio to QuantumLeap-Stellio", 99|5. **CrateDB-Stellio** → Persistance (même CrateDB?) ⏳
"type": "Subscription", 100|6. **Grafana** ← Visualise données ⏳
"entities": [{"type": "AirQualityObserved"}], 101|
"notification": { 102|## États des Services (07 Mai 2026 - 21h30)
"endpoint": {"uri": "http://smart-city-quantumleap-stellio:8668/v2/op/notify"} 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/#` ✅ |
## États des Services 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 |
| Service | Container | Port | Statut | 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 ✅ |
| **Orion-LD** | smart-city-orion-ld | 1026 | ✅ Up | 112|| **IoT Agent BunkerM** | `smart-city-iot-agent-bunkerm` | 4043 | ⚠️ **UP** | Mais pas de messages (BunkerM inaccessible) |
| **QuantumLeap-Orion** | smart-city-quantumleap | 8668 | ✅ Up | 113|| **Orion-LD** | `smart-city-orion-ld` | 1026 | ✅ **UP** | Entités créées, subscriptions actives ✅ |
| **CrateDB-Orion** | smart-city-cratedb | 5432/4200 | ✅ Up | 114|| **Stellio** | `stellio-api-gateway` | 8080 | ✅ **UP** | Prêt pour intégration IoT Agent ⏳ |
| **Stellio** | stellio-api-gateway | 8080 | ✅ Up | 115|| **QuantumLeap** | `smart-city-quantumleap` | 8668 | ✅ **UP** | Notifications traitées ✅ |
| **QuantumLeap-Stellio** | smart-city-quantumleap-stellio | 8669 | ✅ Up | 116|| **CrateDB** | `smart-city-cratedb` | 5432/4200 | ✅ **UP** | Table `quantumleap.etairqualityobserved` ✅ |
| **CrateDB-Stellio** | smart-city-cratedb-stellio | 5433/4201 | ✅ Up | 117|| **Grafana** | `digital-twin-grafana` | 3000 | ✅ **UP** | https://grafana.digitribe.fr ✅ |
| **3 IoT-Agents** | smart-city-iot-agent-* | 4041-4043 | ✅ Up | 118|| **OpenRemote** | `openremote-manager-1` | 8080/8443 | ✅ **UP** | Pas encore connecté aux brokers MQTT ⏳ |
| **Grafana** | smart-city-grafana | 3001 | ✅ Up | 119|| **ThingsBoard** | `smart-city-thingsboard` | 8080 | ❌ **CRASH** | Manque `/config/thingsboard.conf` |
120|
## Prochaines Étapes 121|## Prochaines Étapes
122|
1.**Orion-LD → QuantumLeap-Orion** (Déjà configuré et opérationnel) 123|1. ✅ **Corriger le simulateur** pour publier sur les topics IoT Agent (FAIT)
2. 🔄 **Stellio → QuantumLeap-Stellio** (En cours de configuration) 124|2. ⏳ **Configurer Stellio** pour recevoir les données des IoT Agents
3.**Configurer IoT-Agents** pour envoyer aussi à Stellio 125|3. ⏳ **Finaliser QuantumLeap-Stellio** (subscriptions)
4.**Tester le flux complet** avec Stellio 126|4. ⏳ **Connecter OpenRemote** aux brokers MQTT (via MQTT Client assets)
5.**Créer les dashboards Grafana** (2 sources) 127|5. ⏳ **Réparer BunkerM** (rendre accessible mosquitto2lateur)
128|6. ⏳ **Finaliser Grafana** (dashboards avec données CrateDB)
## Notes Importantes 129|7. ❌ **Réparer ThingsBoard** (créer fichier configuration)
130|
- **Orion-LD** : Utilise l'API NGSI-v2 (`/v2/...`) 131|## Notes Importantes
- **Stellio** : Utilise l'API NGSI-LD (`/ngsi-ld/v1/...`) 132|
- **QuantumLeap** : Reçoit les notifications et stocke dans CrateDB 133|- **Architecture Validée** : Le flux Simulateur → Brokers MQTT → IoT Agents → Orion-LD → QuantumLeap → CrateDB est **opérationnel**.
- **Grafana** : Visualise les données des 2 CrateDB 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`
*Dernière mise à jour : 06 Mai 2026, 18h05 - Correction architecture (Orion→QL-Orion, Stellio→QL-Stellio)* 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" - "4041:4041"
environment: environment:
# Context Broker (Orion-LD) # Context Broker (Orion-LD)
- IOTA_CB_HOST=orion-ld - IOTA_CB_HOST=smart-city-orion-ld
- IOTA_CB_PORT=1026 - IOTA_CB_PORT=1026
- IOTA_CB_NGSI_VERSION=v2 - IOTA_CB_NGSI_VERSION=v2
# IoT Agent settings # IoT Agent settings
@@ -51,7 +51,7 @@ services:
- "4042:4042" - "4042:4042"
environment: environment:
# Context Broker (Orion-LD) # Context Broker (Orion-LD)
- IOTA_CB_HOST=orion-ld - IOTA_CB_HOST=smart-city-orion-ld
- IOTA_CB_PORT=1026 - IOTA_CB_PORT=1026
- IOTA_CB_NGSI_VERSION=v2 - IOTA_CB_NGSI_VERSION=v2
# IoT Agent settings # IoT Agent settings
@@ -81,7 +81,7 @@ services:
- "4043:4043" - "4043:4043"
environment: environment:
# Context Broker (Orion-LD) # Context Broker (Orion-LD)
- IOTA_CB_HOST=orion-ld - IOTA_CB_HOST=smart-city-orion-ld
- IOTA_CB_PORT=1026 - IOTA_CB_PORT=1026
- IOTA_CB_NGSI_VERSION=v2 - IOTA_CB_NGSI_VERSION=v2
# IoT Agent settings # IoT Agent settings