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

NRF9160 aws_iot sample: mqtt topic add does not work

Hi,

I use the latest connect sdk 1.4.0 and modem firmware 1.2.2. If I load the default aws_iot code it does not subscribe to the topics set in "topics_list" in the code. However the device is somehow still subscriped to a topic I set with an older firmware with mqtt_simple example and still gets messages. This behaviour does not chance even after reset and completely erease of the device. 

So my quess is the topic subscription is set in the modem part and does not get reset with the aws_iot sample. What could be the issue?

Best regards

  • Are you able to reproduce this behavior on some other hardware, like another DK or similar?

  • Hi Hakon,

    I tried now from scratch. SDK 1.4.1 with both aws_iot sample and aws_fota (with normal mqtt implementation). I tried it on a new chip nrf9160 SIBA (newest modem firmware) from our hardware Prototypes.

    If I install aws_fota and change only RTT Support, NBIOT Connection and a function for subscription, it works finde. I can talk to my device from aws via the subscribed topic.

    If I now install aws_iot (RTT enabled, NBIOT Connection) with the array to subscribe a new topic in first slot and in second slot the same topic as in aws_fota I only get response on the second topic thats the same like in fota sample. Also the same after power disconnect.

    I attached both samples here as files.

    aws_fota-aws_iot.zip

  • I found the Solution. I need to set: CONFIG_MQTT_CLEAN_SESSION=y and it works. I think the persistend default session option leads to the point where the device identifies at aws and gets the same topics as somewhere set before. this also explains why it survives all resets. Maybe there is a better explanation but these are my thoughts

    Edit: Not shure what others use but I don´t think the persistend session as a default option is a good idea

Related