Skip to content

docs: Zap Local API for firmware v2.3.27 (backend switch, mDNS, MQTT behaviour) - #32

Open
h0bb3 wants to merge 2 commits into
mainfrom
docs/zap-local-api-v2.3.27
Open

h0bb3 wants to merge 2 commits into
mainfrom
docs/zap-local-api-v2.3.27

Conversation

@h0bb3

@h0bb3 h0bb3 commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Brings the Zap Local API page in line with the released Zap firmware v2.3.27. Each change was checked against the firmware source at tag v2.3.27.

Added

  • Firmware version note at the top of the page, plus a note that the local API has no authentication (keep the Zap on a trusted LAN). The same endpoints can also be reached over BLE and through the MQTT request/response channel.
  • Discovery (mDNS) section:
    • The primary hostname is zap-<id>.local (the device ID).
    • zap.local is added as an alias only if no other device on the network has already claimed it.
    • It advertises _http._tcp on port 80 with TXT records id/ver/mac.
    • The DHCP hostname is the device ID.
    • mDNS starts once BLE has stopped, about 60 s after the WiFi connection.
  • GET/POST /api/system/backend switches between mainnet, testnet and devnet. It sets the backend that OTA and registration use, replaces the broker with that network's default and reboots.
  • PUT /api/devices/{sn} updates a device's connection config. The new config must report the same serial number.
  • POST /api/network/scan scans the subnet for open TCP ports.
  • han_uart connection type and example.

Fixed

  • GET /api/system: field names are camelCase in firmware (timeUtcSec, uptimeSeconds, temperatureCelsius, memoryKb.percentUsed, processesAverage.last1min …). The response also includes backend, zap.platform, wifiMac, the nested interfaces object and the Ethernet fields.
  • GET /api/network: shape updated to match.
  • /api/system/mqtt: the behaviour is now spelled out:
    • Default ports: 8883 for mqtts, 1883 for mqtt.
    • TLS certificates are verified only for sourceful.dev/srcful.dev hosts. For any other host, verification is turned off.
    • When the primary broker fails, the fallback permanently overwrites it, followed by a reboot.
    • A custom broker does not change the backend used for OTA and registration.
    • Settings are stored in /spiffs/system_config.json, not NVS.
    • Reboot happens about 2 s after the response.
  • GET /api/devices/types: the response is an object keyed by connection type, not an array. Parameters include display_name.
  • POST /api/devices: P1/HAN smart meters are saved immediately and detected in the background. There is at most one smart meter per Zap, and a repeat request returns 200. The meter DER starts disabled, and the response has its own shape.
  • GET /api/devices/{sn}: returns the stored device config. The page wrongly said it returned 501.
  • GET /api/crypto / GET /api/name: realistic example IDs and the public-key format (128 hex characters, X‖Y).

Removed

  • POST /api/crypto (wallet signing): the handler exists but is not registered in v2.3.27, so the route does not exist.

Not included

  • Control endpoints (/api/control/*) are not added to the developer portal, because control content was removed from the portal on purpose earlier (6dd54e8). In srcful-documentation the existing control section is left unchanged.
  • OTA endpoints (/api/ota/*) are not documented: they exist in code but are not registered in v2.3.27.

Checks

The MDX compiles with @mdx-js/mdx + remark-gfm + rehype-slug. All in-page anchors resolve. I did not run a full next build.

Companion PR (same change in the other copy of this page): https://github.com/srcfl/srcful-developer-portal-v2/pull/10

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant