Glance

Device API

A Glance display speaks plain JSON over HTTPS. Every request after registration carries Authorization: Bearer <device_token>. The display never decides what to show — the cloud does.

POST/api/public/device/register

Request

{ "device_code": "K7QW2M", "mac": "A4:CF:12:9B:00:01", "firmware_version": "1.0.0" }

Response

{ "device_token": "…", "device_id": "…" }

POST/api/public/device/heartbeat

Request

{ "wifi_rssi": -52, "uptime_seconds": 8123, "free_memory": 148320 }

Response

{ "ok": true, "next_heartbeat": 60 }

GET/api/public/device/display

Request

Response

{ "mode": "event", "refresh_in": 12, "payload": { "title": "RYANAIR FR712", "line_2": "DUB → FAO", "line_3": "31,000 FT", "icon": "plane" } }

POST/api/public/device/displayed

Request

{ "event_id": "…" }

Response

{ "ok": true }

GET/api/public/device/config

Request

Response

{ "brightness": 70, "rotation_seconds": 12, "quiet_start": "23:00" }

GET/api/public/device/firmware

Request

Response

{ "version": "1.0.1", "url": "https://…", "sha256": "…" }

Firmware loop

  1. 1. On first boot, host a Wi-Fi setup portal and collect credentials plus the pairing code.
  2. 2. Call register once, store the returned device token in NVS.
  3. 3. Poll display every refresh_in seconds; render the payload verbatim.
  4. 4. Report displayed after each render, and heartbeat every 60 seconds.
  5. 5. Check firmware daily; update over the air when the version differs.

Hardware reference: ESP32 + 64×32 HUB75 LED matrix, ambient light sensor, single button.