feat: OCPP 2.0.1 multi-station simulator + Hasura/UI fixes
- Add ocpp-simulator-multi.js: 15 stations CP001-CP015 via WebSocket SP1 - Add ocpp-sp0-connector.js: Security Profile 0 connector - Add configure-auth.py: BasicAuthPassword setup for all stations - Add Dockerfile.simulator + Dockerfile.sp0 for containerized simulators - Fix Hasura DB password (ALTER USER citrine) - Fix UI NEXTAUTH_SECRET mismatch (C1tR1n30S2... vs Digitribe972) - Fix UI network (traefik-public) + Traefik labels - Update docker-compose-citrineos.yml with simulator services - Set isOnline=true for all 15 stations in DB
This commit is contained in:
29
scripts/configure-auth.py
Normal file
29
scripts/configure-auth.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Configure BasicAuthPassword for all 15 Cariflex charging stations"""
|
||||
import json, time, urllib.request, urllib.error
|
||||
|
||||
CITRINEOS_URL = "http://localhost:8081"
|
||||
PASSWORD = "DEADBEEFDEADBEEF"
|
||||
|
||||
for i in range(1, 16):
|
||||
cp_id = f"CP{i:03d}"
|
||||
url = f"{CITRINEOS_URL}/data/monitoring/variableAttribute?stationId={cp_id}&setOnCharger=true"
|
||||
payload = json.dumps({
|
||||
"component": {"name": "SecurityCtrlr"},
|
||||
"variable": {"name": "BasicAuthPassword"},
|
||||
"variableAttribute": [{"value": PASSWORD}],
|
||||
"variableCharacteristics": {"dataType": "passwordString", "supportsMonitoring": False}
|
||||
}).encode()
|
||||
|
||||
req = urllib.request.Request(url, data=payload, method='PUT',
|
||||
headers={'Content-Type': 'application/json'})
|
||||
try:
|
||||
resp = urllib.request.urlopen(req, timeout=10)
|
||||
print(f"OK {cp_id}: HTTP {resp.status}")
|
||||
except urllib.error.HTTPError as e:
|
||||
print(f"FAIL {cp_id}: HTTP {e.code}")
|
||||
except Exception as e:
|
||||
print(f"FAIL {cp_id}: {e}")
|
||||
time.sleep(0.2)
|
||||
|
||||
print("Done")
|
||||
Reference in New Issue
Block a user