M5Stack MQTT Unit with RJ45 Port


Description

UNIT MQTT is an Ethernet MQTT communication module with embedded W5500 Ethernet chip, UART communication interface (AT command control) and integrated RJ45 adaptive 10/100M network port. It also supports 4 Topics subscription with extremely low network latency, and is widely used in various industrial automation, security monitoring systems, automatic measurement and control systems, and equipment data on the cloud.

Features

  • Embedded W5500 Ethernet chip

  • RJ45 Ethernet port 10/100Mbps

  • Ethernet MQTT communication

  • Support 4x Topic subscription

  • Low latency

  • Development method:

    • AT command, UART: 9600bps default

    • Development platform: UIFlow, Arduino

Applications

  • Remote data collection/up to the cloud

Specification

Specifications
Parameters

Module Processor

ARM Cortex-M3

Communication interface

UART: baud 9600bps 8N1 default

MQTT

Support 4x Topic subscription, not support MQTTS

Network port

RJ45 adaptive 10/100M network port

Delay

Delay `10ms

Standby working current

40.4mA

Net weight

22.4g

Gross weight

27.2g

Product size

72 * 26 * 19 mm

Packing size

73 * 35 * 20 mm

Pinout

M5Core
TX(GPIO17)
RX(GPIO16)
VCC
GND

UNIT MQTT

RX

TX

VCC

GND

Examples

Arduino

AT command set

Note: Send a carriage return and line feed \r at the end of each command

Setting AT commands

AT+NETMAC=MAC address``

  • Command description: Set the MAC address of the module

  • The MAC address must be in the following format: XX-XX-XX-XX-XX-XX

AT+NETSTATICIP=IP address,subnet mask,gateway``

  • Command description: Set the static IP address of the module (AT+NETSTATICIP=IP address,subnet mask,gateway) ?Note: When the DHCP function is turned on, the static IP setting will not be enabled.brIP address` (text), which means the local IP address, you can use the IP address or domain name`brsubnet mask (text), must be in IP address formatbr``gateway`(text), must be in IP address format

AT+NETDHCPEN=1/0``

  • Command description: Enable/disable DHCP function 1/0``br1: Enable DHCP functionbr0: Disable DHCP function

AT+MQCLIENTID=client name``

  • Command description: Set MQTT server br``client name``br(text) MQTT client name

AT+MQKEEP=heartbeat duration``

  • Command description: Set the length of the heartbeat time for connecting to the MQTT serverbr``heartbeat time``brThe time interval for automatically sending PINGREQ packets, unit: second, range 5~300

AT+MQSUBSCRIBE=subject serial number,1/0,subject name,quality of service``

  • Command description: Set the topic subscribed to the MQTT server. This module can subscribe 4 topics to the server at the same time. After modifying the subscription topic through this command, the topic will not be subscribed or unsubscribed immediately. It will take effect the next time you connect to MQTT.br Subject Number Numbers 1-4 br``1/01 Open the subscription of this topic, 0 Close the subscription of the changed topic, when the parameter is changed to 0, the latter two parameters must be emptybr``topic name(text)quality of service Must be one of 0, 1, 2

AT+MQSERVER=server address,server port``

  • Command description: Set the address and port number of the MQTT serverbr``server address``br(text), you can use IP address or domain namebr``server port number 0~65535

AT+MQUSERPWD=user name,password``

  • Command description: brset user name and password user name (text) MQTT user namebr``password (text) MQTT login password

AT+MQAUTO=1/0``

  • Command description: brSet whether to directly connect to the server when powering on.br``1/00: Do not directly start the connection when powering on, 1: Start the connection directly according to the configured parameters when powering on

AT+MQRESETCFG

  • Command description: Set to restore factory settings related to MQTTbr

AT+MQPUBLISH=topic,message,quality of service``

  • Command description: Publish MQTT messagebr``subject(text), the subject name of the message to be publishedbr``message(text), the message to be published, the maximum allowed length of this parameter is 1000br Quality of Service QOS, must be 0,1,2, you can choose not to send this parameter, at this time QOS is 0

AT+BAUD=Baud rate``

  • Command description: Set the serial port baud ratebr``baud rate The baud rate can only be the following values/4800/9600/19200/34800/115200/230400

AT+SAVE

  • Command description: Set the save parameters, After configuring the MQTT parameters, you need to execute the SAVE command, and perform a RESET soft reset, the configuration will take effect

AT+RESET

  • Command description: Set the module soft reset, After configuring the MQTT parameters, you need to execute the SAVE command, and perform a RESET soft reset, the configuration will take effect

Query AT commands

AT

  • Command description: Test whether the communication with the module is successful, response: AT

AT+MQSUBSCRIBE=subject serial number?

  • Command description: query the subscribed topic, response: +MQSUBSCRIBE=OK:topic number,on/off,topic name,service quality level``br``topic number can only be 1~4 One of the br``on/off is 1 when the current subscription is on, and 0 means when the subscription is invalid.br``topic name``service level quality can only be 0,1,2, one of which means MQTT service QOS0, QOS1, QOS2 in quality

AT+MQAUTO?

  • Command description: Query whether to start the connection directly when powering on, response: +MQAUTO=OK:on/off 0: Do not start the connection directly when powering on, 1: Start the connection directly according to the configured parameters when powering on

AT+NETMAC?

  • Command description: Query the current MAC address of the module, response: +NETMAC=OK:MAC address The format is: XX-XX-XX-XX-XX-XX

AT+NETSTATICIP?

  • Command description: Query the static IP settings of the module, response: +NETSTATICIP=OK:static IP address,subnet mask,gateway

AT+NETDHCPEN?

  • Command description: Inquire about enabling/disabling of the DHCP function, response: +NETDHCPEN=OK:start/disable 1: Enable the DHCP function, 0: Disable the DHCP function

AT+MQCLIENTID?

  • Command description: View the client name of MQTT, response: +MQCLIENTID=OK:client IP

AT+MQSERVER?

  • Command description: Query the address and port number of the MQTT server, response: +MQSERVER=OK:server address,server port number

AT+MQUSERPWD?

  • Command description: Query the user name and password of the MQTT server that has been set, response: +MQUSERPWD=OK:username,password

AT+MQKEEP?

  • Command description: Query the length of the heartbeat interval when connecting to the MQTT server, response: +MQKEEP=OK:heartbeat interval

AT+BAUD?

  • Command description: Query the baud rate of the serial port, response: +BAUD=OK:baud rate The default baud rate is 9600

AT+VERSION?

  • Command description: Query the current version number, response: +VERSION=OK:current firmware version number

AT+MQSTATUS?

  • Command description: Query MQTT connection/connection has been disconnectedbrResponse: +MQSTATUS=OK:connection status

AT+NETIP?

  • Command description: Query the current actual IP address of the modulebrResponse: +NETIP=OK:IP address,subnet mask,gateway,DNS server address

AT commands sent actively

Error code returned when the instruction is wrong

Last updated

Was this helpful?