Setup C Virtual Device

Minimal code implementing an UniquID node. It can be used to add UniquID functionalities to the AWS IoT C sdkarrow-up-right. Please refer to the READMEarrow-up-right 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 https://github.com/aws/aws-iot-device-sdk-embedded-C.git -b v3.0.1
  2. Clone this repository inside the external_libs directory

    cd aws-iot-device-sdk-embedded-C/external_libs/
    git clone https://github.com/uniquid/uidagent-c.git
  3. Clone the uidcore-c library

    git clone --recurse-submodules https://github.com/uniquid/uidcore-c.git
  4. Clone the mbedtls code

    rm mbedTLS/README.txt
    git clone https://github.com/ARMmbed/mbedtls.git 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
    make

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

    Press tab to find the right caChain file.

  2. Copy the configuration file (example filearrow-up-right) **

  3. Run the sample

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

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 Contractarrow-up-right between the C device and the AWS-IOT-UNIQUID-AUTHORIZER to bind these two components.

circle-exclamation

Last updated