Debug cloud-enabled smart devices

Updated at:

This topic describes how to use virtual or real devices from the IoT Platform to debug a product's Thing Specification Language (TSL) model.

Prerequisites

You have added a test device. For more information, see Add a test device.

If you debug a real device, connect it to the platform. For more information, see Connect a device to the platform.

Background information

After developing a device, you can debug it to test whether it can correctly sync with the IoT Platform and handle property and service invocations.

When you select a cloud-enabled smart app for human-computer interaction, you can choose to debug a real or virtual device.
  • When you debug a real device, the device must be flashed with firmware and provisioned with a device certificate. You can use one of the 50 free activation codes provided by the platform to activate the device. These 50 activation codes (ProductKey, DeviceName, and DeviceSecret) can be used only for debugging and not for mass production.
    Note A device certificate, also known as a trituple, contains a ProductKey, a DeviceName, and a DeviceSecret.
  • If you use a virtual device, you can start it directly from the device debugging page in the IoT Platform console to debug the TSL model.

Procedure

  1. Log on to the IoT Platform console.
  2. Go to the Device Debugging page of the product.
  3. Click Debug or Online Debugging for the device to open the device debugging page.
  4. Click Cloud-enabled Smart Device Debugging. In the Debug Device drop-down list, select a device.
  5. Debug the device online in one of the following two ways.
    • Debug a real device

      On the Debug Real Device tab, select the features and methods of the device, and then click Send Instruction. After the "Instruction sent successfully" message appears, the real-time logs are displayed on the right.

      Note Before you debug a real device, connect it to the platform and complete operations, such as network configuration. For more information, see Connect a device to the platform.
    • Debug a virtual device

      On the Debug Virtual Device tab, click Start Virtual Device.

      Messages can be pushed to the virtual device in the following two ways.

      • Push

        Configure the parameters and click Push. The real-time logs are displayed on the right.

      • Policy-based push

        Configure the parameters, click Policy-based Push, and then configure the push method.

        A policy-based push is automatically sent at a scheduled time. Policy-based pushes are categorized as follows:

        • Scheduled push

          An automatic push is sent at a specified future time.

        • Continuous push

          Pushes are sent continuously at a specified interval within a future time range.