Kevin Saye
Kevin Saye

Reputation: 321

Azure IoT Edge with Nested Edge: How to send parent to child message

Using IoT Edge in a Nested Edge setup, I am able to send a message from a module (named senderModule) on the child IoT Edge to a module (named receiverModule) on the parent IoT Edge simply by putting the following route on the parent IoT Edge:

FROM /messages/modules/senderModule/outputs/output1 INTO BrokeredEndpoint("/modules/receiverModule/inputs/input1")

I cannot go the opposite direction (parent to child). Is there something I am missing?

Upvotes: 0

Views: 410

Answers (1)

Sairam Tadepalli
Sairam Tadepalli

Reputation: 1683

There is no communication allowed from parent to child. In IoT edge communication, we can't send messages from Parent to Child. IoT edge routing is not supportive to parent to child communication.

If your downstream device is another IoT Edge device, then in the deployment manifest routes send any messages INTO $upstream that you want to go to the gateway device.

The alternative procedure is

  1. Send direct message from IoT edge module
  2. Direct message from IoT hub

C# code -> https://github.com/Azure-Samples/azure-iot-samples-csharp/tree/main/iot-hub/Samples/device/MethodSample

Python Code -> https://github.com/Azure/azure-iot-sdk-python/blob/main/azure-iot-device/samples/sync-samples/receive_direct_method.py

These two code blocks may help you for establishing direct communication.

Upvotes: 1

Related Questions