Laser Robot Vacuum SDK Quickstart

Last Updated on : 2022-01-16 08:05:48download

This topic describes how to develop with the SDK for a laser-guided robot vacuum with the Ubuntu system.

Laser Robot Vacuum SDK Quickstart

Preparation

  • Install Ubuntu and GCC compiler. The examples in this topic use Ubuntu 18.04 and GCC 7.5.0.

    Laser Robot Vacuum SDK Quickstart
  • Get the SDK.

Procedure

  1. Edit the demo in the SDK. Open the tuya_iot_soc_dev_entry.c and update values of PRODUCT_KEY, UUID, and AUTHKEY with those you obtained from the Tuya IoT Development Platform.

    Laser Robot Vacuum SDK Quickstart
  2. Check the name of the network interface on Ubuntu using a command.

    Laser Robot Vacuum SDK Quickstart
  3. Open the tuya_iot_wifi_net.c and change the value of WLAN_DEV to the name of the Ubuntu network interface.

    Laser Robot Vacuum SDK Quickstart
  4. Run the following command to build the code.

    sh build_app.sh demos/demo_soc_dev_wifi demo 1.0.0

    The following table lists the description of each parameter.

    Parameter name Desription
    build_app.sh The build script.
    demos/demo_soc_dev_wifi The relative path to the application code.
    demo The name of the generated executable file.
    1.0.0 The firmware version number.

    After the build is finished, the following information will be output.

    Laser Robot Vacuum SDK Quickstart
  5. Run the build.

    ./output/demo_1.0.0/demo

    Laser Robot Vacuum SDK Quickstart

    If the program is run well and enters the access point (AP) mode, the output will look like this:

    Laser Robot Vacuum SDK Quickstart

    By default, the SDK for Ubuntu only supports pairing through the AP mode.

  6. Now, you are good to pair your device by using the mobile app. The following figure shows the pairing process.

    Laser Robot Vacuum SDK Quickstart

    The app will be updated from time to time with new features and improvements, so the interface on the latest app prevails.

Test functions

Tap the Smart button on the app. The output on the Linux terminal will display the data point (DP) command from the cloud.

Laser Robot Vacuum SDK Quickstart Laser Robot Vacuum SDK Quickstart

FAQs

  • I got a 6668 error. How to fix it?

    Run sudo netstat -anp |grep 6668 and terminate the process that uses the 6668 port.