Mount the AVR128DB48 Curiosity Nano host board and the RNWF02 Add On Board on Curiosity Nano base board
at respective headers. For more details about the boards placement in the
Curiosity Nano base, see Figure 6-1.
Connect the debugger USB port on
the AVR128DB48 Curiosity Nano board to computer
using a micro USB cable
Setup a TCP server on a test PC, following are the steps to configure TCP server
using Packet Sender tool.
Download and Install
Packet Sender tool on a test PC.
Connect the test PC to
the same Home AP which will be used later in Step 5 to configure
device in the STA mode.
Open the installed Packet
Sender tool and open the settings through File>Settings
as illustrated in Packet
Sender-Settings
Specify the TCP server
listening port number (for example: 6666) and use the same server port
number in Step 6.
Enable persistent
connection by selecting the Persistent TCP Connection check
box
The Packet Sender
application banner illustrates the TCP server IP address (for example:
172.31.99.99) hosted on the test PC, use this IP address as the TCP
Server IP in Step 6.
Open the project and launch MCC
with Melody Content Manager Tool
Configure Home-AP credentials for
STA mode, using the Wi-Fi settings configuration. For more details about the
Wi-Fi settings configuration, See Figure 3-16.
Configure TCP Server details such
as TCP server IP address and port. For more details about the Net Sock settings
configuration, See Figure 3-26
Generate the code as illustrated
below.
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 host board 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, see Figure 6-1.
As the board boots up, it will
connect to Home-AP and print the IP address obtained. The board will establish a
connection with configured TCP Server and print a success message. Once the TCP
client-server connection is successful, the application will continue listening
on the socket for incoming messages and then write them back to the server.