The remote configuration feature allows you to update the configurations of remote devices without the need to restart or stop the devices. The configurations include the system parameters and network parameters.

Prerequisites

The remote configuration feature is supported in the device SDK. You must define FEATURE_SERVICE_OTA_ENABLED = y in the device SDK. The SDK provides the linkkit_cota_init operation to initialize remote configurations. For more information, see Remote configuration.

Background information

You can update device configurations such as the system parameters, network parameters, and security policies by pushing an update package to a device. However, this method increases the workloads of firmware version maintenance, and the device must stop running to implement an update.

To fix these issues, IoT Platform provides the remote configuration feature. This feature allows you to update configurations without the need to restart or stop the device.

Note The remote configuration feature is applied on a product basis. The configuration file that is uploaded to IoT Platform takes effect on all devices of a product. You cannot specify a single device for remote configuration.

Features

You can perform the following operations that are related to the remote configuration feature:

  • Enable or disable the remote configuration feature.
  • Edit configuration files and manage their versions in the IoT Platform console.
  • Push configuration files from IoT Platform to multiple devices at a time to update the configurations.
  • Enable devices to request configuration files.

Scenarios

The remote configuration feature is applied to the following scenarios:

  • IoT Platform pushes configuration information to multiple devices at a time. Each device receives the information and modify the local configuration file.
  • A device requests a configuration file from IoT Platform and performs an update.

The following sections describe the procedures in the preceding scenarios.

Scenario 1: IoT Platform pushes configuration information to devices

In the IoT Platform console, you can push a configuration file to all devices of a product at a time.

Remote configuration
  1. Connect devices to IoT Platform.

    For more information about how to develop devices by using the sample code, see the Link SDK documentation.

    Notice When you develop the devices, subscribe to the following topic that is used to push configuration information: /sys/${productKey}/${deviceName}/thing/config/push.
  2. In the IoT Platform console, edit a configuration file.
    1. Log on to the IoT Platform console.
    2. In the left-side navigation pane, choose Maintenance > Remote Config.
    3. Select a product, turn on the Remote Configuration switch, and then click Edit.
      Remote configuration
    4. In the code editor of the Configure Template section, write or paste the configuration information in the JSON format.
      Note The configuration template is applied to all devices of a product. You cannot push a configuration file to a single device.
    5. Click Save, and then click OK.
      You can push a configuration file to all devices of a product at a time. You can also enable a device to request a configuration file.
  3. Click Batch Update, and then click Confirm Update.
    Then, IoT Platform pushes the configuration file to all devices of the product.

    If IoT Platform considers that the operation is not performed in a trusted environment after you click Batch Update, IoT Platform sends you an SMS message for verification. IoT Platform sends the configuration file to the devices only after the verification is completed.

    Note
    • Operation frequency limit: You can perform a batch update only once per hour.
    • To stop batch updates, you can turn off the Remote Configuration switch for the product. Then, IoT Platform stops pushing configuration files and denies update requests from devices.
  4. Devices automatically update the configurations after they receive the download URL of the configuration file from IoT Platform.
    Note The download URL is valid for 30 minutes. Devices must download the configuration file within the validity period.
  5. Optional. View and manage the versions of configuration files.
    By default, the latest five configuration files are saved in the IoT Platform console. After you edit and save a new version of the configuration file, the previous version is automatically displayed in the Configuration Version Record section.

    You can view the update time and content of a configuration file. Find the configuration file and click View in the Actions column. In the dialog box that appears, you can view the content. You can also click Restore to This Version to restore the content of the selected version to the code editor. Then, you can edit the content and update the configurations of multiple devices at a time.

Scenario 2: Enable a device to request a configuration file

The following figure shows the process.

Remote configuration
  1. Connect a device to IoT Platform.

    For more information about how to develop the device by using the sample code, see the Link SDK documentation.

    Note When you develop the device, subscribe to the following topic that is used to send responds to update requests: /sys/${productKey}/${deviceName}/thing/config/get_reply.
  2. In the IoT Platform console, enable remote configuration and edit a configuration file. For more information, see Step 2 in Scenario 1.
  3. Call the linkkit_invoke_cota_get_config operation to generate a request for remote configuration.
  4. Send the request to the following topic to query the latest configuration information: /sys/${productKey}/${deviceName}/thing/config/get.
  5. IoT Platform receives the request and returns the information to the following topic: /sys/${productKey}/${deviceName}/thing/config/get_reply.
  6. The device downloads the configuration file by using the URL that is sent from IoT Platform.
    For example, the device SDK for C 3.x provides the cota_callback callback function to process the download URL of the configuration file and perform an update.
    Note The download URL is valid for 30 minutes. Devices must download the configuration file within the validity period.