问题
I have a Azure IoT Hub with 2 Devices. I send a Message from a RaspberryPi to another Device.
How do I know that the message was received from the other Device?
回答1:
You can refer to the Device Explorer tool, which is open sourced.
If you want to monitor if an IoT device is reachable by the IoT Hub, you can got to "Message To Device" tab, select the IoT device in the Device ID tab, and make sure you checked "Monitor Feedback Endpoint". Whenever a message is sent from the IoT Hub to the device, and callback(feedback) message will be showing the status of the message.
If you want to do it programatically, refer to the DeviceExplorer source code https://github.com/Azure/azure-iot-sdks/tree/master/tools/DeviceExplorer/DeviceExplorer, the monitor code MainForm.cs, from line 726.
回答2:
There is a cross-platform Azure IoT Toolkit extension for Visual Studio Code to make you able to monitor whether the message is sent to Azure IoT Hub. You could send C2D message and Direct Method to your device. Also, you could see whether the device is connected or disconnected.
来源:https://stackoverflow.com/questions/39100278/how-do-i-know-if-my-device-in-azure-iot-hub-is-reachable