Closed LazarusX closed 6 years ago
It's my understanding that they are moving to module twins. So you need to look at the status of your deployed modules vs the general device hosting the modules.
What @grtn316 said is true for devices running the IoT Edge runtime: it communicates with IoT Hub as a module on the device (edgedevice/$edgeAgent), not as the device. Modules have identity and a twin just like devices, although modules are scoped to a device while devices are scoped to the hub.
See Azure/azure-iot-sdk-csharp#324
Below screenshot shows the module twins for $edgeAgent (left) and filterModule (right) respectively:
Still, filterModule can successfully send D2C messages, and shown as "connected", but the $edgeAgent is shown as "disconnected".
In addition, there is a warning on the portal saying:
"Warning: Your device is disconnected from this IoT Hub. The information displayed below is not up to date. You can go to the device twin to see the last update time. If you have not set up your IoT Edge device, please follow IoT Edge QuickStart instructions. If you have already set up your device, please check device connectivity.".
Does this mean that just because the Edge module can send D2C dose not mean the Edge device or the Edge modules are connected? How can I get them connected again?
By the way, this happens after I woke my laptop from sleep which ran the Edge runtime before sleep. Could this be the cause?
We'll need to investigate this more; we're hearing some similar reports through other channels too.
Each module manages its own connection ($edgeAgent connects to IoT Hub, $edgeHub connects to IoT Hub and receives connections from other devices/modules, the simulated temp sensor connects to $edgeHub...) so you may have run into a situation where the sensor module was able to maintain its connection but the Edge Agent was not. It may have been due to the laptop sleep, but it's hard to say for certain.
The fact that your Edge Agent module lost its connection probably explains why the portal warns that your device is disconnected when it (kind of) isn't.
I suspect this is a bug in Edge Agent, but we need to investigate. We'll let you know if we need specific information from you.
Thanks Damon for the update.
I think my $edgeAgent should be actually connected, because when this error happened $edgeAgent could still receive and apply new module deployment from the cloud.
OK, let me summarize to make sure I understand what you're saying:
connectionState
as Disconnected
, and the portal cannot ping it (warning message in Device Details pane)Does this sound accurate?
Almost correct, but filterModule is the module to send data to IoT Hub.
All modules ($edgeHub, $edgeAgent, tempSensor, filterModule) seem to function well, but are shown asDisconnected
except filterModule.
Hi, I think I had a similar issue. I have a Modbus module(source of data) running over 24 hours and seems still be able to report D2C messages to IoT Hub(verified with Device Explorer). However, the edge device is reported disconnected on the Azure Portal and setting a module twin update doesn't work. Another thing I noticed is that there are around 900 messages being cleared from the queue each time edgeHub reestablish connection with Modbus module. I am attaching full logs for your reference.
Thanks.
same issue. The status of edge device is disconnected but the D2C message received successfully on IoT Hub. Edge Device Twin:
"deviceId": "EdgeDevice01", "etag": "AAAAAAAAAAE=", "deviceEtag": "MzQ4NTc1MzA4", "status": "enabled", "statusUpdateTime": "0001-01-01T00:00:00", "connectionState": "Disconnected", "lastActivityTime": "2018-07-16T06:51:38.0643715",
Did you check the credentials you provided (registry password and sharedAccessKey for your modules) in your deployment manifest.json ? I had the same issue because of a typo error in the password.
Closing the issue due to lack of activity and also because it's on v1 repo. Please, if this issue still repro, can you move to gateway v2 repo? Here is the link: https://github.com/Azure/iotedge
I have my laptop simulate an Edge device, and follow the tutorial to create Edge deployment. My Edge device can successfully send D2C messages, and receive new deployments from the cloud. But by looking at the device twin, it is last updated about 7 hours ago, and thus listed as disconnected on Azure Portal, as the below screenshot shows:
How can I troubleshoot and get my device twin to show the correct information?