SparkSpark Platform
Field & Control Flows
EV Gateway Platform Field & Control Flows Spark EV Charger ← Console
Animated · interactive · updated 2026-07-30

How the Spark platform is operated in the field

Seven step-by-step, interactive animations of the flows that make the product work — local Bluetooth charging, power-panel setup, dynamic load management (with a live simulator you can drive), gateway repair, security-key rotation, and the all-important offline → OCPP CMS ingest. Every step maps to the live firmware, mobile app, and backend code. Type a URL, drag the breaker, toggle the panel — the diagrams react.

BLE — phone ⇄ gateway (local)
Data — MQTT · HTTPS · WS · OCPP-J
LAN — gateway ⇄ charger / node ⇄ router
Response — ack back to server
Building load — power-panel report
01
BLE-Op — local charging control
Operate a bay from the phone over Bluetooth, no internet.
02
Node Config — power-panel setup
Point a panel meter at the right gateway & DLM panel.
03
DLM — configure power sharing
Map chargers, breaker/buffer, live load, balance amps.
04
DLM simulator — drive it yourself
Change inputs & watch the split rebalance live.
05
Repair gateway (mobile)
Offline nodes → dormant → provision / factory reset.
06
Auth-key rotation & sync
Rotate, interim-on-online, and manual key issue.
07
Offline → OCPP CMS ingest ★
Buffer offline, replay, rebuild transactions, bill.
▶ Live Site Simulator — the whole system, interactive
One full-screen digital twin of a real site: mobile phone, gateway, Wi-Fi router, 5 chargers, power panels & nodes, MQTT broker, cloud server, database and OCPP CMS. Provision the fleet, balance power with DLM, go offline & buffer, then ingest to a CMS — all by tapping. No hardware required.
Chapters
1
BLE-Op — local charging control in the field
Phone ⇄ gateway over Bluetooth · works with no internet

A technician opens Local only mode, connects to the gateway over the BLE-Op service, and starts/stops a charger — even with no signal. Control commands are gated by the current auth key; the gateway relays them to the charger over the wired LAN.

MOBILE APP · BLE Ready tap play GATEWAY ESP32-S3 / RPi BLE-Op · aabb…cccc idle Bay 1Spark_0001 Bay 2Spark_0002 Bay 3Spark_0003
Step 0 / 7
2
Node Config — configuring a power-panel node
Point a panel meter at the right gateway, DLM panel & backend

The power-panel node measures the building’s live load. In Node config, the installer joins the node’s Wi-Fi, tells it which gateway and DLM panel number it belongs to, and connects it to the site router. After that the node firmware reports on its own — the phone drops out.

MOBILE APP Ready tap play POWER-PANEL NODE SparkPanel-PP-002 192.168.4.1 · softAP AP: SparkPanel-… GATEWAY (BLE MAC) Spark_gateway_… de:b4:d9:06:b8:61 SITE ROUTER Home / site Wi-Fi DHCP · internet CONSOLE BACKEND sparkadmin.duckdns.org POST /api/powerpanel/report
Step 0 / 7
3
DLM — configure dynamic power sharing (IoT mode)
Map chargers to panels · subtract live building load · balance amps

From the phone (online), the user assigns chargers to panels and sets each panel’s breaker/buffer. The backend auto-matches each DLM panel to its power-panel node (panel i ↔ node i+1), subtracts the live building load, and water-fills the remaining amps. Want to drive it yourself? See the simulator in Chapter 4.

MOBILE APP · DLM Ready tap play CONSOLE BACKEND · DLM ENGINE breaker − buffer − load water-fill allocation DLM engine Panel 2: 85 A POWER-PANEL NODE · #2 live building load panel #2 GATEWAY MQTT /cmd set_current → LAN C1Spark_0001 C2Spark_0002 C3Spark_0003
Step 0 / 8
4
DLM power-sharing simulator INTERACTIVE
Drag breaker/buffer · toggle the live panel · watch amps rebalance

This is the real allocation logic from dlm.js, running in your browser: every charger holds a 6 A minimum, the rest is water-filled, a live building load subtracts ⌈kW·1000/240⌉ A, and if there isn’t enough everyone is held at 6 A. Key point: the power-panel node is optional — turn it off and DLM still balances against your breaker/buffer alone. Change anything, or hit ▶ Play for a guided scenario.

Breaker (A)90
Buffer (A)5
Sharing mode
Live power-panel node
Chargers
Tip: turn the live panel ON, raise the load, and watch every charger taper together.
live · interactive
5
Repair gateway (from the mobile app)
Disable DLM → offline the nodes → dormant → provision / factory reset

“Repair gateway” safely resets a unit for re-provisioning. It first offers to turn DLM off (so a stale config isn’t enforced), takes every charger offline, waits for them to go dormant, then sends Provision or Factory reset and hands off to the provisioning screen. Progress shows as a live ✓/✗ log.

MOBILE APP · REPAIR Ready tap play GATEWAY ESP32-S3 / RPi repair target online Charger 1Spark_0001 Charger 2Spark_0002 Charger 3Spark_0003
Step 0 / 8
6
Auth-key rotation, interim issue & sync
Backend → gateway → phone · scheduled, interim-on-online, manual

BLE-Op is protected by a rotating key. The backend rotates the whole fleet on a schedule, issues an interim key the moment a new / factory-reset gateway comes online (30 s settle + retry), and offers a manual “Issue key” button for installers. The current key rides the live snapshot to the console and the mobile app, which presents it over BLE.

CONSOLE BACKEND authKeys.js rotate · interim · manual authKeys.js SUPABASE auth_key_events HIVEMQ BROKER TLS 8883 /cmd · /response GATEWAY NVS flash key NVS key APP / CONSOLE Ready tap play
Step 0 / 8
7
Offline → OCPP CMS ingest ★ INTERACTIVE
Buffer offline · replay on reconnect · rebuild transactions · bill

The most important flow. When a gateway loses internet, chargers keep working and every session is buffered to SD. On reconnect the gateway replays the buffer, and the backend rebuilds each session as real OCPP 1.6J transactions — backdated to when they happened — plus status/fault events, and streams them to your CMS with no double-billing. Type your CMS URL and pick a mode, then hit ▶ Start.

Charger 1Spark_0001 Charger 2Spark_0002 GATEWAY ESP32-S3 hub SD buffer (offline) online HIVEMQ TLS 8883 /offline_data CONSOLE BACKEND ocppIngest.js reconstruct + convert idle SUPABASE mqtt_events · ocpp_ingest_log OCPP CMS OCPP 1.6J ws · ocpp1.6 CMS URL
Step 0 / 10
Every step maps to live code — BLE-Op ble_home.dart + gateway processGatewayCommand(); node config node_config_page.dart + power_panel_node.ino; DLM dlm.js + powerPanel.js; repair repair_flow.dart; keys authKeys.js; ingest ocppIngest.js + offlineSessions.js. Standalone preview file — not yet wired into the console.