6.1.4.2 Running the Application
- 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 inHOME_AP_SSID
,HOME_AP_PASSPHRASE
,HOME_AP_SECURITY
. - In
rnwf_app.c
, use the first parameter in thetls_cfg_1[]
for changing the Root CA certificate. If the user prefers to change the SNI (Server name), change the fifth parameter in thetls_cfg_1[]
variable.For example, to set the Root CA certificate totest.mosquitto.org
, replace"AmazonRootCA1"
withtest.mosquitto.org
. Similarly, make the changes for the “Server Name”.const char *tls_cfg_1[] = {"AmazonRootCA1", 0, 0, 0, "s3-us-west-2.amazonaws.com", 0};
- In
- Open the code in
MPLAB IDE v6.00 or higher and add Home AP and device information
in the application code.
- 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
- Passphrase
- Security Type
- The
following fields can be configured via MCC Melody Wi-Fi
settings:
- For more details
about TLS configurations, refer Figure 3-11.
- The
following fields can be configured via MCC Melody Net
Sock settings - TLS;
- Root CA
- Server Name
- The
following fields can be configured via MCC Melody Net
Sock settings - TLS;
- Refer to the Appendix A.4 - Merging Manual Changes Into Regenerated Code to understand how to merge code upon regeneration.
- For more details
about Wi-Fi configurations, refer Figure 3-5.
- Option 1: Change the
configuration manually in the code.
- Save the changes, then build and program the code to the hardware using MPLAB X IDE.
- Open the Terminal application (for example, Tera Term or PuTTY) on the PC
- Connect to the “USB to UART” COM
port and configure the serial settings as follows:
- Baud: 115200
- Data: 8 Bits
- Parity: None
- Stop: 1 Bit
- Flow Control: None
- As the board boots up, it will connect to Home-AP and prints the IP address obtained. The board will establish a connection with AWS S3. After establishing a successful TLS server-client connection, the application will try to access/read the document listed.
- Once the device receives entire
document,
Receive Complete
message is printed on serial console as illustrated in the following figure.