Unit MQTT is an Ethernet MQTT communication module with an embedded W5500 Ethernet chip. It uses a UART communication interface (controlled by AT commands) and integrates an RJ45 adaptive 10/100M Ethernet port. It supports 4x Topic subscriptions. With extremely low network latency and high stability, it is suitable for various industrial automation, security monitoring systems, automatic measurement and control systems, and device data cloud applications.
Features
Embedded W5500 Ethernet chip
RJ45 Ethernet port 10/100Mbps
Ethernet MQTT communication
Supports 4x Topic subscriptions
Low latency
Development methods:
AT commands, UART: 9600bps default
Development platforms: UIFlow, Arduino
Includes
1 x Unit MQTT
1 x HY2.0-4P Grove cable (20cm)
Applications
Remote data collection/cloud upload
Specifications
Specification
Parameter
Module Processor
ARM Cortex-M3
Communication Interface
UART: baud 9600bps 8N1 default
MQTT
Supports 4x Topic subscriptions, does not support MQTTS
Note: Each command must end with a carriage return and line feed \r\n
Setting AT Commands
AT+NETMAC=MAC Address
Command Description: Set the module's MAC address
MAC address must be in the format: XX-XX-XX-XX-XX-XX
//Example
AT+NETMAC=12-34-56-78-90-AB
+NETMAC=OK
AT+NETSTATICIP=IP Address, Subnet Mask, Gateway
Command Description: Set the module's static IP address (AT+NETSTATICIP=IP Address, Subnet Mask, Gateway)
Note: When DHCP is enabled, the static IP setting will not take effect IP Address (text), represents the local IP address, can be an IP address or domain name Subnet Mask (text), must be in IP address format Gateway (text), must be in IP address format
Command Description: Set the keep-alive time for connecting to the MQTT server Keep Alive Time The interval for automatically sending PINGREQ packets, unit: seconds, range 5~300
Command Description: Set the topic to subscribe to on the MQTT server. This module can subscribe to 4 topics simultaneously. Modifying the subscription topic with this command will not immediately subscribe or unsubscribe; it will take effect the next time the MQTT connection is established. Topic Number Number 1-4
1/0 1: Enable subscription for this topic, 0: Disable subscription for this topic. When this parameter is 0, the following two parameters must be empty. Topic Name (text) QoS must be one of 0, 1, 2.
Command Description: Set whether to connect to the server directly upon power-up 1/0 0: Do not start connection upon power-up, 1: Start connection with configured parameters upon power-up
//Example
AT+MQAUTO=1
+MQAUTO=OK
AT+MQRESETCFG
Command Description: Restore factory settings related to MQTT
//Example
AT+MQRESETCFG
+MQRESETCFG=OK
AT+MQPUBLISH=Topic**,Message,**QoS
Command Description: Publish MQTT message Topic (text), the topic name of the message to be published Message (text), the message to be published, the maximum length allowed for this parameter is 1000 QoS QOS, must be 0, 1, 2, this parameter can be omitted, in which case QOS is 0
AT+BAUD=Baud Rate
Command Description: Set the serial port baud rate Baud Rate Baud rate can only be one of the following values: /4800/9600/19200/34800/115200/230400
//Example
AT+BAUD=115200
+BAUD=OK
AT+SAVE
Command Description: Save parameters, After configuring MQTT parameters, you need to execute the SAVE command and perform a RESET soft reset for the configuration to take effect
//Example
AT+SAVE
+SAVE=OK
AT+RESET
Command Description: Perform a soft reset on the module, After configuring MQTT parameters, you need to execute the SAVE command and perform a RESET soft reset for the configuration to take effect
//Example
AT+RESET
+RESET=OK
Query AT Commands
AT
Command Description: Test communication with the module, response: AT
//Example
AT
AT
AT+MQSUBSCRIBE=Topic Number**?**
Command Description: Query the subscribed topic, response: +MQSUBSCRIBE=OK:Topic Number, Enable/Disable, Topic Name, QoS Level Topic Number can only be one of 1~4 Enable/Disable 1: Current subscription is enabled, 0: Current subscription is invalid Topic NameQoS Level can only be one of 0, 1, 2 representing MQTT QoS levels QOS0, QOS1, QOS2
Command Description: Query whether to start connection directly upon power-up, response: +MQAUTO=OK:Enable/Disable 0: Do not start connection upon power-up, 1: Start connection with configured parameters upon power-up
//Example
AT+MQAUTO?
+MQAUTO=OK:1
AT+NETMAC?
Command Description: Query the current MAC address of the module, response: +NETMAC=OK:MAC Address Format: XX-XX-XX-XX-XX-XX
//Example
AT+NETMAC?
+NETMAC=OK:12-34-56-78-90-AB
AT+NETSTATICIP?
Command Description: Query the static IP settings of the module, response: +NETSTATICIP=OK:Static IP Address, Subnet Mask, Gateway
Command Description: Query whether DHCP function is enabled/disabled, response: +NETDHCPEN=OK:Enable/Disable 1: DHCP function enabled, 0: DHCP function disabled
//Example
AT+NETDHCPEN?
+NETDHCPEN=OK:1
AT+MQCLIENTID?
Command Description: Query the MQTT client name, response: +MQCLIENTID=OK:Client IP
//Network not connected
+NETUNCONNECT
//MQTT server not connected
+MQUNCONNECT
//Connected to MQTT server successfully
+MQCONNECT
//Received topic message
+MQRECV:**Topic**,**Length**,**Message**
Error Codes Returned When Commands Fail
//Parameter content error
ERROR:Error Param
//Parameter count does not meet requirements
ERROR:Error Param Num
//Parameter length is too long, each parameter field must be less than 128 bytes (maximum message length is 1000 bytes)
ERROR:Parma is too long//Failed to connect to the network
ERROR:Unconnected
//MQTT server communication error
ERROR:MQTT Connect Fail
//Server did not respond when publishing message (Qos1 and Qos2)
ERROR:MQTT Publish Fail