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 configuration retrieval via mqtt #560

Open
SBlechmann opened this issue Apr 16, 2021 · 1 comment
Open

device configuration retrieval via mqtt #560

SBlechmann opened this issue Apr 16, 2021 · 1 comment

Comments

@SBlechmann
Copy link

SBlechmann commented Apr 16, 2021

Hey there,

in the user manual it says that a device can retrieve its configuration from the iotagent (which is then passed to the context broker).

The way of the device actively querying for its configuration via
topic: /json/apikey/deviceid/configuration/commands
payload something like: {"type": "configuration","fields": ["attr1", "attr2"]}
works perfectly fine, that's already pretty nice!

Then I discovered that the device can register itself at the iot-agent so it gets a notification whenever one of the given attributes changes via subscriptions.
So I did pretty much the same and but this time with
topic: /json/apikey/deviceid/configuration/commands
payload something like: {"type": "subscription","fields": ["attr1", "attr2"]}
I checked in orion and the subscription was indeed created.

When I now patch one of the attributes attr1 or attr2 orion sends a subscription (checked on orion's subscription path -> lastSuccess and lastSuccessCode). According to the IoT Agent DEBUG logs it also received that notification from orion but apparently doesn't know what to do with it. The data wasn't really processed.

Maybe I'm just missing a piece.. but I guess there is a bug.
Thanks for your help! :)

@jason-fox
Copy link
Contributor

I have created a highly insecure debug branch on my personal fork - try building it and checking what comes out in the log?

docker build -t iot-agent . \
    --build-arg GITHUB_ACCOUNT=jason-fox \
    --build-arg GITHUB_REPOSITORY=iotagent-json \
    --build-arg SOURCE_BRANCH=debug \
    --target=distroless|pm2|slim

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