This topic describes how to build the runtime environment on Ubuntu 16.04 for the Lite edition of Link IoT Edge (LE Lite).

Prerequisites

  • The remote access feature of Link IoT Edge depends on the SSH service of the device. You must have the SSH service enabled on the device. For more information about SSH, see OpenSSH.
  • Ensure that the local loopback port of the device is open. You can run the ping 127.0.0.1 command on the device, the port is open if the returned result is normal.ping

Create an edge instance and a gateway

  1. In the left-side navigation pane of the IoT Platform console, choose Link IoT Edge > Edge Instances.
  2. Create an edge instance.
    1. Click Create Instance. In the dialog box that appears, set Instance Name.
      Note Instance Name cannot exceed 20 characters in length and can contain letters, digits, underscores (_), and hyphens (-).
    2. On the Gateway Products page, click Create Gateway Product to create a gateway for the instance.
      Gateways in Link IoT Edge provide edge computing capabilities. Each instance must be associated with a gateway device. A gateway device can be associated with only one edge instance at a time.Create Gateway Product
    3. In the Create Product dialog box that appears, set the parameters and click OK.
      Create Gateway Product in Link IoT Edge inherits the features of Devices > Products in the IoT Platform console. The product creation procedure is simplified, which allows you to quickly create gateway products that are suitable for Link IoT Edge.Create Product
      Table 1. Parameters for creating a gateway product
      Parameter Description
      Product Name The name of the gateway product, which is used to query and identify a gateway product. The name must be 4 to 30 characters in length and can contain letters, digits, and underscores (_).
      Product Description The description of the product. You can enter a maximum of 100 characters. It can be left blank.

      After the product is created, the Create Instance dialog box appears and the created gateway product is automatically displayed under Gateway Products.

    4. In the Create Instance dialog box, click Create Gateway Device under Gateway Devices.
      Create Gateway Device in Link IoT Edge inherits the features of Devices > Devices in the IoT Platform console.Create Gateway Device
    5. Set the parameters as prompted and click OK.
      Table 2. Parameters for creating a gateway device
      Parameter Description
      Product The gateway product to which the device that you want to create belongs. The system automatically associates with the newly created gateway product.
      Device Name The name of the gateway device. The device name must be unique. If you do not specify this parameter, the system automatically generates a device name.
      Note The device name must be 4 to 32 characters in length and can contain letters, digits, and the following special characters: hyphens (-), underscores (_), at signs (@), periods (.), and colons (:).
    6. Set Instance Type of Link IoT Edge based on the environment that you built. For more information, see Specifications.
    7. Optional. In the Create Instance dialog box, click Add Tag and set instance tags. With tags, you can more effectively classify and identify instances. You can also choose not to set tags.
      To set an instance tag, you must specify Tag Key and Tag Value.
      Table 3. Parameters for adding a tag
      Parameter Description
      Tag Key The tag key cannot exceed 20 characters in length and can only contain letters. The parameter cannot be left blank and must be unique in an instance.
      Tag Value The tag value cannot exceed 20 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The parameter cannot be left blank.
  3. After the parameters of an instance are set, click OK.

Install and launch Link IoT Edge

After you create an edge instance and a gateway, you must install and start Link IoT Edge on the gateway.

  1. In the left-side navigation pane of the IoT Platform console, choose Link IoT Edge > Edge Instances, find the created instance, and click Install Software in the Actions column.
    Download command
  2. Specify the parameters for the installation command based on the environment, and then click Installation Command.
    Installation command
    Table 4. Parameters
    Parameter Description
    Edge Gateway CPU Architecture The CPU architecture of your device system. In this example, select x86-64.
    Instance Type The Link IoT Edge edition that you specified when you created the edge instance. In this dialog box, you cannot change the Link IoT Edge edition.
    Edge Version

    The Link IoT Edge version for installation.

    Operating System The operating system of your device. In this example, select Linux.
  3. Copy the installation command for subsequent use.
    Copy the command
  4. Log on to your Ubuntu 16.04 machine.
  5. Run the command that you copied in Step 3 in the command line.
    You can run the command to download, configure, and launch the Link IoT Edge service. After the command is executed, the link-iot-edge.sh script is downloaded and saved in the current directory.
    Note If you are not launching Link IoT Edge for the first time, you can run the link-iot-edge.sh script that has been downloaded to manage the Link IoT Edge service. For example, you can relaunch or stop the Link IoT Edge service. You can also retrieve the status of the service or change the configuration parameters of the service. The command details are described in the following figure.Lite version of the operation command
    If the system displays the following information, the Link IoT Edge service is launched.Launch Link IoT Edge is successful

    You can also log on to the IoT Platform console. In the left-side navigation pane, choose Link IoT Edge > Edge Instances. On the page that appears, find the target edge instance, and click View in the Actions column. On the Gateways tab of the Instance Details page, check the gateway status.

    Online gateway
  6. Optional. Authorize other Alibaba Cloud users to perform operations, administration, and management (OAM) on the instance.
    On the Edge Instances page, click Authorize in the upper-left corner. In the dialog box that appears, click Add Authorization. In the dialog box that appears, set parameters as prompted.User authorization
    Table 5. Parameters for user authorization
    Parameter Description
    Authorized User UID The Alibaba Cloud account ID of the user that you want to authorize.
    Authorized Instance The edge instance on which you want to authorize the Alibaba Cloud account to perform OAM.

Use systemd to manage Link IoT Edge

  • To download the service file, run the following command:
    wget http://remote-access-oxs.oss-cn-shanghai.aliyuncs.com/%E8%84%9A%E6%9C%AC/LinkIoTEdgeLite.service
  • To copy the service file to the /etc directory, run the following command:
    sudo cp LinkIoTEdgeLite.service /etc/systemd/system/LinkIoTEdgeLite.service
  • To launch the Link IoT Edge service, run the following command:
    sudo systemctl start LinkIoTEdgeLite.service
  • To stop and restart the Link IoT Edge service, run the following command:
    sudo systemctl restart LinkIoTEdgeLite.service
  • To launch the Link IoT Edge service automatically at startup, run the following command:
    sudo systemctl enable LinkIoTEdgeLite.service

What to do next

  1. On the Instance Details page, click the Configurations tab. In the Instance Information section, turn on Remote Access.
  2. On the Instance Details page, click the Gateways tab. Find the new gateway and click Remote SSH Terminal, or Share Remote SSH Terminal in the Actions column to remotely manage the gateway and files on the gateway. For more information, see Remote service access.