Azure/iotedge

connectionState in $edgeAgent's module twin should be connected

blackchoey opened this issue · 7 comments

Expected Behavior

If $edgeAgent module is running and the connectionState of other modules on Edge device is connected, the connectionState of $edgeAgent should also be connected.

Current Behavior

The connectionState of $edgeHub and custom modules are all connected, but connectionState of $edgeAgent is disconnected

Steps to Reproduce

Provide a detailed set of steps to reproduce the bug.

  1. Create an Ubuntu 16.04 with IoT Edge runtime VM and config device connection string for it
  2. Create a deployment for this device
  3. Check the connectionState in module twin for all the modules after a while
  4. $edgeAgent is disconnected and all other modules are connected

Context (Environment)

The environment is same as Ubuntu 16.04 with IoT Edge runtime image. Skip the environment questions.

Connection status is set by the module sending telemetry, and edgeAgent module does not send telemetry. The current recommendation for 1.0.9 is to use the ping direct method

Thank you @ancaantochi So in order to check connection state for the modules, I need to

  1. Call the ping direct method for $edgeAgent module
  2. Get module twin of remaining modules and check the connectionState property in module twin

Am I understanding correctly?

Get module twin of remaining modules and check the connectionState property in module twin

What is the goal for this? What if the module is not using the IoT SDK?

We have samples with smoke test to check the status of an IoT Edge deployment. Now the smoke test is broken since $edgeAgent's connectionState is alwasy disconnected.
The module in the samples is using IoT SDK, so we don't need to consider scenarios with no IoT SDK in this case.

In that case the ‘ping’ direct method should work.

Note, even if the module uses IoT SDK if it doesn’t send D2C telemetry it will show up as disconnected.

Thank you very much

I will close this issue as it looks the question was answered, please reopen if needed.