Skip to content

Communication Protocols ​

The release firmware provides MQTT/MQTTS and Modbus RTU. MQTT connects to the platform for reports and commands. Modbus RTU acts as a master, polls RS485 slave devices and maps results to local peripheral data.

Configuration ​

ProtocolWeb PageAPI
MQTT/MQTTSCommunication Protocols -> MQTT/api/protocol/mqtt/config, /api/mqtt/status
Modbus RTUCommunication Protocols -> Modbus RTU/api/protocol/modbus-rtu/config, /api/modbus/*

Confirm networking first, then save protocol settings and inspect status and logs. A successful save does not prove that the remote endpoint is reachable.

MQTT/MQTTS ​

Supported behavior:

  • Plain MQTT, commonly port 1883, and TLS MQTTS, commonly port 8883.
  • Client ID, username/password, keep-alive and last-will configuration.
  • Reconnect, properties/events/monitoring reports and platform command subscriptions.
  • WiFi, W5500 and EC801E-CN network transports when their features and hardware are active.

Setup:

  1. Confirm mqtt is compiled and enabled. Enable mqtts only when TLS is required and memory is sufficient.
  2. Enter broker, port, Client ID and credentials.
  3. Configure publish/subscribe topics, save and connect.
  4. Confirm connected in /api/mqtt/status before testing platform messages.

/api/mqtt/test saves the submitted configuration and reconnects the main client. Automated tests must restore the original configuration afterward.

Modbus RTU ​

The current release provides Modbus master behavior:

  • UART TX/RX and optional DE pin.
  • Multiple slave addresses, function codes, register ranges and data-type mapping.
  • Scheduled polling, adjacent-register read merging, retries and timeout metrics.
  • Coil/register writes and Peripheral Exec integration.

Setup:

  1. Wire the RS485 transceiver and verify A/B polarity, ground, termination and DE/RE control.
  2. Select UART, baud, parity and stop bits on the Modbus page.
  3. Add a slave device with its address and register map.
  4. Inspect poll success/failure counters before creating rules or MQTT reports.

Modbus slave response mode is disabled in release builds with FASTBEE_MODBUS_SLAVE_ENABLE=0.

Rule Integration ​

text
RS485 slave -> poll task -> register mapping -> local sensor cache
                                               |
                                      condition/action
                                               |
                                      GPIO, display or MQTT

A rule supports up to three triggers and four actions. See Peripheral Exec.

Troubleshooting ​

SymptomCheck First
MQTT does not connectDNS, broker/port, credentials, Client ID, TLS feature and system time
MQTT reconnects repeatedlyNetwork signal, keep-alive, broker logs and device memory
Every Modbus request times outA/B polarity, baud/parity, slave address, DE pin and common ground
Some registers are wrongFunction code, register base, byte order, data type and scaling
A rule does not runmodbus feature, poll task, target peripheral and rule enabled state

See API Reference for status fields and errors, and Network Configuration for transports.

FastBee | fastbee.cn