Azure iot hub connection fails after half hour 30 min, Keepalive without effect

Hello,

I want to send data to azure Iot hub less frequent than every 30 min. But after the first 30 min, messages sent by the nrf9160 won't arrive at the server. A disconnection error does not occur during that time (see Log). Disconnection error occurs if device tries to send something after the first 30 min (at 11:30:37:254 it tries to send other ping but fails).

The Log with keepalive set to 1600 sec and event interval 1800 sec: see how the first messages gets achknowledged (at 10:33:57:439) but the last message not (at 11:03:56:962) and see the successful ping (at 11:00:37:353)

To make a minimal example I took the azure_iot_hub example from NSC

  1. set the event_interval to 1800 sec in device twin.
  2. set the MQTT keepalive time to 1600 sec (instead of 1767 sec) just to be sure
  3. added the PINGRESP case to azure_event_handler() to see if pings come back
  4. Changed MQTT QoS to 1 "at least once" to see if message arrived at the server

I played with the MQTT keepalive time:

- When set to 60 sec, it works flawless. The device sends a ping every minute and after 30min the message arrives at the server. Problem is that the modem wont go to sleep here -> high energy consumption

- When set to 240 sec, energy consumption is much better here, but the keepalive time is still to high to keep connection alive

Another thing I found: When event_interval is lower than 1767 sec messages arrive at the server, even if no ping was sent in the period before. That tells me, that the ping/keepalive signal has no effect on resetting timeouts in the whole connection chain. Can that be true?

Hardware: NRF9160 B2 on the actinius Icarus V2

Software: NCS 2.3.0

Thanks a lot for your help! Slight smile

Best regards, Moritz43080.prj.conf

Parents Reply Children