Azure Iot Rest API 从云到设备的消息

Azure Iot Rest API Message from cloud to device

得到:https://myiot.azure-devices.net/devices/mydevice/messages/devicebound?api-version=2016-02-03

授权:SAS 密钥

我收到 204 上面没有内容响应 api 使用邮递员请求制造商从云端接收消息时 device.When 我将消息从设备发送到云端 它出现在我的物联网中心但是给从云端接收消息时出现错误 204。

首先,如果您还没有发送云到设备消息并且您通过调用 GET api(https://myiot.azure-devices.net/devices/mydevice/messages/devicebound?api-version=2016-02-03) 得到无内容响应(错误 code:204)。这是预期的。意思是the server has fulfilled the request, but there is no new information to send back.

其次,您想接收您发送的设备到云消息。它是遥不可及的。因为这个 GET api 是用来接收 Cloud-To-Device 消息的。

简而言之,设备到云和云到设备是 Azure IoT 中心提供的用于与设备通信的不同消息传递原语。并且 Azure IoT 中心本身不支持您想要的设备到设备通信。

最后,如何发送Cloud-To-Device消息?

出于测试目的,您可以send Cloud-To-Device message from Device Explorer. More detailed information you can reference here