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.
Connect the debugger USB port on the
AVR128DB48 Curiosity Nano board to computer using a micro USB cable
Change the configuration. There are two
options to change the configuration:
Option 1: Change the configuration
manually in the code
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.
(Optional) The subscribe and publish topics are same, therefore the user can
see the received messages on the terminal. The users can subscribe and publish
to another topic of their choice and exchange message. Change Publish topic name
in MQTT_PUB_TOPIC in rnwf_app.h.
(Optional) In rnwf_app.c, the user can add subscribe topic
name of their choice in subscribe_list[].
Option 2: Change the configuration via
MCC Melody.
For more details about Wi-Fi
configurations, refer Figure 3-5.
The following fields can be
configured via MCC Melody Wi-Fi settings;
SSID
Security Type
Passphrase
Refer Figure 3-9 to understand how to make Cloud Configuration changes
Save the changes and then build and program
the project.
Open the Terminal application (for example, Tera Term or PuTTY) on the PC.
Connect to the host board’s 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 and lists certificates available on the board. 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.
If the user wants to change the Subscribe topic and Publish topic, make changes in the
configuration, build the program, and run it again. Make a note of the Publish Topic Name
and Subscribe Topic Name.
Open a MQTT Client software tool (for example, MQTT.fx).
Enter Subscribe topic in the tool at which the user wants to publish the message from the
device. When the RNWF11 device connects to
test.mosquitto.org it will publish message to the entered Publish Topic Name and
the user can receive and see the messages in MQTT Client Software tool.
Follow a similar method to receive messages on the user’s preferred Subscribe Topic Name.