Using ncs v1.4.0, modem FW v1.2.3, SES v5.10d. The code is based on the Asset Tracker, LTE with PSM, motion-activated GPS, using MQTT to send GPS location to backend.
prj.conf
CONFIG_LTE_PSM_REQ_RPTAU="00000110"
CONFIG_LTE_PSM_REQ_RAT="00000010"
CONFIG_MQTT_KEEPALIVE=600
After connecting (Sierra Wireless/Verizon):
AT+CEREG=5
AT+CEREG?
+CEREG: 5,1,"1510","00526401",7,,,"00000010","00010011"
Active Time: 000 = 2 sec; 2 x 2 sec = 4 sec
Periodic TAU: 000 = 10 min; 19 x 10 min = 190 min
The device occasionally needs to check if it has any messages from the server. Is it better to wake-up, connect to the Broker, poll, process, then disconnect? Or stay connected, poll, process, then sleep? I did see this post from about a year ago:
“You should have separate threads for the MQTT and GPS in your application, and both sockets should be read/polled
all the time to avoid any conflicts.”
https://devzone.nordicsemi.com/f/nordic-q-a/56641/mqtt-and-gps-concurrent-mode-on-thingy-91
Is this still the best practice? How often can/should you poll MQTT when using PSM? Or is it just managed in the background? Does this need to sync with the KeepAlive time?