![Ebyte E103-W07 User Manual Download Page 29](http://html.mh-extra.com/html/ebyte/e103-w07/e103-w07_user-manual_530473029.webp)
Chengdu Ebyte Electronic Technology Co.,Ltd.
E103-W07 User Manual
Copyright ©2012–2021
,
Chengdu Ebyte Electronic Technology Co.,Ltd.
28
5.7.3 AT+MQTTCONN connect to MQTT Brokers
Setting
AT+MQTCONN= ["host"],[port],[reconnect]
+OK
Success
+ERR:[NUM]
Error
Inquiry
AT+MQTCONN?
+MQTCONNCFG= [stats],["host"],[port],[reconnect]
Parameter
stats
0 means MQTT is not connected to Success, 1 means to connect
to Success
host
Broker address. Maximum length 128 bytes
port
Broker port
reconnect
0
Enable reconnection
1
Disable reconnection
Description
1. Effective immediately;
2. Use the mqttclean command to disconnect, the client will not reconnect. reconnect = 0, Mqtt will automatically
reconnect after disconnecting due to network reasons for 1s.
Example
AT+MQTTCONN="mqtt:// mqtt://mqtt.eclipse.org ",1883,0\r\n
5.7.4 AT+MQTTPUB publish MQTT message
Setting
AT+MQTTPUB= ["topic"],["length"],[qos],[retain]
+OK
Success
+ERR:[NUM]
Error
Parameter
topic
The topic of the publication. String length 63 bytes
length
Data length
qos
Message quality. 0, 1, 2
retain
Value range: 0, 1
Description
1. Effective immediately;
2. Retain=1, in a PUBLISH packet sent from the client to the server, the server must store the application message
and QoS so that it can be sent to subscribers who subscribe to this topic later. When a new subscription occurs, the
last retained message, if any, matches the subscription topic, must be sent to the subscriber; Retain=0, the server
must not store this message, and must not delete or replace any existing ones Reserved message
3. The module only returns to the AT command mode after receiving data of the specified length;
4. The maximum length of Len is 11520 bytes;
Example
AT+MQTTPUB="/com/www",10,0,0\
>
Hello word.
+Ok
:
10