P4M-440G can request a connection to a MQTT broker as an MQTT client.
Command Format
AT+MNC="<Broker's hostname / IP address>"
AT+MNC="<Broker's hostname / IP address>",<Port number>
AT+MNC="<Broker's hostname / IP address>",<Port number>,<Protocol>
In some cases, you can omit the port number or protocol. When omitted, the default values will be used.
Parameter | Values | Default Value |
---|---|---|
Port number | 0 ~ 65535 | 1883 |
Protocol | "tcp", "tls" | "tcp" |
※ Notice: If you specify the port number as 8883 and do not specify the protocol, "tls" will be used as the protocol instead of the default "tcp".
at+mnc="203.0.113.0"
OK
at+mnc="203.0.113.0",8883
OK
at+mnc="example.com",8884,"tls"
OK
AT+MQNS
Response Code
Code | Description |
---|---|
0 | Not conencted |
1 | Hostname lookup is in progress |
2 | TCP/TLS connection is in progress |
3 | TCP/TLS connected + MQTT connecton is in progress |
4 | MQTT Connected |
5 | MQTT Connected + Wait for a response (PUBACK / SUBACK / UNSUBACK) |
at+mnc="203.0.113.0"
OK
at+mqns
+MQNS:4
OK
AT+MND
at+mqns
+MQNS:4
OK
at+mnd
OK
at+mqns
+MQNS:0
OK