Repository navigation
Add Zigbee gateway diagnostics API - #14
Merged
Merged
Conversation
Implement POST /api/diag/zbgw matching ZigbeeGateway-ESP32C6 diag.c wire format (X-ZBGW-Diag token auth, command delivery), SQLite storage next to telemetry, admin feed/ack/command endpoints, zigbee-gateway OTA via the existing firmware coordinator, and telemetry pull/analyse/all scripts. Co-authored-by: James Brown <JamesSmartCell@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Zigbee gateway diagnostics API that matches the ESP32-C6 firmware client (
ZigbeeGateway-ESP32C6main/diag.c/ota_update.c) wire format, plus admin feed/ack/command tooling and docs for the newzigbeediagnostics.percolate.oneCaddy hostname.Device API
POST /api/diag/zbgw— Host-independent path (same as priorhomesolartarget)X-ZBGW-DiagagainstZBGW_DIAG_TOKENS(comma-separated, constant-time compare; never hard-coded)zigbee.dbnext to telemetry{"commands":[{"action":"restart"}]}(also supports queuedota_check)Admin API (Bearer
TELEMETRY_API_KEY)GET /api/diag/zbgw/gatewaysGET /api/diag/zbgw/events?afterId=&limit=POST /api/diag/zbgw/ack— signedzbgw-ack:<upToId>:<nonce>(respectsTELEMETRY_ACK_ENABLED)POST /api/diag/zbgw/commands— signedzbgw-cmd:<mac>:<action>:<nonce>Schema reserves
device_pubkey/auth_approvedfor a future per-device P-256 signing scheme (TODO only).OTA / tooling
GET /api/firmware/zigbee-gateway/latest(no special-casing)npm run telemetry:zigbee:pull→data/zigbee-YYYYMMDD.jsonl(acks only with--ack)npm run telemetry:zigbee:analyse— silent gateways, watchdog, Wi-Fi/MQTT flaps, reset reasons, OTA failures, unknown-device dumpsnpm run telemetry:all— SmartLayer pull+analyse then Zigbee pull+analysePi env vars for Rob
Also add the Caddy site for
zigbeediagnostics.percolate.onereverse-proxying to the same upstream asscriptproxy(seeCaddyfile.example/ README).Tests
zigbee-gatewayfirmware latestDo not merge until Rob has set the Pi env + Caddy block (master auto-deploys).