IOT Central not sending command

Rob Ashworth 1 Reputation point
2020-12-15T21:45:15.877+00:00

I'm a bit new to IOT, but I have finally managed after a bit of tinkering to get my actual device (STM32L475 Development board) talking to both the IoT Hub, and AzureIOT central.

I can receive telemetry ok, and in the IoT Hub I can send a command to turn and LED on/off - all fine so far...

When I try to send a command from AzureIOTCentral though it doesn't seem to get though. In IoT Hub, the command structure is (C2D) : {"Name":"LedOn","Parameters":{}} which seems to work fine.

I can't tell if AzureIOTCentral is actually sending the command at all , or if it is correctly formatted. Can anyone help, or point me at some info/training material?

Thanks

Azure IoT Central
Azure IoT Central
An Azure hosted internet of things (IoT) application platform.
357 questions
Azure IoT Hub
Azure IoT Hub
An Azure service that enables bidirectional communication between internet of things (IoT) devices and applications.
1,143 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Roman Kiss 2,246 Reputation points
    2020-12-17T17:31:37.5+00:00

    Hi @Rob Ashworth ,

    Try the following in your IoT Central App :

    • create the command in the default component like is shown in the following screen snippet:

    49148-iotc1.png

    Note, that the Queue if offline is On which it will generate a C2D message to the device via the device queue the same way like is done by IoT Hub with one more property on the topic such as the method-name=LedOn

    2 people found this answer helpful.

  2. Sander van de Velde 30,321 Reputation points MVP
    2020-12-16T00:09:48.257+00:00

    Azure IoT supports two ways to send C2D 'commands' to a device:

    48514-image.png

    1. Message to device is an async call that is sent to the device and picked up once the device is connected to the cloud. Hence, it is not possible to return a value back to the cloud with a response
    2. A Direct Method can send a message and the method waits for a (possible) response. The call can only be made if the device is connected at that exact moment.

    Both solutions make use of different logic on the device.

    Please double-check if you are using the same solution on both platforms.

    1 person found this answer helpful.
    0 comments No comments

  3. Rob Ashworth 1 Reputation point
    2020-12-17T21:14:48.223+00:00

    OK, so this works, I thought that the whole point behind IOTCentral was that these commands could be encoded into a GUI button press rather than having to type it in explicitly -not very user friendly.

    49332-ledon-command.png

    If this is the case, can anyone recommend a starting point for a Web App to make the user interface (DevOps etc...?).

    I'm more accustomed to Embedded C, if that helps.