AWS IoT Shadows

Hi all,

I am working on an application that uses AWS IoT via LTE/NB-IoT. I've got the connection working, and I can publish/read to un-named shadow topic and to custom topics.
Now I want to add some named shadows and get some more control over the whole communication. Two things are bothering me:
1. Can I treat named shadows the same way as un-named shadows, ie. have an easy way to subscribe to all of their topic instead of subscribing to each of them as custom topics. Could I use wildcards for custom topics, it seems to require the exact number of topics we want to subscribe to, that is something that doesn't work well with wildcards.

2. I don't want to subscribe to every un-named shadow topic. In the extreme case, I don't want to subscribe to any of those topics, so I set prj.conf in AWS IoT example like this:

# CONFIG_AWS_IOT_TOPIC_GET_ACCEPTED_SUBSCRIBE=n
# CONFIG_AWS_IOT_TOPIC_GET_REJECTED_SUBSCRIBE=n
# CONFIG_AWS_IOT_TOPIC_UPDATE_ACCEPTED_SUBSCRIBE=n
# CONFIG_AWS_IOT_TOPIC_UPDATE_REJECTED_SUBSCRIBE=n
# CONFIG_AWS_IOT_TOPIC_UPDATE_DELTA_SUBSCRIBE=y
# CONFIG_AWS_IOT_TOPIC_DELETE_ACCEPTED_SUBSCRIBE=n
# CONFIG_AWS_IOT_TOPIC_DELETE_REJECTED_SUBSCRIBE=n

However I still get data received event for each one of those topics. Any idea on what could cause that behavior?

Cheers

Aleksa

Parents
  • Hi!

    Yes, they behave exactly the same.

    You can subscribe to all shadow topics of a device using the wildcard topic for the device: "$aws/things/<deviceId>/shadow/#". However you most likely only want the delta topics: "$aws/things/<deviceId>/shadow/+/update/delta" will subscribe to all named shadow deltas. You should not mix named and classic shadows.

    The number of topics in the firmware is needed to reserve space for the topic string, and a wildcarded topic also counts as 1 (one) topic.

    Best regards,

    Heidi

  • Hi Heidi!

    Thanks for a fine answer. However if I want to subscribe to named shadow deltas, shouldn't it be:
    "$aws/things/<deviceId>/shadow/name/+/update/delta"
    I am unable to receive messages yet from named shadows. Hopefully will get there soon.

    Best Regards,

    Aleksa 

Reply Children
Related