-
Notifications
You must be signed in to change notification settings - Fork 66
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
[bug] Issue sending device to cloud messages #327
Comments
Hey @ericvruder - sorry for the delay in responding. We're doing a bit of work refactoring our c2d message internals, but I'll make sure we look into this. Could you kindly verify this issue still reproduces? Just to make sure it wasn't a transient connectivity or service error. |
Yes, after updating both my az cli and az iot cli, it still fails with the same message.
|
@ericvruder thanks - one more question, are you using a non-symmetric key authenticated device? Our MQTT messaging and device simulation currently aren't compatible with certificate-based authentication - we have code merged in to display this as an error when sending messages but it hasn't been released as of yet. |
They are all authenticated with symmetric keys. I tried without sending a --login parameter, which would result in it using the iothubowner policy, which has all permissions. This is the example I sent you. If I used the --login parameter with the connection string for the iothubowner policy, it would result in almost the same error.
It's just missing the "using iothubowner policy" that was present before. If I try to use one of the connection strings from the device, it complains that it is missing the SharedAccessKeyName property from the connection string.
|
@ericvruder sorry for the back and forth - but are you using a device connection string for this command or a hub connection string? This command requires an IoT Hub connection string (essentially, I understand it's a bit confusing in this aspect , as other device simulators / SDKs ask for a device connection string to simulate the device, but in this case we use the |
Hey @c-ryan-k , Don't worry about it! I'm having a blast working with the iot hub, so I am more than happy to help in any way I can. So, the original attempt was without the
I then went into the Shared access policies tab and grab the connection string for the policy it mentioned above. This is the connection string I used: If we say that the connection string's value for that policy is CONNSTRING, I would then use the following command, exactly, to try and send a d2c message; az iot device send-d2c-message -d 'PC0167878' -l 'CONNSTRING' We can see here that the device does exist in the IoT devices tab: This would lead to the following error:
Using the device's connection string, as you mentioned, leads to the |
Describe the bug
I am having an issue sending device to cloud message (send-d2c-message) to my iot hub.
To Reproduce
The following commands fails
az iot device send-d2c-message -n 'hub-name' --data 'hello' -d 'device-name' --verbose
With the following message:
If I change the hub name, it fails with the following message:
So it's not a incorrect hub name
If I change the device id to one that is not registered, then it fails with the same message, so I can't confirm whether or not that is the issue. Although I am copy-pasting from the device overview tab in the hub.
Expected behavior
Expect the message to be sent through
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: