6.1.4.1 Building and Running the Basic MQTT Demo Application

Building the Application

To build this application, open the project file (apps\wifi_easy_config\firmware\basic_cloud_demo_sam_e54_xpro_WINCS02PC.X/) in MPLAB X IDE. For more details on opening the project file in MPLAB X IDE, refer to the Opening the Project File. The following table provides details on the project file.

Table 6-4. Table 6-9. Project File
Project NameDescription
basic_cloud_demo_sam_e54_xpro_WINCS02PC.X
  • MPLABX project for SAM E54 Xplained Pro evaluation kit and WINCS02PC Add On Board
  • This application demonstrates on how user can configure the device with Home-AP credentials
Running the Application
  1. Mount the WINCS02PC Add On Board on SAM E54 Xplained Pro evaluation kit at respective header. For more details about the boards placement in the SAM E54 X-plained host board, see Figure
  2. Connect the debugger USB port on the SAM E54 Xplained Pro evaluation kit to computer using a micro-USB cable.
  3. Open the project and launch MCC Harmony3.
  4. Configure the WINCS02PC Wi-Fi® ProvisionMode credentials, using the WINCS02PC Wi-Fi configuration options. For more details about the Wi-Fi settings configuration, See Sta_Mode.
  5. Generate the code as illustrated below
    Figure 6-13. Generating the Code
  6. Build and program the code to the hardware using MPLABX IDE
    Figure 6-14. Programming the Board
  7. Open the Terminal application (for example, Tera Term or PuTTY) on the PC'
  8. Connect to the “EDBG Virtual 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
  9. Press the SW0 (Soft Reset) button on the host board.
  10. The board boots up. After successfully connecting with Wi-Fi, it connects to test.mosquitto.org on port 1883 (unencrypted).
  11. To demonstrate successful MQTT connection, the board subscribes to topic mchp/sample/b and publishes a message on the same topic. The received message is printed in the terminal.
  12. Figure 6-15. Basic MQTT demo Serial logs