-
Notifications
You must be signed in to change notification settings - Fork 463
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
Question: Cloud to device/module communication with iot-edge #205
Comments
You can send cloud-to-device (C2D) messages to leaf devices connected to an Edge device in a gateway scenario. However, C2D messages are not supported on modules at the moment. |
Thx for the answer. HOSTNAME= Any idea how I could get these values in a running module container ? |
Hi @mrlux , We don't expose edge Device Connection String (or any other connection string) for security reason. If you want to have a module that uses device client (instead of module client), you would have to have an (our of band) way to have the device connection string in a module. Since we don't support C2D to modules you wouldn't be able to use a module to receive a message that it's destination is a device. You can't get (from edge) Iot hub connection string from the edge Agent. We don't even have iothub connection string configured into edge (For the manual configuration, the connection string we use is the edge connection string, but that remains stored into iotedged (our security daemon)). Thanks, Angelo Ribeiro. |
Hi, I was able to solve/work around this limitation by binding the /etc/iotedge folder in my module container and by using the NetEscapades.Configuration.Yaml extension read this from my configuration Code: try
{
_configuration = new ConfigurationBuilder().SetBasePath(Directory.GetCurrentDirectory()).AddYamlFile("config/config.yaml", optional: false).Build();
var deviceConnectionString = _configuration.GetSection("provisioning:device_connection_string").Value;
await ReceiveCommandAsync(DeviceClient.CreateFromConnectionString(deviceConnectionString));
}
catch (Exception e)
{
Console.WriteLine(e);
} Container configuration:
|
I'm going to close this issue because I think the workaround you provided will work for this scenario. Some further research is required to understand how the runtime can provide access to the device credentials in a secure manner. Please feel free to reopen if you have concerns. |
Hey @myagley, does the team have any recommendation / update within this scenario? I would like to take use C2D communication with my iot edge modules (now are supported) but taking adavantage of the IoT Hub Jobs to be able to create a job targeting multiple IoT Edge devices. Since Jobs can only be created by using a DeviceClient connection and only targets Device direct methods, I will require the IoT Hub Device Connection String. By the way, it would be great if the DeviceClient would create a connection to IoT Hub device in the same way the ModuleClient do it: Thanks in advance. |
I was wondering if it is possible to send messages from the cloud to an iot device running iot edge ?
I know it can be done with iot hub link. I still need to try this out but I was wondering if this is by default supported or planned to be supported in the iot-edge-hub.
The text was updated successfully, but these errors were encountered: