How to set AT+QMTSUB command's timeout parameter

I use QNavigator tool to test MQTT subscribe command.

[2019-08-22 14:42:54:198_R:] OK
[2019-08-22 14:43:24:582_S:] AT+QIACT?
[2019-08-22 14:43:24:585_R:] AT+QIACT?
[2019-08-22 14:43:24:586_R:] +QIACT: 1,1,1,“xx.xx.xx.xx”

[2019-08-22 14:43:24:586_R:] OK
[2019-08-22 14:43:31:263_S:] AT+QMTOPEN=0,“xx.xx.xx.xx”,1883
[2019-08-22 14:43:31:266_R:] AT+QMTOPEN=0,“xx.xx.xx.xx”,1883
[2019-08-22 14:43:31:266_R:] OK

[2019-08-22 14:43:32:162_R:] +QMTOPEN: 0,0

[2019-08-22 14:43:32:165_R:] DSR:0 CTS:0 (RI:1) DCD:0

[2019-08-22 14:43:32:167_R:] DSR:0 CTS:0 (RI:0) DCD:0
[2019-08-22 14:43:41:031_S:] AT+QMTCONN=0,“timtest”
[2019-08-22 14:43:41:033_R:] AT+QMTCONN=0,“timtest”
[2019-08-22 14:43:41:033_R:] OK

[2019-08-22 14:43:41:760_R:] +QMTCONN: 0,0,0

[2019-08-22 14:43:41:762_R:] DSR:0 CTS:0 (RI:1) DCD:0

[2019-08-22 14:43:41:824_R:] DSR:0 CTS:0 (RI:0) DCD:0
[2019-08-22 14:43:53:575_S:] AT+QMTSUB=0,0,“cie/office/cmd”,0
[2019-08-22 14:43:53:578_R:] AT+QMTSUB=0,0,“cie/office/cmd”,0
[2019-08-22 14:43:53:578_R:] OK
[2019-08-22 15:24:34:779_R:] DSR:0 CTS:0 (RI:1) DCD:0

[2019-08-22 15:24:34:781_R:] +QMTSUB: 0,0,0,0

[2019-08-22 15:24:34:899_R:] DSR:0 CTS:0 (RI:0) DCD:0

[2019-08-22 15:24:44:775_R:] +QMTRECV: 0,0,“cie/office/cmd”,"{“cmd”:“5”}"

[2019-08-22 15:24:44:778_R:] DSR:0 CTS:0 (RI:1) DCD:0

[2019-08-22 15:24:44:897_R:] DSR:0 CTS:0 (RI:0) DCD:0

[2019-08-22 15:24:53:973_R:] +QMTRECV: 0,0,“cie/office/cmd”,"{“cmd”:“5”}"

[2019-08-22 15:24:53:976_R:] DSR:0 CTS:0 (RI:1) DCD:0

[2019-08-22 15:24:54:097_R:] DSR:0 CTS:0 (RI:0) DCD:0

I send AT+QMTSUB, I can get the message within 10 seconds.
More than 10 seconds I have to send AT+QMTSUB again.
so How to set AT+QMTSUB command’s timeout parameter?

BTW, If I want to listen a MQTT topic long time, should I polling AT+QMTSUB command?
ex: Should I send AT+QMTSUB every 10 seconds?

Thanks,
Tim

The subscribed topic should be always available during MQTT connection alive.

  • If you have to retrieve messages just by re-sending AT+QMTSUB. To verify this issue, pelase try:
  1. Wait more time(like 60s) to check whether it can receive message again. If yes, it’s impacted by eDRX timer.
  2. Confirm your applicaiton, whether the message will be published in every 10s.
  • If you have to retrieve messages by re-establishing MQTT conenction, AT+QMTOPEN; AT+QMTCONN; AT+QMTSUB. You would need to check the keepalive timer setting. AT+QMTCFG=“keepalive”, can be used to configuration the keepalive timer.

-To verify whether it’s the network paging issue: Send AT+QPING=1,“8.8.8.8” to check if you can retrieve MQTT message again.