BG96: Close MQTT connection return ERROR

Hi everyone,

I work on an asset tracking device with an MQTT connection. I was able to open a network (AT+QMTOPEN), connect a client (AT+QMTCONN) and publish messages (AT+QMTPUB) into an MQTT server. As explained in the MQTT data integration figure (in Quectel BG86 MQTT Application note), after publishing messages, I have tried to close the connection without success. When I tried to close a network (AT+QMTDISC), the returned error is : ERROR. Just before closing the network, the disconnection of MQTT client (AT+QMTDISC) is OK.

Is there an explanation about this error? How can I fix it?

I have tested it on a private MQTT server (CloudMQTT) and a public MQTT server (mqtt.eclipseprojects.io).

The request modem and application firmware versions are: BG96MAR02A07M1G_01.007.01.007. I have the feeling that the firmware is quite old, correct? Does it possible to upgrade to the latest version?

Best regards,

Jonathan Dreyer

Hi, jonathan.dreyer:
An “error” will appear if you do the following

[2021-06-08_15:20:32:934]AT+QMTOPEN=1,“220.180.239.xxx”,xx06
[2021-06-08_15:20:32:980]OK
[2021-06-08_15:20:34:312]
[2021-06-08_15:20:34:312]+QMTOPEN: 1,0
[2021-06-08_15:20:37:235]at+qmtdisc=1
[2021-06-08_15:20:37:235]ERROR

But the following is correct:

[2021-06-08_15:23:03:443]AT+QMTOPEN=1,“220.180.239.xxx”,xx06
[2021-06-08_15:23:03:473]OK
[2021-06-08_15:23:03:805]
[2021-06-08_15:23:03:805]+QMTOPEN: 1,0
[2021-06-08_15:23:05:635]at+qmtclose=1
[2021-06-08_15:23:05:680]OK
[2021-06-08_15:23:05:680]+QMTCLOSE: 1,0

[2021-06-08_15:24:23:665]AT+QMTOPEN=1,“220.180.239.xxx”,xx06
[2021-06-08_15:24:23:695]OK
[2021-06-08_15:24:25:193]
[2021-06-08_15:24:25:193]+QMTOPEN: 1,0
[2021-06-08_15:24:25:582]AT+QMTCONN=1,“EC200U_TEST”
[2021-06-08_15:24:25:642]OK
[2021-06-08_15:24:26:459]
[2021-06-08_15:24:26:459]+QMTCONN: 1,0,0
[2021-06-08_15:24:27:910]at+qmtdisc=1
[2021-06-08_15:24:27:956]OK
[2021-06-08_15:24:27:972]
[2021-06-08_15:24:27:972]+QMTDISC: 1,0

The following will also cause an error:

[2021-06-08_15:25:58:962]AT+QMTOPEN=1,“220.180.239.xxx”,xx06
[2021-06-08_15:25:59:008]OK
[2021-06-08_15:26:00:097]
[2021-06-08_15:26:00:097]+QMTOPEN: 1,0
[2021-06-08_15:26:01:834]AT+QMTCONN=1,“EC200U_TEST”
[2021-06-08_15:26:01:834]OK
[2021-06-08_15:26:02:409]
[2021-06-08_15:26:02:409]+QMTCONN: 1,0,0
[2021-06-08_15:26:04:207]at+qmtclose=1
[2021-06-08_15:26:04:253]OK
[2021-06-08_15:26:04:253]+QMTCLOSE: 1,0
[2021-06-08_15:26:07:748]at+qmtdisc=1
[2021-06-08_15:26:07:778]ERROR

[2021-06-08_15:27:58:794]AT+QMTOPEN=1,“220.180.239.xxx”,xx06
[2021-06-08_15:27:58:824]OK
[2021-06-08_15:28:00:209]
[2021-06-08_15:28:00:209]+QMTOPEN: 1,0
[2021-06-08_15:28:01:703]AT+QMTCONN=1,“EC200U_TEST”
[2021-06-08_15:28:01:718]OK
[2021-06-08_15:28:02:082]
[2021-06-08_15:28:02:082]+QMTCONN: 1,0,0
[2021-06-08_15:28:04:647]at+qmtdisc=1
[2021-06-08_15:28:04:722]OK
[2021-06-08_15:28:04:722]+QMTDISC: 1,0
[2021-06-08_15:28:06:146]at+qmtclose=1
[2021-06-08_15:28:06:146]ERROR

Note that only one operation can be performed to “shut down the network” and “disconnect the MQTT server” after the MQTT has connected to the server for publication or subscription!

Hi herbert.pan,

Thanks for your feedback. Ok, So the documentation does not reflect how the modem works, correct? I have attached the figure from the documentation which indicate the combination (AT+QMTDISC=1 flowed by AT+QMTCLOSE=1).

Maybe, it is related to the actual firmware or the hardware revision?

I need to understand the reason because, the idea is to deploy to multiple MCU. And as you can understand, I am a bit confused between your version and the one in the documentation.

Best regards,

Jonathan Dreyer