Skip to content

Latest commit

 

History

History
58 lines (33 loc) · 3.75 KB

readme_wincs02.md

File metadata and controls

58 lines (33 loc) · 3.75 KB

TCP Client Application

This application demonstrates a traditional open TCP client in the Host Companion mode. In this application the WINCS02 will host a TCP Client in Wi-Fi STA mode. The user is required to configure the Wi-Fi credentials for Home-AP and provide the necessary details for the remote TCP server configuration. By default the application will connect to Home-AP and begin a TCP client socket connection with a TCP server. 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_client/firmware/tcp_client_sam_e54_xpro_wincs02.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_client_sam_e54_xpro_wincs02.X - MPLAB X project for SAM E54 Xplained Pro evaluation kit and WINCS02 Add On Board
  • This application demonstrates a tutorial to open TCP client in Host Companion mode. After establishing a successful TCP server-client connection, the data exchange will take place

Running the Application

  1. Mount the WINCS02 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-70

  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 WINCS02 Wi-Fi configuration options. For more details about the Wi-Fi settings configuration, See Figure 3-64.

  5. Configure TCP Server details such as TCP server IP address and port. For more details about the Net Sock settings configuration, See Figure 3-74.

  6. Generate the code as illustrated below.



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



  8. Open the Terminal application (for example, Tera Term or PuTTY) on the PC

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

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