All Products
Search
Document Center

:SDK Demo

Last Updated:Sep 19, 2023

You can use LinkVisual device SDKs for Ubuntu and Docker to implement features provided by instances of the video type. This topic describes how to use SDK demos for trial use.

Prerequisites

A product and device are created in the IoT Platform console. For more information, see Device Connection.

Download the SDK demo

You can select a demo based on your requirements.

Demo

Description

Download link

Ubuntu Demo

The demo must run in Ubuntu 18.04. We recommend that you install a distribution that has been tested by Alibaba Cloud to avoid compatibility issues.

LinkVisual SDK Ubuntu Demo

Docker Demo

The demo is compatible with multiple operating systems. You can install Docker on Windows, macOS, or Linux to use the demo.

LinkVisual SDK Docker Demo

Procedure for using the Ubuntu demo

  1. Download the demo package of LinkVisual SDK for Ubuntu.

    Note

    The name of the downloaded demo package is lv_2.1.2-lk_2.3.0-ubuntu.tar.gz.

  2. Run the tar -xf lv_2.1.2-lk_2.3.0-ubuntu.tar.gz command to decompress the package into a folder.

  3. Run the cd lv_2.1.2-lk_2.3.0-ubuntu command to open the folder. The following script describes the directory structure.

    1.jpg                 
    avc_aac_1000k
    avc_aac_1000k.index
    avc_aac_1000k.meta
    avc_aac_500k
    avc_aac_500k.index
    avc_aac_500k.meta
    link_visual_ipc
  4. Run the ./link_visual_ipc -p ${YourProductKey} -n ${YourDeviceName} -s ${YourDeviceSecret} command to activate your device and connect it to LinkVisual.

    The following table describes the parameters:

    ${YourProductKey}

    ProductKey

    g18l****

    When the device is connected to LinkVisual, the device certificate information is saved. For more information, see Result. You can also view the information on the Device Details page in the IoT Platform console.

    ${YourDeviceName}

    DeviceName

    Device1

    ${YourDeviceSecret}

    DeviceSecret

    b2e6e4f1058d8****

    The following log indicates that the operation is successful. Sample success response

  5. Perform the following steps on the Device Details page in the IoT Platform console to view the device status:

    1. Log on to the IoT Platform console.

    2. On the Instance Overview page, find the instance and click the instance name to go to the Instance Details page.

    3. In the left-side navigation pane, choose Devices > Devices.

    4. On the Devices page that appears, click the name of the device that you want to manage. The Device Details page is then displayed.

    5. Click the TSL Data tab. You can view the Thing Specification Language (TSL) data on the Status tab. After several minutes, you can click the Events tab to view the intelligent alert events.

Procedure for using the Docker demo

  1. Install Docker.

    Note

    You must install Docker to use the demo.

  2. Download the demo package of LinkVisual SDK for Docker.

    Note

    The name of the downloaded demo is lv_2.1.2-lk_2.3.0-docker.tar.gz.

  3. Run the docker load -i lv_2.1.2-lk_2.3.0-docker.tar.gz to import the Docker image.

    Loaded image: ubuntu:lv_2.1.2-lk_2.3.0 is displayed if the previous operation is complete.

  4. Run the docker run -it --rm ubuntu:lv_2.1.2-lk_2.3.0 bash command to run the image and access the container generated from the image.

  5. Run the cd /home command to enter the /home directory.

  6. Run the following commands to decompress the demo package and then open the decompressed file.

    tar -xvf lv_2.1.2-lk_2.3.0-ubuntu.tar.gz
    cd lv_2.1.2-lk_2.3.0-ubuntu
  7. Run the ls command. The demo file contains the following content:

    1.jpg
    avc_aac_1000k
    avc_aac_1000k.index
    avc_aac_1000k.meta
    avc_aac_500k
    avc_aac_500k.index
    avc_aac_500k.meta
    link_visual_ipc
  8. Run the ./link_visual_ipc -p ${YourProductKey} -n ${YourDeviceName} -s ${YourDeviceSecret} command to activate your device and connect it to LinkVisual.

    The following table describes the parameters:

    ${YourProductKey}

    ProductKey

    g18l****

    When the device is connected to LinkVisual, the device certificate information is saved. For more information, see Result. You can also view the information on the Device Details page in the IoT Platform console.

    ${YourDeviceName}

    DeviceName

    Device1

    ${YourDeviceSecret}

    DeviceSecret

    b2e6e4f1058d8****

    The following log data indicates that the operation is complete.

    Results of running the Docker demo
  9. Perform the following steps on the Device Details page in the IoT Platform console to view the device status:

    1. Log on to the IoT Platform console.

    2. On the Instance Overview page, find the instance and click the instance name to go to the Instance Details page.

    3. In the left-side navigation pane, choose Devices > Devices.

    4. On the Devices page that appears, click the name of the device that you want to manage. The Device Details page is then displayed.

    5. After about 10 minutes, click the TSL Data tab, and then click the Events tab to view the intelligent alert events.