BG96 fails to publish mqtt and connect with http after over 100 seconds of inactivity

Hi,

We are using our BG96 (running BG96MAR02A07M1G_01.019.01.019) to publish and receive MQTTS messages to AWS IoT Core as well as upload files to S3 via HTTPS.

We have found that following an initial period of successful connection and sending msgs, if there is a period of inactivity of about 100 seconds, we fail to publish any more msgs or use https without rebooting the device.

I was unable to identify any key timeout parameters that would be the cause of this, or make sense of the ERROR return values. Is there something I have missed in the setup?

Here is the serial output of the BG96 during such a session. I have removed a few things (urls, device id’s, certificates)


AT
AT
AT
AT
AT
AT
AT
AT
AT
AT
AT
AT

RDY
AT
OK
AT+CFUN=1,1
AT+CFUN=1,1
OK

RDY

APP RDYAT

AT
OK
ATE0
ATE0
OK
AT+CMEE=0

OK
AT+CTZR=0

OK
AT+CTZU=1

OK
AT+CPIN?

+CPIN: READY

OK
AT+QGMR

BG96MAR02A07M1G_01.019.01.019

OK


OK
AT+CEREG?

+CEREG: 0,5

OK
AT+QIDEACT=1

OK
AT+QICSGP=1,1,"hologram","","",1

OK
AT+QIACT=1

OK
AT+CGATT=1

OK
AT+QLTS=1

+QLTS: "2022/10/04,23:00:11+44,1"

OK

OK
AT+QMTOPEN?

OK
AT+QMTCFG="SSL",0,1,1

OK
AT+QMTCFG="keepalive",0,3600

OK
AT+QSSLCFG="sslversion",1,4

OK
AT+QSSLCFG="ciphersuite",1,0xffff

OK
AT+QSSLCFG="seclevel",1,2

OK
AT+QSSLCFG="ignorelocaltime",1

+QSSLCFG: "ignorelocaltime",1,1

OK
AT+QSSLCFG="cacert",1,"iot_root.pem"

OK
AT+QSSLCFG="clientcert",1,"iot_cert.pem"

OK
AT+QSSLCFG="clientkey",1,"iot_key.pem"

OK
AT+QMTOPEN=0,"",8883

OK

+QMTOPEN: 0,0
AT+QMTCONN=0,""

OK

+QMTCONN: 0,0,0
AT+QMTSUB=0,1,"$aws/things//shadow/delta",1

OK

+QMTSUB: 0,1,0,1
AT+QMTSUB=0,1,"$aws/things//shadow/get/rejected",1

OK

+QMTSUB: 0,1,0,1
AT+QMTPUB=0,1,1,0,"$aws/things//shadow/get",2

>{} 
OK

+QMTPUB: 0,1,0

+QMTRECV: 0,1,"$aws/things//shadow/delta","{"fw": false, "imu": [0]}"

AT+QMTPUB=0,1,1,0,"$aws/things//shadow/update",81

>{"state":{"reported":{"fw":"3.0.22","iccid":"","imu":[0,0]}}} 
OK

+QMTPUB: 0,1,0

AT+QCSQ

+QCSQ: "CAT-M1",-67,-97,145,-12

OK
AT+QMTPUB=0,1,1,0,"node/telemetry/",216

>{"signal":{"rssi":-67,"rsrp":-97,"sinr":145,"rsrq":-12},"BattV":3945,"pressure":99183,"temp":18,"co2_b":637,"temp_b":22.69180298,"humid_b":39.5324707,"meth_b":-1498,"imu":[[0,0],[0,0],[0,0]],"onboardTime":1664924531} 
OK
AT+QMTPUB=0,1,1,0,"node/alert/",82

ERROR

AT+QMTPUB=0,1,1,0,"node/alert/",102

ERROR

AT+QSSLSTATE=0

OK
AT+QSSLCLOSE=0

OK
AT+QSSLCFG="sslversion",2,4

OK
AT+QSSLCFG="ciphersuite",2,0xffff

OK
AT+QSSLCFG="seclevel",2,1

OK
AT+QFDEL="api_root.pem"

OK
AT+QFUPL="api_root.pem",1468,100


+QFUPL: 1468,6c33

OK
AT+QSSLCFG="cacert",2,"api_root.pem"

OK
AT+QSSLCFG="negotiatetime",2,300

OK
AT+QSSLCFG="ignorelocaltime",2,0

OK
AT+QSSLOPEN=1,2,0,"",443,1

OK

+QMTPUB: 0,1,2
AT+QMTPUB=0,1,1,0,"node/alert/",79

>{"alert":"connectS3CatM1() - Failed to connect to S3","onboardTime":1664924580} 
OK

AT+QPOWD=1

OK

+QIURC: "pdpdeact",1

+QMTSTAT: 0,1

Hi,

Are you mean this ERROR response?

AT+QMTPUB=0,1,1,0,"node/alert/",82

ERROR

B R
Linkin WANG

yes
and also

AT+QMTPUB=0,1,1,0,"node/alert/",102

ERROR

@Linkin-Q Do you have any advice for how we can debug this problem?

Sorry for the late response.
It’s good to publish before happened this ERROR return?

Hi James,

I’f easy to reproduce i need check modem logs i think.
Or we can chat via teams or skype for more details

B R
Linkin W

Publishing and comms in general seems to work fine before the ERROR return.

It should be easy to reproduce.

Happy to chat on Teams or Skype.

@Linkin-Q are their any other logs that you want us to post here for you? Or anything else you think we should test before we meet for a Skype call?

@Blake_James

Yes, if possible to send a test procedure here? and i can do a test with your server?

We can send you the set of AT commands we have been using with credentials to access our AWS stack for you to test with one of your devices

My Teams: linkin.wang@quectel.com
Skype: Join conversation