Error while attaching a device to a gateway in IoT Central

Cédric Melançon 126 Reputation points
2020-12-08T19:05:35.613+00:00

Here are the steps I did:
1- I created an IoT Device template with some telemetry.
2- I created an IoT Edge device template with downstream devices with a relationship to the device defined in 1).
3- I created an instance of the device defined in 1).
4- I created an instance of the gateway defined in 2).
5- I tried to attach the device created in 3) to the gateway created in 4) and I get the following message:
"Invalid relationship for instanceof dtmi:modelDefinition:b1o7aiopn2:v2 between devices XXX and YYY with relationship Type undefined!
Error code: 400.390.006.023 / e1mnn1s5xl.6

Could anyone tell me what I did wrong?

I also have a technical question if I eventually manage to make this work: Is it possible to access the list of attached devices from an IoT Edge module code?

Azure IoT Edge
Azure IoT Edge
An Azure service that is used to deploy cloud workloads to run on internet of things (IoT) edge devices via standard containers.
531 questions
Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
342 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Sander van de Velde 28,236 Reputation points MVP
    2020-12-09T10:25:59.67+00:00

    Hello @Cédric Melançon ,

    I'm not sure what the problem related to the error message.

    Did you miss some sort of relationship Type setting?

    Regarding:

    I also have a technical question if I eventually manage to make this work: Is it possible to access the list of attached devices from an IoT Edge module code?

    An IoT Edge module is sandboxed, it has no direct knowledge about child devices.

    There are two options to work around this:

    1. You could provide a list of child devices to the module using eg. Module Twin desired properties (which are persisted in the Module Twin) or a DirectMethod (not persisted)
    2. Your module can build up a list over time while messages from child devices flow through the module (you have to check the 'var connectionDeviceId = message.ConnectionDeviceId' property for messages coming from child devices).

  2. AshokPeddakotla-MSFT 27,126 Reputation points
    2020-12-22T17:18:11.797+00:00

    @Cédric Melançon

    For the error, please ensure that you're sending the correct request body as part of the attestation flow, or use a device SDK.

    50459-image.png

    Also, I suggest you, please check the documentations Define a new IoT gateway device type in your Azure IoT Central application and Add an Azure IoT Edge device to your Azure IoT Central application for step-by-step guidance on adding the device to IoT Central.

    Do let us know if you have any further queries.

    If an answer is helpful, please "Accept answer" or "Up-Vote" for the same which might be beneficial to other community members reading this thread.