Updated on 2023-03-10 GMT+08:00

Online Debugging

Overview

After the product model and codec are developed, the application can receive data reported by the device and deliver commands to the device through the IoT platform.

The IoTDA provides application and device simulators for you to commission data reporting and command delivery before developing real applications and physical devices. You can also use the application simulator to verify the service flow after the physical device is developed.

Debugging a Product by Using a Virtual Device

When both device development and application development are not completed, you can create virtual devices and use the application simulator and device simulator to test product models and codecs. The structure of the virtual device testing interface is as follows:

  1. On the product details page, click the Online Debugging tab and click Add Test Device.
  2. In the Add Test Device dialog box, select Virtual device for Device Type and click OK. The virtual device name contains DeviceSimulator. Only one virtual device can be created for each product.

  3. In the device list, select the new virtual device and click Debug to enter the Online Debugging page.

  4. In Device Simulator, enter a hexadecimal code stream or JSON data (for example, enter a hexadecimal code stream) and click Send. View the data reporting result in Application Simulator and the processing logs of the IoT platform in Message Tracing.

  5. Deliver a command in Application Simulator. View the received command (for example, a hexadecimal code stream) in Device Simulator and the processing logs of the IoT platform in Message Tracing.

Debugging a Product by Using a Physical Device

When the device development is complete but the application development is not, you can add physical devices and use the application simulator to test devices, product models, and codecs. The structure of the physical device testing interface is as follows:

  1. On the product details page of the smoke detector, click the Online Debugging tab and click Add Test Device.
  2. In the Add Test Device dialog box, select Physical device for Device Type, set the parameters of the device, and click OK.

    Note: If DTLS is used for device access, set Registration Mode to Encrypted and keep the secret properly.

    The newly added device is in the inactive state. In this case, online debugging cannot be performed. For details, see Device Connection Authentication. After the device is connected to the platform, perform the debugging.

  3. Click Debug to access the debugging page.

  4. Simulate a scenario where a control command is remotely delivered. In Application Simulator, Set Service to StreetLight, Command to SWITCH_LIGHT, and Command Value to ON, and click Send. The street lamp is turned on.