docs: Add session resume 2026-05-06 - IoT-Agent integration and QuantumLeap setup

This commit is contained in:
Eric FELIXINE
2026-05-06 16:36:55 -04:00
parent 0c1b75fcd3
commit 00b55a29a2

View File

@@ -1,65 +1,68 @@
# Session Resume - 2026-05-06 (02:30 AM Martinique) # Session Resume - Smart City Digital Twin Martinique (2026-05-06)
## 🎯 Objectif Démo ## Objectif
- **Date** : Jeudi 8 Mai 2026 (ou Mercredi 7 si progrès suffisant) Finaliser l'installation et l'accessibilité du Smart City Digital Twin Martinique, spécifiquement la mise en service des flux de données :
- **Stack** : Smart City Digital Twin Martinique **MQTT → IoT-Agent → Context Brokers (Stellio) → QuantumLeap → CrateDB → Grafana**
- **Statut** : Débogage OpenRemote (Carte, Agents, Brokers) + Pulsar Manager
## ✅ Réalisations (174 tentatives) ## État des conteneurs (16h35)
1. **Simulateur** : Fonctionnel, publie vers MQTT, InfluxDB, Prometheus (`smart-city-simulator` container). - **smart-city-iot-agent** : Up (port 4041) - Service et devices créés ✅
2. **Grafana** : Dashboards opérationnels avec données Prometheus. - **smart-city-quantumleap** : Up (port 8668) - Écoute mais ne répond pas en HTTP simple ⚠️
3. **GeoServer** : Accessible (erreur 400 corrigée), MapStore configuré. - **smart-city-cratedb** : Up (ports 5432/4200) - Accessible ✅
4. **Pulsar Manager** : `curl` installé dans le conteneur, `init_db.sql` modifié pour `admin/Digitribe972`. - **smart-city-grafana** : Up (port 3001) - CrateDB ajouté comme datasource via subagent ✅
5. **Traefik** : Fichier `27-bunkerm-web.yml` corrigé (hostname `bunkerm_bunkerm_1` avec underscores). - **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)
## ❌ Problèmes Restants ## Travail accompli
1. **OpenRemote Maps** : 1. **Diagramme de flux** mis à jour avec IoT-Agent, QuantumLeap, CrateDB (commit+push) ✅
- Carte Martinique ne s'affiche pas bien (bounds à corriger dans `martinique.mbtiles` via sqlite3). 2. **IoT-Agent** : Service et devices créés (HTTP 201) ✅
- Légendes et icônes capteurs à configurer. 3. **Simulateur** : Ajout de `publish_iot_agent` et variable `ENABLE_IOT_AGENT`
- `mapsettings.json` doit être restauré depuis template Martinique. 4. **QuantumLeap** : Lancer via `docker-compose.quantumleap.yml`
2. **OpenRemote Agents (CRITIQUE)** : 5. **CrateDB** : Accessible via port 4200 (SQL interface) ✅
- API REST bloquée 401 (174 tentatives échouées).
- Solution : Utiliser **UNIQUEMENT l'UI** (`https://openremote.digitribe.fr/manager/#/agents`).
- Agents à créer : MQTT (EMQX, Mosquitto, BunkerM, Redpanda, Pulsar) + HTTP (Orion-LD, Stellio).
3. **Pulsar Manager** : Login `admin/Digitribe972` échoue (401). Nécessite reset volume `pulsar_pulsar-manager-db-data`.
## 🛠️ Actions à Faire Demain (Mercredi 7 Mai) ## Blocages rencontrés
### OpenRemote (Priorité 1) 1. **Flux MQTT → IoT-Agent → Stellio** :
- [ ] Restaurer `mapsettings.json` depuis `templates/mapsettings_martinique_2026-05-02.json`. - IoT-Agent reçoit le message MQTT mais Stellio retourne 404
- [ ] Corriger bounds mbtiles : `sqlite3 martinique.mbtiles "UPDATE metadata SET value='-61.3,14.3,-60.8,14.9' WHERE name='bounds';"` - Problème probable : IoT-Agent ne transmet pas correctement à Stellio (configuration cbroker)
- [ ] UI : Créer Agents MQTT (EMQX:11883, Mosquitto:1900, BunkerM:1900, Redpanda:2181, Pulsar:6650).
- [ ] UI : Créer Agents HTTP (Orion-LD:2026, Stellio:8087) avec headers NGSI-LD.
- [ ] UI : Lier Assets (AirQualityObserved, etc.) aux Agents.
### Pulsar Manager 2. **QuantumLeap** :
- [ ] `docker volume rm pulsar_pulsar-manager-db-data` - Port 8668 en écoute mais `curl http://localhost:8668` retourne 000
- [ ] `docker compose up -d pulsar-manager` (rejoue init_db.sql) - Endpoint `/v2/subscriptions` à tester
- [ ] Tester login `admin/Digitribe972`.
### Traefik 3. **Stellio** :
- [ ] Vérifier accès `https://bunkerm.digitribe.fr` (port 2000 web UI BunkerM). - POST /ngsi-ld/v1/entities retourne 405 (method not allowed)
- GET /ngsi-ld/v1/entities retourne 404 (pas d'entités)
## 📝 Commandes Clé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 ```bash
# OpenRemote Map Fix # Vérifier IoT-Agent
docker exec openremote-manager-1 cp /deployment/map/mapsettings_martinique_2026-05-02.json /deployment/map/mapsettings.json curl -s http://localhost:4041/iot/services -H 'FIWARE-Service: smartcity' -H 'FIWARE-ServicePath: /'
docker cp openremote-manager-1:/deployment/map/martinique.mbtiles /tmp/ curl -s http://localhost:4041/iot/devices -H 'FIWARE-Service: smartcity' -H 'FIWARE-ServicePath: /'
sqlite3 /tmp/martinique.mbtiles "UPDATE metadata SET value='-61.3,14.3,-60.8,14.9' WHERE name='bounds';"
docker cp /tmp/martinique.mbtiles openremote-manager-1:/deployment/map/
docker restart openremote-manager-1
# Pulsar Manager Fix # Tester QuantumLeap
docker stop smart-city-pulsar-manager curl -s http://localhost:8668/v2/entities -w "\nHTTP %{http_code}\n"
docker volume rm smart-city-digital-twin-martinique_pulsar-manager-db-data curl -s http://localhost:8668/v2/subscriptions -w "\nHTTP %{http_code}\n"
cd ~/smart-city-digital-twin-martinique && docker compose up -d smart-city-pulsar-manager
# 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 Aujourd'hui ## Fichiers modifiés
- `/home/eric/traefik-config/dynamic/27-bunkerm-web.yml` (hostname corrigé) - `simulator.py` : Ajout `publish_iot_agent`, variable `ENABLE_IOT_AGENT`
- `/home/eric/traefik-config/dynamic/21-pulsar.yml` (si modifié) - `docker-compose.iot-agent.yml` : Configuration EMQX et Stellio
- `init_db.sql` (dans conteneur pulsar-manager, mot de passe admin changé) - `data-flow-diagram.md` et `.html` : Mise à jour architecture
## ⏰ Prochain Créneau ## Notes
- **Mercredi 7 Mai 2026, 14h00 (heure Martinique)**. - Le simulateur publie maintenant sur le topic `smartcity-api-key/{device_id}/attrs` via EMQX
- **Durée prévue** : 4-5 heures jusqu'à 19h00. - IoT-Agent est configuré pour transmettre à Stellio (cbroker: http://stellio-api-gateway:8080)
- **Objectif** : Stack 100% fonctionnel pour démo Jeudi. - CrateDB est accessible et QuantumLeap devrait y écrire les séries temporelles
- Grafana a CrateDB comme datasource (ajouté par subagent)