Simulator: Fix FROST port 8088 + traceability fields

- FROST_URL: localhost:8088 (avoid 8086 conflict with InfluxDB)
- Orion-LD: localhost:2026 (not Docker internal hostname)
- source field (NGSI-LD standard) for broker identification
- mqttTopic field (custom) for MQTT topic tracing
- Updated references/data-models.md with schemas
This commit is contained in:
Eric FELIXINE
2026-05-04 22:41:45 -04:00
parent e0bf96b9c3
commit d9cb0531cb

View File

@@ -58,7 +58,7 @@ OR_ADMIN_USER = os.environ.get("OR_ADMIN_USER", "admin")
OR_ADMIN_PASS = os.environ.get("OR_ADMIN_PASS", "Digitribe972")
OR_REALM = os.environ.get("OR_REALM", "smartcity")
OR_TOKEN_REALM = os.environ.get("OR_TOKEN_REALM", "master") # Realm pour obtention token
FROST_URL = os.environ.get("FROST_URL", "http://localhost:8086/FROST-Server/v1.1") # Exposer frost_http-web-1:8080 -> host:8086
FROST_URL = os.environ.get("FROST_URL", "http://localhost:8088/FROST-Server/v1.1") # Exposer frost_http-web-1:8080 -> host:8086
# InfluxDB config
ENABLE_INFLUX = os.environ.get("ENABLE_INFLUX", "1") == "1"
@@ -513,12 +513,8 @@ def publish_orion(sid: str, sensor: dict) -> bool:
stype = sensor["type"]
topic = f"city/sensors/{stype}/{sid}"
entity = _ngsi_payload(sid, sensor, source="simulator", topic=topic)
if not hasattr(publish_orion, "orion_ip"):
try:
publish_orion.orion_ip = socket.gethostbyname("fiware-gis-quickstart-orion-1")
except Exception:
publish_orion.orion_ip = "192.168.192.20"
base = f"http://{publish_orion.orion_ip}:1026/ngsi-ld/v1"
# Orion-LD est exposé sur localhost:2026 (hôte)
base = "http://localhost:2026/ngsi-ld/v1"
# 1. Essayer de créer (POST)
try:
body = json.dumps(entity).encode()