BG96 MQTT Error

Hi,

I am working on BG96 module and i am executing MQTT commands.

I have received error “+QMTSTAT: 2,1” which mean connection closed or reset by peer at time of executing "AT+QMTCONN=2,“bg96"” this command.

I am also executing “AT+QMTOPEN=2,******************-ats.iot.us-east-1.amazonaws.com,8883” commands and in that i am getting response “+QMTOPEN: 2,0”

Any idea how to solve this ?

Thanks

Hi vivek,

  1. “AT+QMTCONN=2,“bg96”” is not right cmd . hostname means server name
  2. +QMTOPEN: 2,0” , this means that connection is sucessful.

3 for the detail,pls refer to the doc of Quectel_BG96_MQTT_Application_Note_V1.1.pdf

pls pay more attention to the example of AWS in chapter 6.1

Hi,

Thank you for helping me out on this problem.
I have gone through the documentatation again, and I am still stuck with this problem.

To elaborate my problem in detail, here is my sequence of at commands:

AT+QMTCFG=”SSL”, 0, 1, 2
AT+QFUPL=“ufs:cacert.pem”,1423,100
AT+QFUPL=“ufs:client.pem”,1220,100
AT+QFUPL=“ufs:user_key.pem”,1679,100
AT+QSSLCFG=“cacert”,2,“ufs:cacert.pem”
AT+QSSLCFG=“clientcert”,2,“ufs:client.pem”
AT+QSSLCFG=“clientkey”,2,“ufs:user_key.pem”
AT+QSSLCFG="seclevel”,2,2
AT+QSSLCFG="sslversion”,2,4
AT+QSSLCFG="ciphersuite”,2,0XFFFF
AT+QSSLCFG=“ignorelocaltime”,1

After this if I send following command:
AT+QMTOPEN=0, “****.iot.us-east-1.amazonaws.com”,8883
it failes to connect with response: +QMTOPEN: 0,-1

Now if I change index in open command to 2,
AT+QMTOPEN=2, “****.iot.us-east-1.amazonaws.com”,8883
it is able to open connection with response +QMTOPEN: 2,0

After this I send connection command as follows:
AT+QMTCONN=2,“GateWay”

it resonses with +QMTSTATE: 2,1

Please let me know which step I am doing wrong here.

Thanks in advance