From d9cb0531cb3b2e50f61b735e94fdd823ba3f54fb Mon Sep 17 00:00:00 2001 From: Eric FELIXINE Date: Mon, 4 May 2026 22:41:45 -0400 Subject: [PATCH] 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 --- simulator.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/simulator.py b/simulator.py index 3ac9c0db..dda3c895 100644 --- a/simulator.py +++ b/simulator.py @@ -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()