69 lines
3.4 KiB
Markdown
69 lines
3.4 KiB
Markdown
# Session Resume - Smart City Digital Twin Martinique (2026-05-06)
|
|
|
|
## Objectif
|
|
Finaliser l'installation et l'accessibilité du Smart City Digital Twin Martinique, spécifiquement la mise en service des flux de données :
|
|
**MQTT → IoT-Agent → Context Brokers (Stellio) → QuantumLeap → CrateDB → Grafana**
|
|
|
|
## État des conteneurs (16h35)
|
|
- **smart-city-iot-agent** : Up (port 4041) - Service et devices créés ✅
|
|
- **smart-city-quantumleap** : Up (port 8668) - Écoute mais ne répond pas en HTTP simple ⚠️
|
|
- **smart-city-cratedb** : Up (ports 5432/4200) - Accessible ✅
|
|
- **smart-city-grafana** : Up (port 3001) - CrateDB ajouté comme datasource via subagent ✅
|
|
- **stellio-api-gateway** : Up (port 8080) - Mais retourne 404 sur les entités ❌
|
|
- **smart-city-simulator** : Up - Modifié pour publier au format IoT-Agent ✅ (commit & push)
|
|
|
|
## Travail accompli
|
|
1. **Diagramme de flux** mis à jour avec IoT-Agent, QuantumLeap, CrateDB (commit+push) ✅
|
|
2. **IoT-Agent** : Service et devices créés (HTTP 201) ✅
|
|
3. **Simulateur** : Ajout de `publish_iot_agent` et variable `ENABLE_IOT_AGENT` ✅
|
|
4. **QuantumLeap** : Lancer via `docker-compose.quantumleap.yml` ✅
|
|
5. **CrateDB** : Accessible via port 4200 (SQL interface) ✅
|
|
|
|
## Blocages rencontrés
|
|
1. **Flux MQTT → IoT-Agent → Stellio** :
|
|
- IoT-Agent reçoit le message MQTT mais Stellio retourne 404
|
|
- Problème probable : IoT-Agent ne transmet pas correctement à Stellio (configuration cbroker)
|
|
|
|
2. **QuantumLeap** :
|
|
- Port 8668 en écoute mais `curl http://localhost:8668` retourne 000
|
|
- Endpoint `/v2/subscriptions` à tester
|
|
|
|
3. **Stellio** :
|
|
- POST /ngsi-ld/v1/entities retourne 405 (method not allowed)
|
|
- GET /ngsi-ld/v1/entities retourne 404 (pas d'entités)
|
|
|
|
## Prochaines étapes
|
|
1. Tester QuantumLeap : `curl http://localhost:8668/v2/subscriptions`
|
|
2. Configurer une subscription dans Stellio pour notifier QuantumLeap
|
|
3. Vérifier pourquoi IoT-Agent ne transmet pas à Stellio (logs : `cbroker: http://stellio-api-gateway:8080` présent)
|
|
4. Tester le flux complet avec un message MQTT manuel
|
|
5. Finaliser Pulsar Manager (login admin)
|
|
|
|
## Commandes utiles
|
|
```bash
|
|
# Vérifier IoT-Agent
|
|
curl -s http://localhost:4041/iot/services -H 'FIWARE-Service: smartcity' -H 'FIWARE-ServicePath: /'
|
|
curl -s http://localhost:4041/iot/devices -H 'FIWARE-Service: smartcity' -H 'FIWARE-ServicePath: /'
|
|
|
|
# Tester QuantumLeap
|
|
curl -s http://localhost:8668/v2/entities -w "\nHTTP %{http_code}\n"
|
|
curl -s http://localhost:8668/v2/subscriptions -w "\nHTTP %{http_code}\n"
|
|
|
|
# Tester Stellio
|
|
curl -s http://localhost:8080/ngsi-ld/v1/entities -H "Accept: application/ld+json" -w "\nHTTP %{http_code}\n"
|
|
|
|
# Publier un message MQTT pour IoT-Agent
|
|
mosquitto_pub -h localhost -p 11883 -t "smartcity-api-key/airquality_001/attrs" -m '{"NO2": 50.5, "temperature": 30.0, "humidity": 90.0}'
|
|
```
|
|
|
|
## Fichiers modifiés
|
|
- `simulator.py` : Ajout `publish_iot_agent`, variable `ENABLE_IOT_AGENT`
|
|
- `docker-compose.iot-agent.yml` : Configuration EMQX et Stellio
|
|
- `data-flow-diagram.md` et `.html` : Mise à jour architecture
|
|
|
|
## Notes
|
|
- Le simulateur publie maintenant sur le topic `smartcity-api-key/{device_id}/attrs` via EMQX
|
|
- IoT-Agent est configuré pour transmettre à Stellio (cbroker: http://stellio-api-gateway:8080)
|
|
- CrateDB est accessible et QuantumLeap devrait y écrire les séries temporelles
|
|
- Grafana a CrateDB comme datasource (ajouté par subagent)
|