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()