Перейти до основного вмісту

🔌 WebSocket Protocol

Cloud ↔ Station

The Station maintains a persistent WSS connection to Cloud. Two modes:

JSON-RPC over WS

Cloud and Station communicate via JSON-RPC. Cloud uses peer.call() to proxy mobile requests:

Two primitives:

  • peer.call(method, params) → returns Promise<result> (waits for matching id)
  • peer.notify(method, params) → fire-and-forget (no id)

Backend ↔ Frontend (Local)

The Station Backend exposes a local WebSocket for the SPA frontend. Used for:

  • Device state push (telemetry → UI in real time)
  • Provisioning candidate updates (BLE flow)
  • Connection status

Frontend subscribes via useWsSubscription hook (source).

Reference