Live telemetry lands in the active twin data directory, not in the curated twin store by default.
POST /api/live/events accepts source-neutral events. The live ingest,
streaming, discovery, gateway/device control, history, and export routes are
open by default — VEIL is local-first, so live telemetry works with zero
setup on a machine you run yourself. The server logs a one-time warning when it
serves the live API without a token.
If you publish a VEIL twin to the web, set a token. Without one, anyone who
can reach the server can inject telemetry or control your gateways. Configure it
with either VEIL_LIVE_TOKEN or a gitignored token file at data/.live_token
for the active twin data directory (a repo-root .live_token is also supported
as a fallback for older local checkouts). Once a token is set, every live route
requires it — send it as Authorization: Bearer <token>,
X-VEIL-Live-Token: <token>, or ?token=<token>. The viewer prompts for it
once and remembers it.
openssl rand -hex 16 > data/.live_token # generate and require a token{
"schema": "veil.live.v1",
"kind": "position",
"device_id": "!abcd1234",
"label": "Dog",
"observed_at": "2026-06-20T18:22:41Z",
"position": {
"lat": 40.1234567,
"lon": -74.1234567,
"alt_m": 103.4,
"accuracy_m": null
},
"motion": {
"speed_mps": 2.1,
"heading_deg": 84
},
"link": {
"gateway_id": "!11223344",
"snr_db": 8.5,
"rssi_dbm": -92,
"hops": 0
},
"source": {
"protocol": "meshtastic",
"transport": "bluetooth"
}
}Supported kind values are position, message, data, status, media,
and command. General payloads can use message, data, payload,
metadata, or media.
Meshtastic TELEMETRY_APP packets are logged as status events with the full
decoded telemetry payload in data.telemetry. Common device battery/radio
metrics are also copied to data.battery, including battery_level_pct,
voltage_v, uptime_seconds, channel_utilization_pct, and
air_util_tx_pct when the tracker sends them.
Other routes:
GET /api/live/latestreturns registered gateways and latest device state. By default it returns only devices you have configured/named; pass?discovery=1to include all observed Meshtastic nodes from the gateway's node database.GET /api/live/streamstreams Server-Sent Events.POST /api/live/gatewaysregisters a gateway device.POST /api/live/gateways/restartstarts/restarts a registered gateway bridge.POST /api/live/gateways/stopstops a gateway bridge but keeps the registration.POST /api/live/gateways/removestops and removes a gateway registration.POST /api/live/deviceschanges a device display label or visibility.POST /api/live/devices/commandqueues a command through a registered gateway bridge. Supported commands arerequest_positionandtraceroute.GET /api/live/dayslists recorded telemetry days.GET /api/live/history?date=YYYY-MM-DDreturns a day's events.POST /api/live/exportappends a day or snapshot intotwin.gpkg.
The server writes:
data/live/events.jsonlfor the recent raw stream.data/live/daily/YYYY-MM-DD.jsonlfor recent day replay.data/live/commands/GATEWAY.jsonlfor gateway command queues.data/live/telemetry.sqliteas the separate replay database.data/live/registry.jsonfor gateway/device UI preferences.
The JSONL files rotate before unbounded growth. Tune VEIL_LIVE_JSONL_MAX_BYTES,
VEIL_LIVE_JSONL_GENERATIONS, VEIL_LIVE_COMMAND_JSONL_MAX_BYTES,
VEIL_LIVE_COMMAND_JSONL_GENERATIONS, VEIL_LIVE_LATEST_MAX_LINES,
VEIL_LIVE_HISTORY_MAX_LINES, and the corresponding *_TAIL_MAX_BYTES values
when a larger or smaller recent replay window is needed.
The live stream does not write every location into twin.gpkg. Use the
Telemetry replay bar's Append to twin store button when a day or snapshot is
worth materializing for later querying.
The MCP server also exposes live telemetry directly to models:
live_telemetry_snapshotreads current gateways, bridge status, devices, latest positions/messages, and freshness.live_telemetry_historyreads raw events fromdata/live/telemetry.sqlite.live_telemetry_store_summarysummarizes days, counts, devices, and exports.discover_live_connections,manage_live_gateway, andmanage_live_deviceexpose the same gateway/device management path as the UI.export_live_telemetry_to_twinmaterializes selected live events aslive_deviceentities intwin.gpkg.
The normal path is the viewer UI:
- Start VEIL with
npm start. - Open the
Telemetrypanel under Ask G.A.I.A. - In
Telemetry > Meshtastic / LoRa, enter a gateway name. - Pick Bluetooth, Serial, or Internet.
- For Bluetooth or Serial, click
Scan/Refreshand choose the discovered device from the dropdown. If discovery finds exactly one device, the UI can use it automatically. You can still paste a Bluetooth address or serial port manually. - For Internet, enter the Meshtastic TCP host or URL.
- Click
Register & Connect Gateway.
That UI request writes the gateway registration and asks server.js to start a
managed scripts/live/meshtastic_serial_bridge.py process using
.venv-live/bin/python. Incoming tracker packets then appear under
Registered Gateway Device: <name> after the tracker has been named/added.
Use Discovery mode in the live panel to inspect other observed Meshtastic
nodes, then Add only the devices you want shown on the map/key in normal
Configured mode.
For Meshtastic packets, source.transport is the radio path (lora). The
computer-to-gateway connection is recorded separately as
source.ingress_transport (bluetooth, serial, or internet). The gateway
radio itself is filtered out of the tracked-device list when its Meshtastic node
id can be detected; for BLE, the bridge also derives that node id from the
Bluetooth address as a fallback.
Use Remove Gateway to stop that gateway bridge and remove its current child
devices from the live menu. Use a device row's Remove button to clear just
that tracked device from the configured live registry; it will not reappear on
the normal map/key unless you add it again. Raw event logs and discovery-mode
observations remain in the rotated JSONL window and the SQLite telemetry store.
Use a device row's Fix button to request a Meshtastic position response from
that tracker. VEIL sends the command to the already-connected gateway bridge
(Bluetooth, serial, or internet); the gateway relays a LoRa POSITION_APP
request to the tracker with wantResponse=True. This is not a direct Bluetooth
connection from the computer to the tracker. The request cannot guarantee a new
GPS lock: sleeping nodes, out-of-range nodes, device configuration, or missing
GPS signal can still produce no response or only a last-known position.
Install/update the live bridge dependencies:
python3 -m venv .venv-live
. .venv-live/bin/activate
pip install -r requirements-live.txtThe server uses .venv-live/bin/python automatically. Override it with
VEIL_LIVE_PYTHON=/path/to/python if needed.
If the live server uses an environment token, run manual bridge/replay commands
with the same VEIL_LIVE_TOKEN or pass --token <token>. Managed bridges
started by server.js receive the configured live token automatically.
The terminal commands below are optional debug/manual mode. They are not required for normal UI registration.
Bluetooth gateway:
python3 scripts/live/meshtastic_serial_bridge.py \
--transport bluetooth \
--address AA:BB:CC:DD:EE:FF \
--gateway-name "Field gateway" \
--registerSerial gateway:
python3 scripts/live/meshtastic_serial_bridge.py \
--transport serial \
--port /dev/ttyUSB0 \
--gateway-name "USB gateway" \
--registerTCP/IP gateway:
python3 scripts/live/meshtastic_serial_bridge.py \
--transport internet \
--host 192.168.1.42 \
--gateway-name "Network gateway" \
--registerRun a demo stream:
python3 scripts/live/replay_demo.py --count 120 --interval 1