Skip to content

MQTT Configuration ​

Feature Description ​

MQTT is the main protocol for FastBee device communication with cloud platforms/private servers. It supports device status reporting, remote command dispatch, last will messages and auto-reconnection.

MQTT Configuration Page

Before saving config, confirm Broker address, port, client ID and topic prefix match the platform side; for public network or production environments, enable authentication and evaluate TLS resource usage.

For connection issues, troubleshoot from left to right: when network is not ready, go back to network page first; when auth fails, verify Broker and credentials; when topics are abnormal, check platform-side topic conventions.

Operation Guide ​

  1. Enter Web interface → MQTT Configuration (or Communication Protocol page)
  2. Fill in server address, port, authentication info
  3. Configure topic prefix
  4. Save and test connection

MQTT or MQTTS ​

Choose mqtt for low-memory or trusted local networks. Choose mqtts only when transport encryption is required and the device has enough memory; it also must be enabled in Feature Config.

PSRAM targets such as esp32-F8R8 and esp32s3-F8R8/F16R8 have more TLS headroom because eligible large allocations prefer PSRAM. WiFi, lwIP and part of the TLS state still consume internal DRAM, so PSRAM does not guarantee a successful connection. No-PSRAM ESP32, C3 and C6 targets should normally use mqtt.

When a connection fails, the page displays the reason reported by GET /api/mqtt/status. Use lastErrorName, lastErrorClass and lastErrorMessage to distinguish invalid configuration, DNS/network failure, broker rejection, bad credentials and low memory. Under sustained memory pressure, the firmware can downgrade MQTTS to MQTT, pause optional services, or disable MQTT after the critical timeout; these actions are also reported by the status API.

Parameters ​

Config ItemDescriptionDefault
Server AddressMQTT Broker IP/domainEmpty
PortConnection port1883 (TCP) / 8883 (TLS)
Client IDDevice unique identifierFastBee-
UsernameAuth usernameEmpty
PasswordAuth passwordEmpty
Topic PrefixPublish/subscribe topic prefixfastbee/
Keep AliveHeartbeat interval (seconds)60
QoSMessage quality of service level0
TLSEnable encryptionNo
Will TopicLWT topic{prefix}/status
Will MessageLWT message contentoffline

Configuration Examples ​

Connect to Public MQTT Server ​

json
{
  "broker": "broker.emqx.io",
  "port": 1883,
  "clientId": "FastBee-A1B2C3",
  "username": "",
  "password": "",
  "prefix": "fastbee/device01/",
  "keepAlive": 60
}

Connect to Private Server (with Auth) ​

json
{
  "broker": "192.168.1.10",
  "port": 1883,
  "clientId": "FastBee-A1B2C3",
  "username": "device01",
  "password": "secret123",
  "prefix": "home/esp32/",
  "keepAlive": 30
}

Topic Format ​

Publish Topics (Device → Platform) ​

TopicDescriptiontopicType
{prefix}property/postProperty data upload0
{prefix}info/postDevice info upload2
{prefix}event/postEvent upload4
{prefix}monitor/postMonitor data upload3
{prefix}ntp/postNTP time upload7
{prefix}http/upgrade/replyHTTP upgrade reply5
{prefix}fetch/upgrade/replyFetch upgrade reply6

Subscribe Topics (Platform → Device) ​

TopicDescriptiontopicType
{prefix}function/getFunction command1
{prefix}info/getDevice info query2
{prefix}monitor/getMonitor data query3
{prefix}ntp/getNTP time query7
{prefix}http/upgrade/setHTTP upgrade command5
{prefix}fetch/upgrade/setFetch upgrade command6

{prefix} is the configured topic prefix, default fastbee/. Each topic can be independently enabled/disabled

Troubleshooting ​

IssuePossible CauseSolution
Connection FailedServer unreachableCheck IP/port, firewall
Auth FailedWrong username/passwordVerify Broker credentials
Frequent DisconnectsKeep Alive too shortIncrease heartbeat interval (30-120s)
Message LossQoS=0Use QoS=1 for important messages
Out of MemoryToo many subscribed topicsReduce subscriptions or message size

FastBee | fastbee.cn