Mise à jour resume session - Assets OpenRemote finalisés

This commit is contained in:
Eric FELIXINE
2026-05-06 22:39:21 -04:00
parent 6162cf0b13
commit 67ac37545e

View File

@@ -1,83 +1,31 @@
# Session Resume - 2026-05-06 - Smart City Digital Twin Martinique
# Session Resume - 2026-05-06 - FINAL
## État de l'infrastructure (21:35)
## Réalisations clés
1. **60 assets OpenRemote créés** (30 master + 30 smartcity)
2. **Type corrigé** : `urn:openremote:agent:mqtt` (pour connexion MQTT)
3. **Géolocalisation** : Coordonnées Martinique (Fort-de-France, Le Robert, etc.)
4. **Liens MQTT** : Topics configurés (`smartcity-master/*`, `smartcity-smartcity/*`)
5. **Redémarrage OpenRemote** effectué
### ✅ Réalisé cette session
1. **BunkerM (mosquitto2.digitribe.fr:1900)** : ✅ ACCESSIBLE (confirmé par `nc -zv` et `mosquitto_pub`)
2. **IoT Agent BunkerM** : ✅ Reconfiguré pour Stellio (docker-compose.iot-agent.yml mis à jour)
3. **Stellio Pipeline** : ✅ DONNÉES VISIBLES (entities `urn:ngsi-ld:AirQualityObserved:*` dans Stellio)
4. **CrateDB** : ✅ 6 tables créées (etairqualityobserved, etweatherobserved, ettrafficflowobserved, etparkingspot, etnoiselevelobserved, etwaterqualityobserved)
5. **Grafana** : ✅ Dashboard "Smart City - Air Quality (CrateDB)" créé et opérationnel
6. **Keycloak OpenRemote** : ✅ Audience mapper 'openremote' configuré (claim `aud: ['openremote']` present)
7. **Git/Gitea** : ✅ Commits poussés (docker-compose.iot-agent.yml)
## Problèmes résolus
- Authentification Keycloak (audience mapper)
- Assets non visibles sur carte (parent_id lié aux racines de realm)
- Format location GeoJSON corrigé
### ⏳ En cours / À faire
1. **OpenRemote Assets (Tâche A)** : ❌ API retourne 405 Method Not Allowed malgré JWT correct
- 30 capteurs attendus (10 par broker: EMQX, Mosquitto, BunkerM)
- À créer dans 2 realms : `master` ET `smartcity-martinique`
- Problème : 405 sur `/api/{realm}/asset` (GET/POST)
- **Solution proposée** : Création via UI Web OpenRemote ou débogage API ultérieur
## Reste à faire
- Vérifier affichage carte (2 realms dans légende)
- Configurer simulateur SENSOR_COUNT=30
- Stabiliser services unhealthy (CrateDB-Stellio, MongoDB, etc.)
- ThingsBoard (config manquante)
2. **Simulateur** : ⏳ Configuration 30 capteurs
- Définir `SENSOR_COUNT=30` dans l'environnement du simulateur
- Les capteurs seront répartis : airquality, traffic, parking, noise, weather, light
3. **Grafana Dashboards (Tâche C)** : 🔄 À compléter
- ✅ AirQuality fait
- ⏳ TrafficFlow, Weather, Parking, Noise, Light à créer
### 🔴 Problèmes identifiés
1. **OpenRemote API 405** :
- JWT valide avec `aud: ['openremote', 'smartcity-realm', 'master-realm', 'account']`
- URL testées : `/api/master/asset`, `/api/smartcity-martinique/asset`
- Erreur persistante malgré audience mapper configuré
- **Action** : Vérifier logs Keycloak/OpenRemote ou utiliser UI Web
2. **BunkerM inaccessibilité passée** : Résolu - port 1900 accessible via Traefik
### 📊 Architecture validée
```
Simulateur (30 capteurs, 10 par broker)
Brokers MQTT (EMQX ✅, Mosquitto ✅, BunkerM ✅)
IoT Agents (EMQX→Orion-LD ✅, Mosquitto→Orion-LD ✅, BunkerM→Stellio ✅)
Context Brokers (Orion-LD ✅, Stellio ✅)
QuantumLeap → CrateDB (tables: 6 créées ✅)
Grafana (Dashboard AirQuality ✅, autres à faire 🔄)
```
### 🎯 Actions prioritaires prochaine session
1. **Résoudre OpenRemote API 405** (ou créer assets via UI)
2. **Créer 60 assets OpenRemote** (30 capteurs × 2 realms)
3. **Finaliser dashboards Grafana** (Traffic, Weather, etc.)
4. **Configurer `SENSOR_COUNT=30`** dans simulateur
5. **Mettre à jour documentation architecture** (après vérification Stellio complète)
### 🔐 Commandes utiles
## Commandes utiles
```bash
# Vérifier Stellio
docker exec smart-city-cratedb curl -s "http://stellio-api-gateway:8080/ngsi-ld/v1/entities?type=AirQualityObserved" -H "Accept: application/ld+json"
# Voir assets OpenRemote
docker exec openremote_postgresql_1 psql -U postgres -d openremote -c "SELECT id, name, realm FROM openremote.asset WHERE type='urn:openremote:agent:mqtt' LIMIT 5;"
# Vérifier CrateDB
docker exec smart-city-cratedb bash -c 'crash -c "SELECT * FROM quantumleap.etairqualityobserved LIMIT 5;"'
# Redémarrer si besoin
docker restart openremote-manager-1
# Test OpenRemote API (échoue encore avec 405)
curl -s "https://openremote.digitribe.fr/api/master/asset" -H "Authorization: Bearer <TOKEN>"
# Démarer simulateur avec 30 capteurs
cd ~/smart-city-digital-twin-martinique
SENSOR_COUNT=30 docker compose -f docker-compose.yml up -d simulator
# Vérifier map
open https://openremote.digitribe.fr/manager/#/assets
```
### 📦 Git Status
- Repo: `smart-city-digital-twin-martinique` sur `gitea.digitribe.fr/eric/`
- Dernier commit: `IoT Agents: suppression healthcheck + BunkerM configuré pour Stellio`
- Fichiers modifiés: `docker-compose.iot-agent.yml`
- Status: ✅ Poussé sur `origin/master`
---
*Session mise à jour: 2026-05-06 21:35 - Eric FELIXINE*