🏆 Join the TuyaOpen AI Hardware Contest! 100 days to build the future of AI devicesLearn More →
Skip to main content

Device Debugging

Overview

This topic describes how to use serial port debugging tools to capture device logs for issue tracking and troubleshooting. After completing TuyaOpen firmware flashing, serial debugging serves as an effective method for troubleshooting device issues.

Currently, the IoT and AI+IoT chips supported by TuyaOpen do not support J-Link debugging tools. Instead, they use serial port logging for debugging.

Preparation

Before you begin debugging, make sure you have the following resources ready:

Hardware devices

Debugging tools

Choose one of the following serial debugging tools:

  • Tuya's universal serial tool: Graphical interface, easy to operate.
  • TuyaOpen command line tos tool: Command-line based, powerful functionality.
  • Third-party tools: SSCOM, MobaXterm, PuTTY, and more.

Configure debugging parameters

Serial parameter reference table

Before starting debugging, look up the debugging parameters based on your chip model.

Chip modelSerial portBaud rateRemarks
Ubuntu--Run directly on Ubuntu and other Linux hosts
T2Uart2115200-
T3Uart1460800-
T5AIUart1460800-
ESP32/ESP32C3/ESP32S3Uart0115200-
LN882HUart1921600-
BK7231NUart2115200-

Select the correct serial port and baud rate. Otherwise, you may not be able to obtain log information as expected.

Debugging process

Method 1: Use Tuya's universal serial tool

You are recommended to use the graphical serial port debugging tool provided by Tuya, which features a user-friendly interface and complete functionalities.

For more information, see Serial Debugging Tool User Guide.

Method 2: Use the tos command-line tool

This method is suitable for developers familiar with the command line, offering more flexible debugging options.

For more information, see the tos monitor command.

Method 3: Use a third-party serial port tool

If you prefer using other serial port debugging tools such as SSCOM, MobaXterm, and PuTTY, refer to the respective tool's documentation for configuration.

Debugging tips

  • Check connection: Ensure hardware connections are correct and serial cables are undamaged.
  • Match parameters: Configure serial port parameters strictly according to the specifications in the table above.
  • Analyze logs: Focus on startup logs, error messages, and exceptional outputs.
  • Record problems: Promptly record problems identified and solutions implemented during the debugging process.

Troubleshooting: If you cannot get serial port output, please check hardware connections, serial port parameter settings, and driver installation.