5.3. AWS Demo for KSDK

This demo demonstrates connection to AWS IoT Console using pre-provisioned device credentials and publish/subscribe procedure using MQTT.

5.3.1. Prerequisites

  • Active AWS account

  • MCUXpresso installed (for running aws demo on k64)

  • Any Serial communicator

  • Flash VCOM binary on the device. VCOM binary can found under <PROJECT>binaries folder.

  • Refer to CLI Tool for pyCLI tool setup

5.3.2. Using WiFi with LPC55S

WiFi shield Silex-2401 is supported with LPCS55S. Mount the WiFi shield on to the arduino stackable headers.

5.3.3. Creating a device on AWS account

TO BE UPDATED,

5.3.4. Creating and updating device keys and certificates to SE

  1. Complete Section 7.3 Steps needed before running ssscli tool

  2. Check the vcom port number

  3. To create certificates on windows and provision, go to simw-top/pycli directory and call:

    call venv\Scripts\activate.bat
    cd Provisioning
    python GenerateAWSCredentials.py <COM_PORT>
    python ResetAndUpdate_AWS.py <COM_PORT>
    
  4. Certificates and Keys are generated at simw-top/pycli/Provisioning/aws

5.3.5. Running the Demo

  1. Open frdmk64f_mbedtls_sss_aws_demo project found under <PROJECT>projects in MCUXPRESSO IDE

  2. Open a serial terminal on PC for OpenSDA serial device with these settings:

    - 115200 baud rate
    - 8 data bits
    - No parity
    - One stop bit
    - No flow control
    - change Setup->Terminal->New-line->Receive->AUTO
    
  3. Connect the boards’s RJ45 to network with Internet access (IP address to the board is assigned by the DHCP server). Make sure the connection on port 8883 is not blocked.

  4. Download the program to the target board.

  5. Either press the reset button on your board or launch the debugger in your IDE to begin running the demo.

  6. The BLUE LED is turned ON during boot

  7. Persistent RED LED ON indicates error

  8. First time during connection, the device certificate needs to be
    • Activated

    • Attached with a policy that allows usage of this certificate

  9. All lights off along with the following message indicates readiness to subscribe messages from AWS:

    Subscribing...
    -->sleep
    -->sleep
    Publish done
    

    In AWS IOT shadow, the following indicates the state of the LED:

    {
        "desired": {
        "COLOR": "RED",
        "MODE": "OFF"
        }
    }
    

    MODE can be ON or OFF and COLOR can be RED, GREEN or BLUE