This RNWF02 application demonstrates unencrypted connection with Mosquitto MQTT server. The RNWF02 board acts as a MQTT client and connects to test.mosquitto.org. It requires only few Wi-Fi configuration changes, and the user can easily connect to Mosquitto server and send or receive messages.
To build this application, open the project file (apps\basic_cloud_demo\firmware\basic_cloud_demo_sam_e54_xpro_rnwf02.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.
Project Name | Description |
---|---|
basic_cloud_demo_sam_e54_xpro_rnwf02.X |
- MPLABX project for SAM E54 Xplained Pro evaluation kit and RNWF02 Add On Board |
- This application demonstrates on how user can configure the device with basic MQTT credientioals.
-
Mount the RNWF02 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 6-70
-
Connect the debugger USB port on the SAM E54 Xplained Pro evaluation kit to computer using a micro-USB cable.
-
Open the project and launch MCC Harmony3.
-
Configure the RNWF02 Wi-Fi ProvisionMode credentials, using the RNWF02 Wi-Fi configuration options. For more details about the Wi-Fi settings configuration, See Figure 3-66
-
Generate the code as illustrated below
-
Build and program the code to the hardware using MPLABX IDE
-
Open the Terminal application (for example, Tera Term or PuTTY) on the PC'
-
Connect to the "EDBG Virtual COM Port" and configure the serial settings as follows:
- Baud: 115200
- Data: 8 Bits
- Parity: None
- Stop: 1 Bit
- Flow Control: None
-
Press the SW0 (Soft Reset) button on the host board.
-
The board boots up. After successfully connecting with Wi-Fi, it connects to test.mosquitto.org on port 1883 (unencrypted).
-
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.