Create iot-connect.cfg

Create the iot-connect.cfg file with the device connection attributes.

The iot-connect.cfg file defines the attributes of the connection between the device and the Device Cloud, including location of the CA certificates file, the domain name for the Device Cloud endpoint, and the port number.

It also includes the token for the device manager. The token must match the value of the token associated with the name of the device manager in the Device Cloud. For example, if hdc_device_manager_clib_app is be associated with the token dFXfyZN6kXeNoKtAs, then that token must also be used in iot-connect.cfg.

The procedure described below involves manually creating the iot-connect.cfg.

Alternatively you can run control-main from the VxWorks kernel shell. The application prompts you for the Device Cloud and port number, the device manager token, the file path for the CA certificates file, and the proxy server type (if applicable). It then writes the file to the directory specified with the DEVICE_CLOUD_AGENT_CONFIG_DIR configuration parameter.

  1. Create a device connection configuration file called iot-connect.cfg.
  2. Add this content as a template.
    {
      "ca_bundle_file": "/bd0:1/etc/ssl/certs/ca-certificates.crt",
      "cloud": {
        "host": "api.devicecloud.windriver.com", 
        "port": 8883, 
        "token": "dFXeNoN6kwOTKtAs"
      }, 
      "validate_cloud_cert": true
    }
  3. Change the value of ca_bundle_file to the file path that you will use when you add the ca-certificates.crt file to device storage.
  4. Look up the host domain name and port for your Device Cloud connection and change the values in iot-connect.cfg.
    1. If you are not already logged on to Device Cloud, do so.
    2. Click Developer.
    3. From the Endpoints block, get the domain name and port number used for the device connection.
    4. Change the host value in the iot-connect.cfg to the domain name displayed in Endpoints.
    5. The port value should be 8883.
  5. Change the token value to the one you copied to a temporary file earlier for the device manager.