XDK AwsSendDataOverMQTT Application User Guide

XDK AwsSendDataOverMQTT application shows how to use the MQTT protocol to transfer the sensor data to an AWS server using Amazon FreeRTOS.

XDK AwsSendDataOverMQTT Application User Guide

  1. Find the files placed under AwsSendDataOverMQTT(4 files)
    config.txt – Configuration file
    rootCA.der – Root Certificate
    xdk-cert.der - A certificate for this thing
    xdk-priv.der – Private Certificate
  2. Modify the config.txt with ssid, password , serverurl, serverport , brokerurl and broker port as shown below in config.txt.
    brokerurl - Go to IoT core available under Internet of Things of Home page after logging into http://console.aws.amazon.com/ brokerurl you can get from Settings under Endpoint
    "isenterprise" : 0,
    "ishostpgmenabled" : 0,
    "ssid" : "xxxxx",
    "username" : "xxxxx",
    "password" : "xxxxx",
    "isstatic" : 0,
    "ipaddr" : "",
    "gwaddr" : "",
    "dnsaddr" : "",
    "mask" : ""
    "serverurl": "0.de.pool.ntp.org",
    "serverport": 123
    "clientid": "xyz",
    "brokerurl": "xyz.iot.eu-central-1.amazonaws.com",
    "brokerport": 8883
  3. Go to IoT core after looging into http://console.aws.amazon.com/ The Home page will open as shown below
Home Page for Aws

brokerurl can be get from Settings under Endpoint field

Brokerurl for the config.txt

Steps to Generate certificate

  1. To create the certificate follow the below steps Go to IoT core page available under Internet of Things
    • Go to Manage ->Things


    • Create a Device under Things


    • Click on "Create a single thing"


    • Name your device under “Name” and click next


    • Creating certificate have two possibilities

      • For the newly created device
      • If your device is already created then go to the created device for example XDK-Custom -> Go to Security -> create certificate
      • Download the certificate and key 1,2 and 3 as per the image given below and afterwards click on Activate. If not activated then the device will not subscribe. So everytime the device should be activated when you flash the code<
        • >
      • Downloaded certificates will be in .pem format which should be converted to .der format After downloading the certificate -> go to the place where it is saved -> open git bash and use the command given below

        $ openssl x509 -outform der -in downloaded_cert.pem -out output.der -> for certificate (.cert.pem / root CA )
        $ openssl rsa -outform der -in key.pem -out private.der -> for converting the private key
        Downloaded_cert .pem is the downloaded file name and output .der which can be named anything.
        Save as a .pem in local system (Kindly remove space while saving the certificate)

Steps to flash the application and see the data sent over Mqtt

  1. Modified the AppController.c file with the above modified certificate name
    APP_ROOT_CA_FILE_NAME- created by RSA 2048 bit key: VeriSign Class 3 Public Primary G5 root CA certificate file name
    APP_PRIVATE_KEY_FILE_NAME – created by Private Key file name
    APP_CLIENT_CERT_KEY_FILE_NAME –created by - A certificate for this thing (.pem.cert) file name
  2. Place the generated certificates after converting to der format along with config.txt file in the SD Card and after modified as per point 4 compile and flash the Application, after the SNTP is success and the data can be seen in TeraTerm or in any console window
  3. Go to Test -> and specify the topic for eg : “BCDS/XDK110/example/out” as mention in application and subscribe to the topic
  4. After subscribing you can see the data streaming as per the below picture
  5. Once the Application run the files in the SD card is converted to .bkp . The files can be modified again by placing the .der in the SD Card whichever file is required

This documentation file has been automatically generated on Fri Oct 4 2019 03:47:31 by doxygen 1.8.8