6.1.6.4 Running the Application

  1. Mount the AVR128DB48 Curiosity Nano host board and the RNWF11 Add On Board on Curiosity Nano base board at respective headers. For more details about the boards placement in the Curiosity Nano base, refer to the Figure 6-1.
  2. Connect the debugger USB port on the AVR128DB48 Curiosity Nano board to computer using a micro USB cable.
  3. Change the configuration. There are two options to change the configuration:
    1. Option 1: Change the configuration manually in the code.
      1. Open the code in MPLAB IDE v6.00 or higher and add Home AP and device information in the application code.
        • In rnwf_app.h, add Wi-Fi configurations in HOME_AP_SSID, HOME_AP_PASSPHRASE, HOME_AP_SECURITY.
        • In rnwf_app.h, add Serial Number (Common Name) in the macro “CLIENT_ID”. This value is the same as shown in Figure . The user can find the value again by navigating to All devices>Things (refer Figure ).
        • In rnwf_app.c, change the broker name in both the fields cloud_tls_cfg (5th parameter), and the mqtt_cfg (.url parameter) to user’s AWS broker name.
        • If the user prefers to use the TrustNGo ECC608 Device instead of TrustFlex ECC608 Device, the user must set the macro RNWF_TLS_ECC608_DEVTYPE to 1 in rnwf_app.h. By default, the AWS demo uses Trustflex secure device.
    2. Option 2: Change the configuration via MCC Melody.
      • For more details about Wi-Fi configurations, refer Figure 3-5.
        1. The following fields can be configured via MCC Melody Wi-Fi settings:
          1. SSID
          2. Security Type
          3. Passphrase
      • For more details about Cloud configuration, refer Figure 3-9.
        1. The following fields can be configured via MCC Melody OTA configuration settings:
          1. Cloud URL
          2. Cloud Port
          3. Client ID
          4. Publish Topic Name
          5. Sub Topic Name
      • For more details about TLS configurations, refer Figure 3-11.
        • The following fields can be configured via MCC Melody Net Sock settings - TLS:
          1. Root CA
          2. Server Name
      • Refer to the Appendix A.4 - Merging Manual Changes Into Regenerated Code to understand how to merge code upon regeneration.
  4. Save the changes and then build and program the project.
    Figure 6-21. Make and Program Device Main Project
  5. Connect to the “USB to UART” COM port and configure the serial settings as follows:
    1. Baud – 115200
    2. Data – 8 Bits
    3. Parity – None
    4. Stop – 1 Bit
    5. Flow Control – None
  6. The board boots up and the application starts running. It displays Wi-Fi information, certificates on the board, Serial number of the device, connects to Home-AP and then to AWS cloud Server. It publishes messages periodically on a subtopic with a running counter.
    Figure 6-22. Device Interface Debug Log with Telemetry Data
  7. To see event logs on the AWS IoT Server Dashboard, go to “Monitor” and check for the “Messages published” increasing with time.
    Figure 6-23. AWS Event Logs