I am using MQTT on a SIM7500 LTE modem. I can connect to some mqtt broker after sending a bunch of AT and MQTT commands.
The thing I didn't expect to happen, is when I publish a topic from my modem, I loose the subscription I had open. Regardless of the topic name I subscribed to. After a publish from my modem, my modem no longer receives bytes when I publish on any subscribed topic on the broker.
I checked the documentation on the modem again, I can't find any reference to this behavior.
Anybody with knowledge on AT/CMQTT can explain if this is "expected behavior"? I can't imagine it's a bug in the modem. So either I am using things in the wrong way, or there is a reason for this.
A screenshot which shows the commands being sent/received:
In text:
startup commands left out for convenience (atz, ate0, at+cgatt=1, at+cgact=1,1)
MCU ==> Modem MCU <== Modem
AT+CMQTTCONNECT=0,"someipaddress:port,90,1
+CMQTTCONNECT: 0,0
AT+CMQTTSUBTOPIC=0,5,2
>
stm32
OK
AT+CMQTTSUB=0
OK
from this moment on, I have a live subscription, I published 2 messages on that topic which are received and passed through to my MCU
MCU ==> Modem MCU <== Modem
hello
hello
AT+CMQTTTOPIC=0,17
>
t/867584034403399
OK
AT+CMQTTPAYLOAD=0,5
>
hello
OK
from this point onwards, the subscription is lost. Whatever I publish on 'stm32', it no longer is received on my uart connected to my modem.