Simple Debugging

Last Updated on : 2023-12-01 06:37:16download

To perform an OTA firmware update, the flash memory is erased and written with the update file. Then, the system is restarted to make the update take effect. This is a time-consuming process. You can extract the gateway.tar.gz to the working directory and run the program manually. This can reduce debugging time.

  1. Install TFTP Server on your computer and place gateway.tar.gz in the directory where TFTP Server resides.

  2. Log in to the THP10-Z-X backend using a serial port. For more information, see Log in via Serial Port.

  3. In the THP10-Z-X backend, run the following command to download the archive.

    cd /tmp && tftp <tftp server IP address> -gr gateway.tar.gz

  4. In the THP10-Z-X backend, run the following command to stop the program.

    /tmp/tuya/tuya_user1/app_stop.sh

  5. In the THP10-Z-X backend, run the following command to extract the archive.

    cd /tmp && echo "tuya_start_dir=/tmp/tuya/tuya_user1" > /tmp/tuya/start.conf;tar -C /tmp/tuya -xvf gateway.tar.gz

  6. In the THP10-Z-X backend, run the following command to start the program.

    /tmp/tuya/tuya_start.sh /tmp/tuya

    You can run ps to check if tyZ3Gw works properly.

  7. In the THP10-Z-X backend, run the following command to print real-time logs.

    tail -f /tmp/tuya.log