Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Device shadow implementation in existing MQTT protocol. #1908

Open
raviraj78 opened this issue Apr 12, 2024 · 1 comment
Open

Device shadow implementation in existing MQTT protocol. #1908

raviraj78 opened this issue Apr 12, 2024 · 1 comment

Comments

@raviraj78
Copy link

How to implement the device shadow property in the existing mqtt protocol. Hey actually i have a project in which mqtt is implemented, i want to use the device shadow property in this. And we are doing all the stuffs from the device side like registering things, subs/pubs topics, and the things is getting updated dynamically after the fleet provisioning of different devices. How to proceed with it, we are not using any sdk or anything. we are just doing it in a embedded c language.

@AniruddhaKanhere
Copy link
Member

Hello @raviraj78,

If you have created thing in IoT core and have a functional MQTT library which can connect to AWS IoT, then you can use the Device Shadow feature. It is independent of whether you are using SDK or not.

You can update/create/get the device shadow by publishing/subscribing as necessary to the reserved topics listed here.

You can read about the device shadow service in depth here. Your application must utilize the timestamp/version fields of the JSON/cbor document received to make sure that there are no race conditions in case there are multiple updates to the device shadow.

You can use the https://github.com/aws/Device-Shadow-for-AWS-IoT-embedded-sdk library to create and match the topic string related to your device. It might make your application a bit simpler.

Thanks,
Aniruddha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants