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.

Parents Reply
  • Here is what the modem team said:

    With given information I am not able to comment anything very meaningful. TLS connection is established and UE sends 708 bytes to server. This is acked by the server, but nothing more really. Seems that server is not responding or data is lost somewhere in the path.

    After twenty minutes there are weird TCP transmission to unseen segments. I think the log is not complete and some parts are missing. TCP segment from UE to server jumps from 185 to 3018 which is not possible.

    At this point, I feel like the ticket has gone on long enough that it is time to take a tep back and try to get an overview of where we are. Could you try to sum up the problem you are seeing?

    What are you trying to do, and what is happening?

    What application FW are you suing, which SDK version is it based on, and what modem FW version are you using?

Children
  • Hey Didrik, 

    You are right this issue took a long time. here is the summarize of the problem when CONFIG_MQTT_KEEPALIVE is set for more than 300 sec then the server ( AWS IoT ) doesn't receive any message from the device, even though the device log shows that message is sent successfully. 

    we tried with T-mobile and KPN in NL and both are almost the same except in the T-mobile network the device lost connection after 300 sec when CONFIG_MQTT_KEEPALIVE > 300 sec. but in the KPN network the device doesn't show any error. In both networks, the server doesn't receive anything after 300 sec 

    our project is based on Low power consumption so we need to set CONFIG_MQTT_KEEPALIVE  to a max of AWS limit and that is 1200 sec. but it doesn't work when it is initialized for more than 300 sec.

    we use

    SDK = nrf 1.6.1,

    modem version 1.3.0
    Mqtt server: AWS Iot mqtt 

    LTE-M network: KPN and T-mobile in NL 

    app: asset_tracker_v2

  • 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