ME310G1/ME910G1/ML865G1 AT Commands Reference Guide
80617ST10991A Rev.4 Page 516 of 545 2020-04-15
3.22.6. AT#MQCONN - Connect and Log in the MQTT Broker
This command performs the connection and login to the MQTT broker.
AT#MQCONN=<instanceNumber>,<clientID>,<userName>,<passWord>
Set command performs network connection (using parameters set with #MQCFG) and sends the
CONNECT packet to the MQTT broker.
Parameters:
selects the client instance. The list of available
clients is obtained with AT#MQEN? or the read
command.
client instance range. To know maxClients value
use test command
identifies each MQTT client that connects to the
MQTT broker
authentication and authorization
authentication and authorization
If connection status is other than init state or connected, disconnect using #MQDISC
before reconnecting using #MQCONN.
AT#MQCONN?
Read command reports the configuration of active MQTT connections in the format:
#MQCONN=<instanceNumber>,<state>
Additional info:
The following tables shows the <state> values and meanings:
Normal/ Failure Events Values
client is initialized but not connected
client performed MQTT authentication with
broker
connection closed or reset by the server
the answer to the ping request packet was
not received
the CONNACK packet was not received
the CONNECT packet was not delivered
socket timeout or read error