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 client on a test PC, following are the steps to configure TCP client
using Packet Sender tool.
Download and Install the
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
Select the Persistent
TCP Connection check box to enable persistent option and click
OK
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 port number at which the server would be listening, 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 device's DHCP IP address and
port number are printed in device console, use the same details as TCP server IP
address and port number in Step 14.
In the Packet Sender, set the
address to the device's IP address (for example: 172.31.98.219) and Port to the
port number (for example: 6666) obtained in the previous Step 13 and click Send button to establish TCP connection with TCP server
running on the device
After establishing a successful
TCP server-client connection, the TCP Server application on the device will keep
waiting for the incoming messages, once received it then sends them back to the
connected client.