I am trying to use Direct Method to invoke device OTA The device I am using is Quectel EC21 and subscribe to the topic "$iothub/methods/POST/#" When I Invoke the method in Azure IoT explorer,I always get the time out fail message that "message":"Timed out waiting for device to connect." enter image description here
This error message confused me since I expect my device receive the method payload through MQTT from topic "$iothub/methods/POST/#" but I received nothing. But at he same time, I can receive normal cloud to device MQTT message through topic "devices/deviceID/messages/devicebound/#" So, is the Direct method connection and Iot hub connection are different connection?
$iothub/methods/POST/#
is the correct topic, and you should receive a message there. The timeout will occur if you don't to respond to the message. But if I read your question right, you are not even receiving the message on the device right now? Can you include some code? – Matthijs van der Veer$iothub/methods/POST/#
is correct. Your method will eventually come in as$iothub/methods/POST/methodname/?$rid=1
. One important thing to note, if your device does receive the message but does not respond to it, IoT Hub will consider it a timeout. – Matthijs van der Veer