locked
how to differentiate messages received at the IoT hub - whether the message is from the device or from the solution backend? RRS feed

  • Question

  • in my scenario

    i using CRM that sends command to the device via iot hub .

    upon receiving the message at IoT hub, update the device and have a device response.

    the device response will look like this

    {
        "error": "No write permission(s) for field(s)",
        "type": "https://something.bla.com/doc/cloud/error-messages#no-write-permission",
        "message": "No write permission(s) for field(s): is_online",
        "instance": "07e751ec-bcbf-2020-5050-d674483dcfaf",
        "details": {
            "fields": "is_online"
        }
    }

    i want this response to be sent back to crm via iot hub ? how can i achieve this?

    can i send this response message back to IoT hub using "Device to Cloud" implementation ? if so how will the IoT hub recognise that this message is from the device and not from the cloud ??

    Friday, April 20, 2018 7:01 AM

All replies

  • Hello Bhuvaneswary,

    You can send device-to-cloud messages through a device-facing endpoint, and then read device-to-cloud messages from the built-in endpoint in your CRM. There are various SDKs,all the SDKs are open sourced and designed to be portable.

    IoT Hub allows you to create custom endpoints, messages are delivered to the endpoints based on routes configured on your IoT hub. So you can configure routing rules to send messages to custom endpoints in your IoT hub to distinguish the message is from where.

    Best Regards,

    Michael


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 23, 2018 2:44 AM