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:
10
simulator.py
10
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_ADMIN_PASS = os.environ.get("OR_ADMIN_PASS", "Digitribe972")
|
||||||
OR_REALM = os.environ.get("OR_REALM", "smartcity")
|
OR_REALM = os.environ.get("OR_REALM", "smartcity")
|
||||||
OR_TOKEN_REALM = os.environ.get("OR_TOKEN_REALM", "master") # Realm pour obtention token
|
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
|
# InfluxDB config
|
||||||
ENABLE_INFLUX = os.environ.get("ENABLE_INFLUX", "1") == "1"
|
ENABLE_INFLUX = os.environ.get("ENABLE_INFLUX", "1") == "1"
|
||||||
@@ -513,12 +513,8 @@ def publish_orion(sid: str, sensor: dict) -> bool:
|
|||||||
stype = sensor["type"]
|
stype = sensor["type"]
|
||||||
topic = f"city/sensors/{stype}/{sid}"
|
topic = f"city/sensors/{stype}/{sid}"
|
||||||
entity = _ngsi_payload(sid, sensor, source="simulator", topic=topic)
|
entity = _ngsi_payload(sid, sensor, source="simulator", topic=topic)
|
||||||
if not hasattr(publish_orion, "orion_ip"):
|
# Orion-LD est exposé sur localhost:2026 (hôte)
|
||||||
try:
|
base = "http://localhost:2026/ngsi-ld/v1"
|
||||||
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"
|
|
||||||
# 1. Essayer de créer (POST)
|
# 1. Essayer de créer (POST)
|
||||||
try:
|
try:
|
||||||
body = json.dumps(entity).encode()
|
body = json.dumps(entity).encode()
|
||||||
|
|||||||
Reference in New Issue
Block a user