This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to to set a keep alive value of MQTT while eDRX is enabled in nRF9160?

I want to set a keep alive value of MQTT while eDRX is enabled, but it doesn't work well. Any advice?

Environment
- hardware: nRF9160 DK 0.8.2
- firmware: 0.7.0-29.alpha
- nrf ver: 0.4.0
- LTE-M
- eDRX enable
- mqtt_simple works fine with mosquitto MQTT broker
- project based on mqtt_simple
- antenna power is fine
- eDRX service is available here

I added MQTT_KEEPALIVE param to Kconfig and CONF_MQTT_KEEPALIVE param to pro.conf
I've tested several conditions
[condition]
- CONFIG_LTE_EDRX_REQ_VALUE="0110" in prj.conf // 327.68 sec interval
CONF_MQTT_KEEPALIVE=300 in prj.conf
[result]
eDRX doesn't work properly. When I send a message to a MQTT broker, the DK receives it right after that. There should be a delay due to the eDRX.

[condition]
CONFIG_LTE_EDRX_REQ_VALUE="0110" in prj.conf // 327.68 sec interval
CONF_MQTT_KEEPALIVE=400 in prj.conf
[result]
The DK does not receive any message after 360sec followed by disconnection.

This is the whole project.

This is a test condition.
Ideally, I want to set a longer keepalive value, like 1200(sec) to decrease power consumption.
- keep alive of MQTT: 1200 sec
- eDRX interval value: 655 sec

I have been struggling with this issue more than two weeks, but I don't really get the eDRX behavior. Any advice?

Parents Reply Children