🛡 Transit Guardian Admin

Admin
No physical device? Use Demo Mode to stream realistic sensor data through all systems.

Registered Transit Guardians

0 devices registered

📦

No devices registered yet.
Go to Add / Setup to register a Transit Guardian.

Register a New Transit Guardian

Each physical unit must be registered here. A unique user code is generated automatically — give this code to the recipient so they can monitor their specific device.

💡 A unique 8-character user code will be generated automatically. Share this code with the device owner so they can monitor their specific Transit Guardian.

Per-Device Setup Checklist

Complete these steps for each physical unit before shipping.

  1. Flash the Transit Guardian firmware to the Heltec WiFi LoRa 32 board (see Build Guide).
  2. Power on the device and connect to its setup AP (TransitGuardian-SETUP).
  3. Open 192.168.4.1 in a browser and enter the destination WiFi credentials.
  4. Note the device's local IP address once it joins the network (shown on the OLED display).
  5. Enter that IP in the Device WiFi URL field above and register the device.
  6. Test all sensors from the Transit Hub live view (Connect → verify telemetry).
  7. Calibrate the shock threshold if needed via the device web interface.
  8. Insert a formatted microSD card (FAT32, ≤32 GB) into the device.
  9. Label the physical unit with the generated user code and the owner's name.
  10. Pack securely and share the user code with the recipient.

📶 Meshtastic Node Auto-Setup Wizard

Use this wizard to configure a new Meshtastic node for use with Transit Guardian. Connect the node via USB or BLE, then follow each step. For full configuration, open the Meshtastic tab.

1
Flash Meshtastic Firmware
Download and flash Meshtastic firmware to your node using the official flasher. Supported hardware: Heltec LoRa 32 V3, T-Beam, T-Echo, RAK4631, and more.
🔗 flasher.meshtastic.org
2
Connect Node via USB or BLE
Connect the freshly-flashed node via USB (Chrome / Edge) or power it on for BLE. Go to the 📶 Meshtastic tab and click Connect via Serial (USB) or Connect via BLE (Bluetooth).
3
Set Region & LoRa Frequency
In the Meshtastic web client, navigate to Config → LoRa. Set Region to your location (US, EU, ANZ, etc.). Default channel: slot 20 / 906.875 MHz (US) or slot 16 / 869.5 MHz (EU).
4
Configure Node Name & Channel
Set the node's long name (e.g. "TG-Unit-07") and short name (e.g. "TG07") under Config → Device. Set the channel to match your mesh network (use the same PSK on all Transit Guardian nodes).
5
Enable WiFi (optional)
For HTTP monitoring, enable WiFi under Config → Network. Set SSID + password for the deployment network. The node will display its IP on the OLED — enter this in the Device WiFi URL field when registering above.
6
Configure MQTT (optional)
For cloud uplink, configure MQTT under Config → MQTT. Use mqtt.meshtastic.org (public) or your own broker. Enable "Map Reporting" to see your nodes on the mesh map.
7
Register & Test
Register the node in the Add / Setup form above. Go to 📨 Broadcast tab, connect to the node, and send a test message. Verify it appears in the 📜 Activity Log.
📡 Meshtastic uses the Web Bluetooth API (BLE) and Web Serial API (USB) — both require Chrome or Edge. Firefox and Safari are not supported for direct connection.

🛒 Bill of Materials

Parts required to build one Transit Guardian unit.

Component Specification / Part # Qty Notes
Main Board Heltec WiFi LoRa 32 V3 (ESP32-S3 + SX1262) 1 Built-in OLED, LoRa, WiFi, BLE
IMU (Shock/Tilt) MPU-6050 (GY-521 breakout) 1 I²C: SDA=21, SCL=22
Barometric / Temp BMP280 or BMP388 breakout 1 I²C shared bus
Light Sensor LDR (GL5537) + 10 kΩ resistor (voltage divider) 1 Analog → GPIO 35
Reed Switch (Tamper) Normally-Closed reed switch 1 Digital input, pull-up → GPIO 32
Sound Sensor KY-037 or MAX4466 microphone module 1 Digital out → GPIO 33; analog optional
microSD Module SPI microSD card adapter 1 SPI: CS=5, MOSI=23, MISO=19, SCK=18
Battery LiPo 3.7 V 2000 mAh (JST-PH 2-pin) 1 Connected to Heltec BAT pin
LoRa Antenna 868/915 MHz 2 dBi stub (SMA) 1 Must attach before power-on
Enclosure IP54 ABS project box ≥80×60×35 mm 1 Drill holes for antenna, USB, OLED window
microSD Card Class 10 / U1, ≤32 GB, FAT32 formatted 1 Included with device
Misc. Jumper wires, 2.54 mm headers, hot glue, foam padding

🔌 Wiring Diagram (GPIO Pin Map)

Heltec WiFi LoRa 32 V3 pin assignments
───────────────────────────────────────
I²C Bus (shared):
  SDA  → GPIO 21
  SCL  → GPIO 22
  Devices: MPU-6050 (addr 0x68), BMP280 (addr 0x76)

SPI Bus (microSD):
  CS   → GPIO  5
  MOSI → GPIO 23
  MISO → GPIO 19
  SCK  → GPIO 18

Analog:
  LDR voltage divider → GPIO 35 (ADC1_CH7)

Digital:
  Reed switch (NC, pull-up) → GPIO 32
  Sound sensor (digital)    → GPIO 33

Power:
  3.3 V rail → MPU-6050 VCC, BMP280 VCC, LDR top, KY-037 VCC
  GND        → all GND pins
  LiPo 3.7 V → Heltec BAT connector (JST-PH)
⚠️ Always attach the LoRa antenna BEFORE powering on the Heltec board. Operating without an antenna can damage the SX1262 RF front-end.

🔧 Step-by-Step Assembly

Phase 1 – Prepare Components

1

Inspect all components. Verify the Heltec board is a V3 (ESP32-S3). Check that the OLED display connector is seated.

2

Solder male headers to the MPU-6050 and BMP280 breakouts if not pre-soldered.

3

Build the LDR voltage divider: wire the LDR from 3.3 V to the mid-point, the 10 kΩ resistor from the mid-point to GND, and connect the mid-point to GPIO 35.

4

Format the microSD card as FAT32 on your computer before inserting it.

Phase 2 – Wiring

5

Connect MPU-6050: VCC→3.3 V, GND→GND, SDA→GPIO 21, SCL→GPIO 22. Leave AD0 floating (addr 0x68).

6

Connect BMP280: VCC→3.3 V, GND→GND, SDA→GPIO 21, SCL→GPIO 22, SDO→GND (addr 0x76).

7

Connect microSD module: VCC→3.3 V, GND→GND, CS→GPIO 5, MOSI→GPIO 23, MISO→GPIO 19, SCK→GPIO 18.

8

Connect reed switch: one leg to GPIO 32, other leg to GND. Enable the internal pull-up in firmware so the pin reads HIGH when the magnet is present and LOW when removed (tamper).

9

Connect KY-037 sound sensor: VCC→3.3 V, GND→GND, D0 (digital)→GPIO 33. Adjust the onboard trimpot to set the sound threshold.

10

Plug in the LiPo battery to the Heltec JST-PH BAT connector.

Phase 3 – Firmware

11

Install Arduino IDE 2.x and add the Heltec ESP32 board package:
https://resource.heltec.cn/download/package_heltec_esp32_index.json

12

Install required Arduino libraries via Library Manager: Heltec ESP32 Dev-Boards, MPU6050 (ElectronicCats), Adafruit BMP280, SD (built-in), ArduinoJson, ESPAsyncWebServer, AsyncTCP.

13

Open the Transit Guardian sketch. Set your UNIT_ID and LORA_FREQUENCY constants at the top of the file (915 MHz for US, 868 MHz for EU).

14

Select Board: Heltec WiFi LoRa 32(V3) in Arduino IDE. Connect via USB-C. Select the correct port. Upload.

15

Watch the Serial Monitor (115200 baud). Verify "MPU-6050 OK", "BMP280 OK", "SD OK", "LoRa OK", "WiFi AP started" messages on boot.

Phase 4 – WiFi Configuration

16

On first boot the device creates a setup access point. Connect your phone/laptop to the WiFi network named TransitGuardian-SETUP (no password).

17

Open http://192.168.4.1 in your browser. Enter the destination network's SSID and password, then click Save.

18

The device reboots, joins the target WiFi, and displays its IP on the OLED. Note this IP — it becomes the Device WiFi URL you register above.

Phase 5 – Validation & Packaging

19

Open the Transit Hub, enter the device's IP, click Connect. Confirm all 6 sensor readings update in real time.

20

Physically shake the device and verify a COMPROMISED/WATCH shock event appears in the incident log.

21

Remove the magnet from the reed switch and verify a tamper event is logged.

22

Mount all components inside the enclosure with foam padding on all sides. Secure the antenna externally via the SMA bulkhead.

23

Apply a label inside the lid showing the unit ID, user code, and emergency contact email.

✅ Device is build-complete. Register it in the Add / Setup tab and share the generated user code with the recipient.

📋 Firmware Configuration Reference

Key constants to configure at the top of the Transit Guardian Arduino sketch.

// ── Transit Guardian Firmware Config ──────────────────
const char* UNIT_ID        = "TG-00000001"; // unique per device
const char* LORA_BAND      = "915E6";       // US: 915E6 | EU: 868E6
const int   SHOCK_G_THRESH = 2;             // trigger at 2g acceleration
const int   SOUND_THRESH   = 80;            // dB-equivalent trimpot level
const int   LOG_INTERVAL   = 5000;          // log every 5 s (ms)
const int   TELEMETRY_INT  = 2000;          // broadcast LoRa every 2 s
const char* SETUP_AP_PASS  = "";            // leave blank = open AP
// ─────────────────────────────────────────────────────

🔑 Change Admin Password

The admin password is stored as a SHA-256 hash in this HTML file. To change it:

  1. Enter your new password below and click Compute Hash.
  2. Copy the resulting hash.
  3. Open transit-guardian-admin.html in a text editor.
  4. Find the constant HASH_HEX in the <script> section.
  5. Replace its value with the new hash (keep the surrounding quotes).
  6. Save and deploy the file.

🗑 Data Management

Device registrations are stored in your browser's localStorage. This data is local to this browser. Export regularly to keep a backup.

ℹ️ About This Panel

Transit Guardian Admin v1.0 — © 2008-2026 Barbrick Design
Manage and monitor all Transit Guardian units from one password-protected page.
Device data is stored locally in localStorage — no cloud storage required.

⚠️ Bluetooth & Serial APIs require Chrome or Edge. Your current browser does not support Web Bluetooth or Web Serial. HTTP connection to WiFi nodes will still work in any browser.
Not connected — choose a connection method below

Connect to Node

Connects to a Meshtastic node over Bluetooth Low Energy (BLE). Requires Chrome or Edge on a BLE-capable device. The node must be powered on and within ~10 m range.

Connects to a Meshtastic node plugged in via USB. Requires Chrome or Edge. Default baud rate: 921600. The node must be running Meshtastic firmware 2.x.

Connects to a Meshtastic node over its WiFi HTTP API. The node must have WiFi configured and be on the same network. Works in all browsers but may be blocked by CORS on some firmware versions.

💡 If the node returns a CORS error, use the which runs on the same origin.

Connects via WebSocket to Meshtastic TCP port 4403. WiFi must be configured on the node. Enter only the IP — port 4403 is added automatically.
⚠️ HTTPS pages block ws:// (mixed content) — if blocked, open this admin page via HTTP or use a local WebSocket proxy.

💡 TCP/WebSocket unlocks the full pro-level feature set: raw packet streaming, multi-client simultaneous connections, autonomous agent control, and fleet management. Pre-configured for AgentR2 (ntR2 · Heltec V3 · Node# 2658568012).

Mesh Network Nodes

Nodes discovered through BLE/Serial/HTTP connection appear here. Registered Transit Guardian devices are shown with their registration status.

Node ID Name SNR / RSSI Battery Last Heard Registration
No nodes discovered yet — connect to a node to see the mesh.

📡 Radio & Network Configuration Reference

Key settings for all Transit Guardian mesh nodes. Configure via the Meshtastic web client.

SettingRecommended ValueLocation in Client
RegionUS (or your country)Config → LoRa
Modem PresetLONG_FASTConfig → LoRa
Frequency Slot20 (US 906.875 MHz)Config → LoRa
Hop Limit3Config → LoRa
Tx Power30 dBm (max legal)Config → LoRa
Device RoleROUTER_CLIENTConfig → Device
Node Long NameTransit-Guardian-XXConfig → Device
Node Short NameTGxxConfig → Device
WiFi ModeClient (join network)Config → Network
MQTT Servermqtt.meshtastic.org (optional)Config → MQTT
Map ReportingEnabledConfig → MQTT
📖 Meshtastic Network Docs
Not connected — go to 📶 Meshtastic tab to connect

📨 Send Broadcast Message

Sends a text message to ALL nodes on the mesh network (broadcast address 0xFFFFFFFF). The message will be relayed by all nodes within range.

💡 For guaranteed delivery or DM to specific nodes, use the which supports all channel types and acknowledgements.

Message History

No messages yet

📜 Activity Log

Persistent log of all admin actions, node connections, messages, and errors. Stored in your browser's localStorage (up to 500 entries).

Level:
Source:
No log entries yet

AGENTR — Root Orchestrator

Authority: SUPREME (Level 999) · Role: Root Orchestrator

Scope: All Systems · Foundation: Peace

Email: BarbrickDesign@gmail.com

Active — Monitoring Transit Guardian
🏛️ AgentR is the main orchestrator for this entire repository — with supreme authority (Level 999) over all projects, agents, and systems. On this page AgentR monitors Transit Guardian health, coordinates with AgentR2 (MeshNode Orchestrator), and logs all orchestration activity to the Activity Log (filterable by source).

🩺 System Health Monitor

Status
Initializing…
Overall system
AgentR2 Link
MeshNode Orchestrator
Log Entries
0
Total in session
Devices
0
Registered nodes
Threats
0
Active anomalies
Last Check
Auto every 30 s

📋 AgentR Orchestration Log

Live feed of AgentR orchestration events. All entries are simultaneously written to the where you can filter by source or level.

AgentR is initializing…

⚡ Quick Actions

🩺
Health Check
Scan all Admin systems
Enhancement Scan
Identify improvement areas
🔗
Sync AgentR2
Coordinate with MeshNode
📜
Full Activity Log
All system events

ntR2

Node ID: !976874c · HW: HELTEC_V3

Node#: 2658568012 · Role: CLIENT

SNR: 6.25 dB · RSSI: -38 dBm

Not connected via TCP

🔌 TCP / WebSocket Direct Connection

Connect directly to your Heltec V3 (ntR2) via WebSocket on port 4403. WiFi must be enabled on the node. If this page is served over HTTPS, browsers block non-TLS WebSocket connections — in that case use the HTTP tab or the official Meshtastic web client.

💡 TCP is the pro-grade connection mode. Unlike BLE or USB, TCP allows multiple simultaneous clients, LAN/WAN access, raw packet streaming, autonomous agent control, OTA updates, and fleet management — all without touching the hardware.

⚙️ Remote Control Plane

Send commands to the connected node from anywhere on the network. Requires an active connection in any tab (TCP, BLE, Serial, or HTTP).

📥
Fetch Full Config
Request complete node configuration and info dump
🔄
Remote Reboot
Reboot node in 2 s via AdminMessage protobuf
📡
Broadcast Message
Send text to all mesh nodes (→ Broadcast tab)
🌐
Full Web Client
Open official Meshtastic client (full config editor)
📊
Refresh Telemetry
Poll node for latest metrics → Telemetry tab
🗺️
View Mesh Map
Show discovered node topology → Map tab
🔬
Packet Analyzer
Live packet stream + intrusion detection
📈
Export Telemetry
Download all telemetry history as CSV

📡 LoRa Parameter Tuning

Adjust LoRa radio settings for ntR2. Changes are queued and applied on next Admin-capable connection. Best-practice values for the Heltec V3 are pre-filled.

⚠️ LoRa config changes require a full Admin protobuf session. Currently these are queued and logged. For live application use the Meshtastic web client or CLI.

🚀 OTA Firmware & Config Push

⬆️ Push Firmware Update (OTA)

Initiate an OTA update via WiFi. Your Heltec V3 (ntR2) supports OTA once TCP/WiFi is active. Use the Meshtastic flasher or the web client OTA feature.

🔗 Meshtastic Flasher

📋 Push Channel Set URL

Generate and distribute a channel configuration to all nodes in the mesh.

🧬 Autonomous Monitoring Config

AgentR2 continuously monitors the mesh, detects anomalies, and alerts in the Packet Analyzer tab and Activity Log. Configure thresholds below.

Live data from ntR2 (!976874c · HELTEC_V3)
Last update:

📡 Signal Quality

SNR
6.25 dB
Signal-to-Noise Ratio
RSSI
-38 dBm
Received Signal Strength
Battery
Charge Level
Node Number
2658568012
0x9E76874C
Role
CLIENT
Device role in mesh
First Heard
12h ago
Time on mesh

🛰️ GPS / Position

Latitude
Longitude
Altitude
Ground Speed
Waiting for GPS position data…

🌡️ Environment Sensors

Temperature
Humidity
Pressure
Air Quality
💡 Environment sensors require the Telemetry module enabled in Meshtastic config (Config → Modules → Telemetry) with sensor plugins active.

📊 Session Statistics

Nodes Seen
1
Unique nodes heard
Packets RX
0
Received this session
Packets TX
0
Sent this session
Threats
0
Anomalies detected
Live topology — 0 nodes discovered
No nodes discovered — connect to a node to build the map
🟢 AgentR2 / Orchestrator 🔵 Good signal (SNR > 0 dB) 🟠 Weak signal (SNR < 0 dB) Line opacity = signal quality

📋 Node Registry

Node ID Name SNR RSSI Battery Last Heard Status
No nodes discovered — connect to a node to see the mesh

🛡️ Mesh Guardian — Intrusion Detection

Monitoring active — no threats detected
No threats detected
🛡️ AgentR2 detects: packet flooding (>20 pkts/min from one node), unknown nodes (not in device registry), and signal anomalies (SNR/RSSI below configured thresholds). All alerts also appear in the Activity Log.

🔬 Live Packet Stream

All packets received via the active connection are captured in real time. Capture begins automatically when any connection is established.

0 captured · RX 0 · TX 0
Filter:
Time Dir From To Type Content
No packets captured yet — connect to a node to begin capture

📊 Per-Node Traffic Analysis

Packet counts and message rates per source node this session.

Node ID Packets Messages Rate (pkt/min) Status
No traffic data yet
🧠
ML Intelligence Engine
In-browser streaming anomaly detection · No external dependencies
Initializing…

📊 Live Anomaly Scores

Each metric is independently scored using Exponentially Weighted Moving Average (EWMA) baseline learning. Score > 2.5σ triggers a warning; > 4σ triggers a critical alert. Baselines update continuously from live or demo data.

SNR Anomaly Score
Baseline: learning…
RSSI Anomaly Score
Baseline: learning…
Battery Anomaly Score
Baseline: learning…
Temperature Anomaly Score
Baseline: learning…
Shock Anomaly Score
Baseline: learning…
Samples Processed
0
Total data points ingested

🔮 Predictive Analytics

Linear regression on the last 20 data points per metric. Predicts values 5 samples ahead. Requires ≥ 10 data points per metric to activate.

Battery Life Estimate
Drain rate: learning…
SNR in 5 Readings
Trend: learning…
RSSI in 5 Readings
Trend: learning…
Composite Risk Score
Weighted anomaly composite

⚠️ ML Anomaly Timeline

No anomalies detected — feed data via Demo Mode or a live device connection

ℹ️ How the ML Engine Works

Algorithm: Exponentially Weighted Moving Average (EWMA) with Bollinger-Band-style anomaly scoring. Each telemetry stream independently maintains a rolling mean (μ) and variance (σ²) using a configurable learning rate α. A new sample is scored by its deviation from μ in units of σ.

Anomaly Threshold: Score > 2.5σ = warning; > 4.0σ = critical. Thresholds configurable in the 🤖 AgentR2 tab.

Predictions: Linear regression (Ordinary Least Squares) on the last 20 samples per metric, projected 5 steps forward. Battery life estimate uses drain-rate extrapolation to 0%.

No External Libraries: Pure JavaScript — no TensorFlow, no Python backend, no network calls. Runs entirely in your browser with zero latency.

Learning Rate (α): SNR/RSSI α=0.15, Battery α=0.05 (slower — battery changes gradually), Temperature α=0.10, Shock α=0.20 (faster — sudden events matter).