Hello all,
I was struggling with getting “MQTT is initial” state of 1 in response to AT+QMTCONN?. I didn’t know what it meant and how to resolve it. After much debugging here’s what I’ve found.
This error occurs when you try to check for a connection i.e. QMTCONN? after sending a QMTOPEN command but before the response of getting the successful connection. The below two sequences of command will better explain.
Situation 1: Successful connection
AT+QMTOPEN=0,“12…url…243”,1883
OK
+QMTOPEN: 0,0
AT+QMTOPEN?
+QMTOPEN: 0,“12…url…243”,1883
AT+QMTCONN?
+QMTCONN:0,3
Situation 2: Unsuccessful connection
AT+QMTOPEN=0,“12…url…243”,1883
OK
AT+QMTOPEN?
+QMTOPEN: 0,“12…url…243”,1883
AT+QMTCONN?
+QMTCONN:0,1
So this issue occured because the response time of AT+QMTOPEN=0,“12…url…243”,1883 with +QMTOPEN: 0,0 can be many tens of seconds. And strangely if AT+QMTOPEN? gives a successful opened response when queried in this time. So with +QMTCONN:0,1 response we can see that the opening is not yet successful.
Hope this helps anyone who has faced similar issue.