Skip to main content

HTML Live MQTT for Onboarding and Settings

Interactive HTML loaded inside the mobile app may receive a temporary MQTT session for live two-way communication with the Gateway.

Temporary connection

Canonical API:

api/v1/gateway/devices/GenerateTempConnection

The session contains sessionId, clientId, username, password, createdAt, and expiresAt. Canonical TTL is 30 minutes.

Four channels

{projectCode}/v1/gw/{gatewaySerial}/html/{sessionId}/request
{projectCode}/v1/gw/{gatewaySerial}/html/{sessionId}/response
{projectCode}/v1/gw/{gatewaySerial}/html/{sessionId}/event
{projectCode}/v1/gw/{gatewaySerial}/html/{sessionId}/control

All use QoS 1 and retain=false.

Security

These topics do not carry /AES, and the Gateway encryptionKey is never exposed to HTML. Security is:

WSS/TLS + temporary credential + strict session ACL

An HTML session may publish only its own request/control channels and subscribe only its own response/event channels.

Correlation

A request carries mid; the matching response preserves the same mid. Events may use eventId.

No raw bus tunnel

HTML must not receive a generic API such as writeRawRs485Frame, writeArbitraryRegister, or arbitrary firmware function execution. The valid path is:

HTML request
→ validated settings/onboarding handler
→ Driver
→ NativeBusExecutor