After you configure a physical device, you can use IoT Platform to debug the device online. You can push commands to the device from the IoT Platform console. This article describes the online debugging procedure.

Limit

Only devices that are connected over MQTT can be used for debugging.

Feature debugging

  1. Log on to the IoT Platform console.
  2. In the left-side navigation pane, choose Maintenance > Online Debug.
  3. On the Online Debug page, select the device that you want to debug.
  4. Click the Property Debugging or Service Calls tab. On this tab, select a TSL model from the Module drop-down list.
    Online debugging in IoT Platform
    Feature type Operation
    Property Debugging
    Notice You must have the read and write permissions on the property that you want to manage. The available operations include Set and Set expectations.
    • Get: obtains the latest value of a specified property from the device. If the device does not have a value for the property, no value is displayed in the field.

      On the right side of a property field, click Debugging. Then, click Get.

    • Set: sends a command to set a property value from IoT Platform to the device. After the device receives the command, the device sets the property and submits the latest property value to IoT Platform.

      Enter a value in a property field and click Debugging. Then, click Set.

    • Set expectations: sends a command to set a desired property value from IoT Platform to the device

      Enter a value in a property field and click Debugging. Then, click Set expectations.

      • If the device is online, it receives the command, updates the property value, and then submits the new property value to IoT Platform.
      • If the device is offline, it obtains the desired property value after going online, updates the property value, and then submits the new property value to IoT Platform.

    You can also click Get, Set, or Set expectations below all property fields to debug multiple properties.

    Service Calls
    1. Select the service that you want to debug from the Debug Feature drop-down list.
    2. In the field, enter the input parameters of the service. Then, click Send Command.

      The input parameters must be in the JSON format. Example: {"Switch":0}.

    After you push the command, you can view the operation logs in the Real-time Logs section on the right side of the page. On the TSL Data tab of the Device Details page, you can view the debugging results.

    The following figure shows how to debug properties. Enter a property value, click Debugging on the right, and then click Set.

    Real-time logs