Commit Graph

9 Commits

Author SHA1 Message Date
kitadmin 8ea704f7e3 fix: use ingest HTTP API instead of direct Postgres for VPS telemetry; cache speedtest results per interface
- hub/server.py: replace psycopg2 Postgres connection with urllib HTTP call to
  ingest /api/devices endpoint (fleet Postgres is Docker-internal, not reachable
  from the VPS directly)
- telemetry-synology.sh: run_speedtest() now writes per-interface cache files
  (speedtest-result-<iface>); _cached_speedtest() reads cache if < 35 min old;
  _collect_wan() uses cached result so throughput shows in telemetry without
  blocking every 1-min cycle

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-23 03:06:08 +00:00
kitadmin 8a648dc637 feat: smart WAN role detection, aiwanbal integration, speedtest support
- Auto-detect cellular vs fiber/Starlink regardless of physical port:
  aiwanbal modem_type → Eyeride subnet (192.168.10.x) → gateway patterns
- Integrate aiwanbal/SmartAiBalancer state as primary data source when
  available (fresh <120s); fall back to self-collected ping metrics
- Add carrier detection: AT&T for fiber gateways, Eyeride for cellular
- Add run_speedtest() with speedtest-cli/iperf3/curl download fallback
- Extract jitter (mdev) from ping output for richer metrics
- Consistent canonical GL format: modem_0001=cellular, wan=ethernet/fiber

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 02:29:49 +00:00
kitadmin 8dba04a1d0 fix: auto-detect WAN roles — cellular vs fiber
- Detect Eyeride cellular interface by checking 192.168.10.x subnet
- Map correctly: ethernet/fiber → wan, Eyeride 5G → modem_0001
- Add carrier detection: AT&T for fiber gateways, Eyeride for cellular
- Fix sel_primary: fiber is active by default unless cellular route exists
- Fixes console showing 'on cellular' when actually on AT&T fiber

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 02:19:18 +00:00
kitadmin 58ac96fd3c fix: prevent double-ping fallback corrupting WAN metrics
- sudo ping returns exit 1 on any packet loss, which triggered the
  || fallback to direct ping, causing duplicate output concatenation
- Now check exit code explicitly: only fall back on exit >= 2 (real error)
- Fixes loss_pct showing 100100 instead of 100 on failed WANs

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 02:10:35 +00:00
kitadmin 91373df27d fix: sanitize newlines in telemetry output for valid JSON
- ipgeo_gps: pipe curl output through tr -d to strip newlines
- _ping_iface: pipe printf output through tr -d for newline safety

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 01:57:56 +00:00
kitadmin db04341f7c feat: unified fleet telemetry — canonical format, GPS/IP geo, WAN health dashboard
- Rewrite telemetry-synology.sh: canonical GL format (modem_0001/wan keys),
  self-contained metrics (no aiwanbal), Eyeride GPS with IP geo fallback
- Add /api/fleet-telemetry to hub: joins tunnel status with fleet Postgres
- Update dashboard.html: per-device WAN health bars, GPS, signal strength
- Fix hub/ingest.sh normalisation: remap old wan1/wan2 → modem_0001/wan
- Bump SPK version: 0.1-0001 → 0.5.0-0001 for GL parity

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 01:47:02 +00:00
kitadmin 8bd157b0de fix: GL wizard indentation + balancer depends on kit-connect
- GL connect-wizard.sh: fixed key authorization block indentation (was at 3 tabs instead of 2)
- GL kit-busrouter Makefile: added +kit-connect to DEPENDS so installing the balancer auto-pulls connectivity

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 13:10:16 +00:00
kitadmin 1005269239 feat: weekly config backup + unified telemetry schema + fleet dashboard
- scripts/backup-config.sh: weekly router config backup to hub (SRM + OpenWrt)
  Runs via cron, exports platform-specific config, POSTs to /api/backup
  Keeps last 10 backups per device on hub

- hub/ingest.sh: fleet hub telemetry normalizer + backup receiver
  Normalises GL (openwrt) and Synology telemetry into single schema
  Adds platform field to GL telemetry for unified dashboard

- hub/dashboard.html: single-pane fleet console
  Shows all routers (GL + Synology) with scores, WAN state, GPS, uptime
  Auto-refreshes every 10s from /api/status endpoint

- 62-point checklist updated with weekly backup section 9b

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 00:18:27 +00:00
allen f15ac69925 feat: kit-busrouter v2.0 — complete Synology + GL fleet router platform
Includes:
- package/ GL-XE3000 kit-busrouter (opkg)
- scripts/provision.sh (GL) and provision-synology.sh (Synology)
- syno-balance/ — new WAN balancer replacing aiwanbal (SmartWAN adapter)
- kit-connect/ — unified connectivity SPK (Tailscale + reverse SSH)
- docs/deployment/synology-rt2600ac-checklist.md — 62-point checklist
- docs/provisioning/device-identity.md — fleet identity spec
- docs/pilot/checklist.md — field pilot validation
- x4078_20260721.dss — reference config backup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-22 00:07:14 +00:00