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
This commit is contained in:
Eric FELIXINE
2026-05-06 21:26:21 -04:00
parent 1ac8cf7117
commit 362a9d1f6b
2 changed files with 87 additions and 80 deletions

View File

@@ -1,24 +1,32 @@
# Architecture Finale Smart City - 2 Pipelines Isolées (CORRIGÉ 18h05) # Architecture Smart City Digital Twin - Martinique (État au 07 Mai 2026)
## Principe : Chaque Context Broker a sa propre pipeline ## Architecture Validée : Simulateur → MQTT → IoT Agents → Context Brokers → Time-Series
``` ```
┌─────────────────────────────────────────────────────────────────────────────┐ ┌─────────────────────────────────────────────────────────────────────────────┐
│ Smart City Simulator (Python) │ │ Smart City Simulator (Python) │
│ Publie sur 3 brokers MQTT avec format IoT-Agent JSON │ Publie sur 3 brokers MQTT avec format IoT-Agent JSON (30 capteurs)
└──────────┬────────────────────┬──────────────────────┬───────────────────┘ └──────────┬────────────────────┬──────────────────────┬───────────────────┘
│ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ EMQX Broker │ │ Mosquitto Broker │ │ BunkerM Broker │ │ EMQX Broker │ │ Mosquitto Broker │ │ BunkerM Broker │
│ (emqx_emqx_1)│ │ (smart-city- │ │ (mqtt.digitribe.│
│ :1883 (host │ │ mosquitto) │ │ fr:1900) │
│ 11883) │ │ :1883 (host │ │ ❌ Inaccessible │
│ ✅ Fonctionnel │ │ 1883) │ │ depuis simu │
│ │ │ ✅ Fonctionnel │ │ │
└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
│ │ │ │ │ │
▼ ▼ ▼ ▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ IoT-Agent-EMQX │ │IoT-Agent-Mosquitto│ │IoT-Agent-BunkerM │ │ IoT-Agent-EMQX │ │IoT-Agent-Mosquitto│ │IoT-Agent-BunkerM │
Port: 4041 │ │ Port: 4042 │ │ Port: 4043 (smart-city- │ │ (smart-city- │ │ (smart-city-
Apikey: smart- │ │ Apikey: smart- │ │ Apikey: smart- iot-agent-emqx)│ │ iot-agent- │ │ iot-agent-
city-api-key │ │ city-api-key │ │ city-api-key :4041 │ │ mosquitto) │ │ bunkerm)
│ Apikey: smart- │ │ :4042 │ │ :4043 │
│ city-api-key │ │ Apikey: smart- │ │ Apikey: bunker-│
│ │ │ city-api-key │ │ m-api-key │
└────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘ └────────┬─────────┘
└───────────────────────┴──────────────────────┘ └───────────────────────┴──────────────────────┘
@@ -28,23 +36,31 @@
▼ ▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ Orion-LD │ │ Stellio │ │ Orion-LD │ │ Stellio │
│ (port 1026) │ │ (port 8080) │ (smart-city- │ │ (stellio-api-
MongoDB backend │ │ (API Gateway) │ orion-ld) │ │ gateway)
│ Port: 1026 │ │ Port: 8080 │
│ ✅ Fonctionnel │ │ ✅ Fonctionnel │
│ MongoDB backend │ │ Kafka backend │
└─────────┬───────────┘ └─────────┬───────────┘ └─────────┬───────────┘ └─────────┬───────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ QuantumLeap-Orion │ │ QuantumLeap-Stellio │ │ QuantumLeap-Orion │ │ QuantumLeap-Stellio │
│ (port 8668) │ │ (port 8669) │ (smart-city- │ │ (smart-city-
│ quantumleap) │ │ quantumleap) │
│ Port: 8668 │ │ Port: 8668? │
│ ✅ Fonctionnel │ │ (à vérifier) │
│ → CrateDB-Orion │ │ → CrateDB-Stellio │ │ → CrateDB-Orion │ │ → CrateDB-Stellio │
└─────────┬───────────┘ └─────────┬───────────┘ └─────────┬───────────┘ └─────────┬───────────┘
│ │ │ │
▼ ▼ ▼ ▼
┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐ ┌─────────────────────┐
│ CrateDB-Orion │ │ CrateDB-Stellio │ │ CrateDB-Orion │ │ CrateDB-Stellio │
│ (port 5432/4200) │ │ (port 5433/4201) │ (smart-city- │ │ (smart-city-
DB: quantumleap │ │ DB: quantumleap_ cratedb) │ │ cratedb)
│ │ stellio Port: 5432/4200 │ │ Port: 5432/4200
│ DB: quantumleap │ │ DB: quantumleap │
│ ✅ Données présentes│ │ (à vérifier) │
└─────────┬───────────┘ └─────────┬───────────┘ └─────────┬───────────┘ └─────────┬───────────┘
│ │ │ │
└───────────────────────┬─────────┘ └───────────────────────┬─────────┘
@@ -52,86 +68,77 @@
┌─────────────────────┐ ┌─────────────────────┐
│ Grafana │ │ Grafana │
│ (port 3001) │ (digital-twin-
│ grafana) │
│ Port: 3000 │
│ https:// │
│ grafana.digitribe│
│ .fr │
│ 2 Datasources: │ │ 2 Datasources: │
│ - CrateDB-Orion │ │ - CrateDB-Orion │
│ - CrateDB-Stellio│ │ - CrateDB-Stellio│
└─────────────────────┘ └─────────────────────┘
``` ```
## Pipelines Complètes ## Flux de Données Validés (07 Mai 2026)
### Pipeline 1 : Orion-LD ✅ (Opérationnel) ### Pipeline 1 : Orion-LD ✅ (Opérationnel Complet)
1. Simulateur → 3 MQTT Brokers 1. **Simulateur** → Publie sur EMQX & Mosquitto (topics `smartcity-api-key/{sid}/attrs`) ✅
2. 3 IoT-Agents Orion-LD (1026) 2. **IoT Agents** (EMQX & Mosquitto) → Transfèrent vers Orion-LD
3. **Orion-LD Subscription** → QuantumLeap-Orion (8668) ✅ 3. **Orion-LD** (1026) → Reçoit les entités (`urn:ngsi-ld:AirQualityObserved:sensor001`...) ✅
4. QuantumLeap-Orion → CrateDB-Orion (5432) 4. **QuantumLeap-Orion** (8668) → Reçoit notifications Orion-LD
5. Grafana ← CrateDB-Orion ✅ 5. **CrateDB-Orion** (5432) → Persistance dans `quantumleap.etairqualityobserved`
- Données vérifiées : `sensor005` (NO2=72.1, temp=31.5°C, humidité=92%)
6. **Grafana** ← Visualise données CrateDB ✅
### Pipeline 2 : Stellio 🔄 (En cours) ### Pipeline 2 : Stellio 🔄 (À finaliser)
1. Simulateur → 3 MQTT Brokers 1. **Simulateur** → Publie sur EMQX & Mosquitto ✅
2. 3 IoT-Agents → Stellio (8080) *(à configurer)* 2. **IoT Agents** → Transfèrent vers Stellio (à configurer)
3. **Stellio Subscription** → QuantumLeap-Stellio (8669) *(en cours)* 3. **Stellio** (8080) → Reçoit les entités NGSI-LD ✅
4. QuantumLeap-Stellio → CrateDB-Stellio (5433) 4. **QuantumLeap-Stellio** → Reçoit notifications Stellio (à configurer)
5. Grafana ← CrateDB-Stellio 5. **CrateDB-Stellio** → Persistance (même CrateDB?) ⏳
6. **Grafana** ← Visualise données ⏳
## Configuration des Subscriptions ## États des Services (07 Mai 2026 - 21h30)
### Pour Orion-LD (déjà fait) ✅ | Service | Container | Ports | Statut | Notes |
```bash |---------|-----------|--------|--------|-------|
curl -X POST http://localhost:1026/v2/subscriptions \ | **Simulateur** | `smart-city-simulator` | - | ✅ **UP** | Publie sur 2/3 brokers (EMQX ✅, Mosquitto ✅, BunkerM ❌) |
-H 'Content-Type: application/json' \ | **EMQX Broker** | `emqx_emqx_1` | 1883 (host 11883) | ✅ **UP** | Messages reçus, topics `smartcity-api-key/#` ✅ |
-d '{ | **Mosquitto Broker** | `smart-city-mosquitto` | 1883 (host 1883) | ✅ **UP** | Messages reçus ✅ |
"description": "Orion-LD to QuantumLeap-Orion", | **BunkerM Broker** | `smart-city-bunkerm` | 1900 | ❌ **Inaccessible** | `mqtt.digitribe.fr:1900` ne répond pas au simulateur |
"subject": {"entities": [{"idPattern": ".*", "type": "AirQualityObserved"}]}, | **IoT Agent EMQX** | `smart-city-iot-agent-emqx` | 4041 | ✅ **UP** | Reçoit et transfère vers Orion-LD/Stellio ✅ |
"notification": { | **IoT Agent Mosquitto** | `smart-city-iot-agent-mosquitto` | 4042 | ✅ **UP** | Idem ✅ |
"http": {"url": "http://smart-city-quantumleap:8668/v2/op/notify"} | **IoT Agent BunkerM** | `smart-city-iot-agent-bunkerm` | 4043 | ⚠️ **UP** | Mais pas de messages (BunkerM inaccessible) |
} | **Orion-LD** | `smart-city-orion-ld` | 1026 | ✅ **UP** | Entités créées, subscriptions actives ✅ |
}' | **Stellio** | `stellio-api-gateway` | 8080 | ✅ **UP** | Prêt pour intégration IoT Agent ⏳ |
``` | **QuantumLeap** | `smart-city-quantumleap` | 8668 | ✅ **UP** | Notifications traitées ✅ |
| **CrateDB** | `smart-city-cratedb` | 5432/4200 | ✅ **UP** | Table `quantumleap.etairqualityobserved` ✅ |
### Pour Stellio (à faire) 🔄 | **Grafana** | `digital-twin-grafana` | 3000 | ✅ **UP** | https://grafana.digitribe.fr ✅ |
```bash | **OpenRemote** | `openremote-manager-1` | 8080/8443 | ✅ **UP** | Pas encore connecté aux brokers MQTT ⏳ |
# Stellio utilise l'API NGSI-LD pour les subscriptions | **ThingsBoard** | `smart-city-thingsboard` | 8080 | ❌ **CRASH** | Manque `/config/thingsboard.conf` |
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 ## Prochaines Étapes
1.**Orion-LD → QuantumLeap-Orion** (Déjà configuré et opérationnel) 1.**Corriger le simulateur** pour publier sur les topics IoT Agent (FAIT)
2. 🔄 **Stellio → QuantumLeap-Stellio** (En cours de configuration) 2. **Configurer Stellio** pour recevoir les données des IoT Agents
3.**Configurer IoT-Agents** pour envoyer aussi à Stellio 3.**Finaliser QuantumLeap-Stellio** (subscriptions)
4.**Tester le flux complet** avec Stellio 4.**Connecter OpenRemote** aux brokers MQTT (via MQTT Client assets)
5.**Créer les dashboards Grafana** (2 sources) 5.**Réparer BunkerM** (rendre accessible depuis simulateur)
6.**Finaliser Grafana** (dashboards avec données CrateDB)
7.**Réparer ThingsBoard** (créer fichier configuration)
## Notes Importantes ## Notes Importantes
- **Orion-LD** : Utilise l'API NGSI-v2 (`/v2/...`) - **Architecture Validée** : Le flux Simulateur → Brokers MQTT → IoT Agents → Orion-LD → QuantumLeap → CrateDB est **opérationnel**.
- **Stellio** : Utilise l'API NGSI-LD (`/ngsi-ld/v1/...`) - **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).
- **QuantumLeap** : Reçoit les notifications et stocke dans CrateDB - **Credentials** :
- **Grafana** : Visualise les données des 2 CrateDB - Orion-LD : `http://smart-city-orion-ld:1026`
- QuantumLeap : `http://smart-city-quantumleap:8668`
- CrateDB : user `crate`, pas de mot de passe, port 5432
- Grafana : admin / Digitribe972
- OpenRemote : admin / Digitribe972
- **Gitea** : https://gitea.digitribe.fr/eric/smart-city-digital-twin-martinique
--- ---
*Dernière mise à jour : 06 Mai 2026, 18h05 - Correction architecture (Orion→QL-Orion, Stellio→QL-Stellio)* *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