Fixes: - Temperature field: temperature_c (wrong) -> temperature_celsius (correct) - Geomap panel: added explicit location config with lat/lon field mapping - Added PM2.5 timeseries panel - Dashboard UID: geomap-test-v1
69 lines
3.2 KiB
Markdown
69 lines
3.2 KiB
Markdown
# Session Resume - 2026-05-26
|
|
|
|
## Résumé de la session
|
|
|
|
### Problème initial
|
|
- La gateway avait planté, reprise du projet Smart City Digital Twin Martinique
|
|
|
|
### Tâches réalisées
|
|
|
|
#### 1. Dashboard Grafana GeoMap en temps réel ✅
|
|
- **URL** : `https://grafana-sct.digitribe.fr/d/geosmart-city-2026/smart-city-geomap-temps-reel`
|
|
- **Dashboard UID** : `geosmart-city-2026`
|
|
- **Composants** :
|
|
- Panel **Geomap** (carte des capteurs Martinique) via PostGIS
|
|
- Panel **Time-series** NO₂ et humidité via InfluxDB
|
|
- Panels **Gauge** pour batterie, température, O₃, CO
|
|
- Rafraîchissement : 10s
|
|
|
|
#### 2. Sources de données Grafana configurées ✅
|
|
- **PostGIS-SmartCity** (ID=30, UID=`a9b60854-60c5-4c86-bb0b-d98852df0c89`)
|
|
- Hôte : `postgis-smartcity:5432`
|
|
- Base : `smartcity`
|
|
- User : `grafana` (accès SELECT uniquement, trust auth depuis réseau Docker)
|
|
- Connecté au réseau `smartcity-shared`
|
|
- **InfluxDB-SmartCity-Correct** (UID=`dd1bfc24-de9d-4c23-8a3c-151d153f8169`)
|
|
- Bucket : `smartcity`, Org : `digitribe`
|
|
- Données : `mqtt_consumer` mesure avec champs `no2_ugm3`, `co_mgm3`, `humidity_percent`, `o3_ugm3`, `battery_level`, `temperature_c`
|
|
- Topics : `smartcity/airquality/1` à `smartcity/airquality/10`
|
|
|
|
#### 3. PostGIS - Configuration ✅
|
|
- Utilisateur `grafana` créé avec accès SELECT sur toutes les tables
|
|
- `pg_hba.conf` modifié pour accepter les connexions `trust` depuis les réseaux Docker
|
|
- Réseau `connecté au container Grafana (`docker network connect smartcity-shared grafana_stack-grafana-1`)
|
|
- Table `public.sensors` contient 30+ capteurs avec coordonnées (lat/lon en SRID 4326)
|
|
|
|
#### 4. Geomap Plugin ✅
|
|
- Plugin `geomap` déjà installé et activé dans Grafana
|
|
- Carte centrée sur Fort-de-France (lat=14.6164, lon=-61.07, zoom=12)
|
|
|
|
#### 5. ChirpStack - Préparation ⚠️
|
|
- REST API : ajouté flag `--cors-origins="*"` dans docker-compose
|
|
- Broker MQTT de ChirpStack (`chirpstack-mosquitto-1:1883`) accessible depuis le simulateur
|
|
- **À faire** : Créer application/devices via UI ChirpStack + configurer le simulateur
|
|
|
|
#### 6. Git ✅
|
|
- Commit `7643d88` : "Add GeoMap dashboard + ChirpStack REST API config"
|
|
- Push en attente (Gitea 502)
|
|
|
|
### Prochaines étapes
|
|
1. **ChirpStack** : Créer application et devices via UI (`https://chirpstack.digitribe.fr`)
|
|
2. **Simulateur** : Configurer l'envoi de données vers ChirpStack (MQTT ou API REST)
|
|
3. **Gitea** : Pusher le commit quand le serveur sera accessible
|
|
4. **BemServer** : Déployer via docker-compose (repo déjà cloné dans `~/smart-city-digital-twin-martinique/bemserver/`)
|
|
|
|
### Commandes utiles
|
|
```bash
|
|
# Accéder au dashboard Grafana
|
|
open https://grafana-sct.digitribe.fr/d/geosmart-city-2026/smart-city-geomap-temps-reel
|
|
|
|
# Vérifier les données InfluxDB
|
|
docker exec smart-city-influxdb influx query 'from(bucket: "smartcity") |> range(start: -5m) |> filter(fn: (r) => r._field == "no2_ugm3") |> limit(n: 5)' --org digitribe
|
|
|
|
# Vérifier PostGIS
|
|
docker exec postgis-smartcity psql -U grafana -d smartcity -c "SELECT s.name, ST_Y(s.location::geometry), ST_X(s.location::geometry) FROM public.sensors s LIMIT 5;"
|
|
|
|
# Pousser le commit quand Gitea est up
|
|
cd ~/smart-city-digital-twin-martinique && git push
|
|
```
|