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

subscribing in Assert tracker v2

Hello,

I'm trying to send messages from the cloud (AWS-IoT ) to the device, so I modified the device so that it subscribes to a new topic and when I send messages from could, it seems that the device doesn't listen frequently to the cloud. sometimes it receives a message, sometimes not. and when I sent multi messages very fast, the device receive all messages after a random delay. 

I tried to check the code if there is any configuration I can use to force the device to listen to Cloud always. but without luck. This behavior is in Active and Passive mode as well. 

My question is: How can the device receive messages instantly from the cloud without delay. 

Thanks in advance.

  • one thing I forget to mention is that this problem occurs only when PSM is enabled
    if PSM is disabled, the server receives always message from the device. 

  • Thanks for the summary, and sorry for the slow response.

    Have you tried to connect to other brokers (i.e. not AWS)?

    E.g. if you run the mqtt_simple sample (with PSM), do you see the same problem where the client is disconnected from the broker after being in PSM for > 300s?

    Attached is a slightly modified version of the mqtt_simple (from NCS v1.6.1) sample that connects to test.mosquitto.org with a keepalive period of 600s, and PSM. It will also print each time it calls mqtt_live, so it is easy to keep track of when it sends MQTT keepalive messages.

    mqtt_simple.zip

    On my end, it successfully sends a keepalive message after 10 minutes, so at least on my setup, it works as it should.

    If it doesn't work, can you share the application and modem log?

Related