Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 3.22 KB

readme.md

File metadata and controls

55 lines (34 loc) · 3.22 KB

TCP Server Application

This RNWF02 application implements a TCP Server. In this application RNWF02 will host a TCP Server in Wi-Fi STA mode. The user is required to configure the Wi-Fi credentials for Home-AP and specify the port number at which the TCP server would be listening. By default application will connect to Home-AP and starts a TCP Server on the board. After establishing a successful TCP server-client connection, the data exchange will take place.

Building the Application

To build this application, open the project file (apps/tcp_server/firmware/tcp_server_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
tcp_server_sam_e54_xpro_rnwf02.X MPLABX project for SAM E54 Xplained Pro evaluation kit and RNWF02 Add On Board
  • This application demonstrates a TCP server in Host Companion mode. After establishing a successful TCP server-client connection, the data exchange will take place.

Running the Application

  1. 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-1

  2. Connect the debugger USB port on the SAM E54 Xplained Pro evaluation kit to computer using a micro-USB cable.

  3. Open the project and launch MCC Harmony3.

  4. Configure Home-AP credentials for STA mode, using the RNWF02 Wi-Fi configuration options. For more details about the Wi-Fi settings configuration, See Figure 1.

  5. Generate the code as illustrated below.

    Figure 6-21. Generating the Code

  6. Update the SYS_RNWF_NET_NO_OF_CLIENT_SOCKETS macro present in sys_rnwf_net_service.h to reflect the number of client sockets the system can manage in server mode. (supports max 5 clients)

  7. Build and program the code to the hardware using MPLABX IDE

    Figure 6-22. Programming the Board

  8. 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:

    1. Baud: 115200
    2. Data: 8 Bits
    3. Parity: None
    4. Stop: 1 Bit
    5. Flow Control: None
  9. As the board boots up, it will connect to Home-AP and print the IP address obtained. After establishing a successful TCP server-client connection, the application will continue listening on the socket number configured for incoming messages and then write them back to the client connected.


    TCP Server - Serial Logs


    Figure 6-24. Mobile AppTCP Client Logs