Setup C Virtual Device

Minimal code implementing an UniquID node. It can be used to add UniquID functionalities to the AWS IoT C sdk. Please refer to the README in the repo for further informations.

Install Prerequisites

Install these packages on your machine

sudo apt install cmake
sudo apt install libcurl4-openssl-dev

How to integrate in the AWS IoT C sdk

  1. Clone the AWS-IoT-sdk

    git clone -b v3.0.1
  2. Clone this repository inside the external_libs directory

    cd aws-iot-device-sdk-embedded-C/external_libs/
    git clone
  3. Clone the uidcore-c library

    git clone --recurse-submodules
  4. Clone the mbedtls code

    rm mbedTLS/README.txt
    git clone mbedTLS -b mbedtls-2.16.1
  5. Apply the provided patch, IoT-sdk.patch

    cd ..
    git apply external_libs/uidagent-c/IoT-sdk.patch
    cd samples/linux/subscribe_publish_sample

Run the C device

  1. Copy in the "certs" directory the CA certificates chain to authenticate the aws-mqtt-proxy and the uniquid mqtt broker. The file must be named rootCA.crt

    cp ../../../../caChain-xxxxxxxxxxxxxx.crt ../../../certs/rootCA.crt

    Press tab to find the right caChain file.

  2. Copy the configuration file (example file) **

    cp ../../../../aws_device_cfg.json aws_device_cfg.json
  3. Run the sample


** The configuration can also be loaded from AWS_AGENT_CONFIG environment variable

export AWS_AGENT_CONFIG=$(cat path-to/aws_device_cfg.json)

The device will try to connect to the proxy every 10 seconds, for this reason an error message will be reported until you create an UniquID Contract between the C device and the AWS-IOT-UNIQUID-AUTHORIZER to bind these two components.

Only when both the components will receive the contract from the blockchain, the device will be able to connect.