User manual

12
To build this project, you must copy the project to the following location: <install-
dir>/apps/rtos/freertos/ and then open the PPR_tcpip_client_server.X project in MPLAB X IDE.
<install-dir> if not changed by the user is: C:\microchip\harmony\vxxxxx
Where vxxxxx depends on which version of MPLAB Harmony is installed.
This demonstration runs IPv4 only on the Ethernet interface. To view the Web page hosted by the
demonstration application, open a Web browser and direct it to the board running the HTTP server by
typing the URL in the address bar (for example, http://mchpboard_e), and then pressing Enter.
Notes
1. The NetBIOS name of the TCP/IP application is specified at the time the TCP/IP stack is initialized,
which is usually in the hostName member of the tcpip_stack_init.c::
TCPIP_HOSTS_CONFIGURATION structure. The NetBIOS service must be enabled for the PIC32
demonstration to respond to NetBIOS queries (the NetBIOS service is enabled by default for this
demo). Alternatively, you can use the IPv4 of the board directly, for example, http://192.168.1.115.
2. The IPv4 address can be obtained from running the TCP/IP Discovery application on the PC side.
It requires that the TCP/IP Announce module is enabled when building the stack (the Announce
module is enabled by default in this application).
To use the advanced features of this demonstration, a system console must be enabled for the
application. The configuration has Telnet enabled by default. A Telnet connection could be used for
delivering the commands needed by the application. The username for telnet is admin and the
password is “microchip
TCP/IP Tasks
There are four TCP/IP tasks in the application that demonstrate the use of IPv4 TCP and UDP
sockets in a multi-threaded system. Each of these tasks implements (and registers with the system
command processor) specific commands. The commands allow the corresponding sockets to be
opened and to start the communication with the remote hosts. On all hosts, the server sockets must
first be opened, and then have the client sockets connect to them. There are also commands for
configuring each socket/communication channel. Following the model in this application, extra
commands could be added for any of the tasks to achieve desired operation. Each of these
communication channels can be exercised simultaneously or in turn. For the purposes of the
demonstration, at least two different communication channels should be opened simultaneously to
put in evidence the multi-threaded behavior. A common scenario listing the console commands and
steps needed for running this demonstration would be: 1. Start app1 TCP server:
Start the PIC32 TCP server socket that listens on port 9760 by issuing the console
command: topen_s1<CR>
On the client side (PC, etc.) open a client that connects over TCP to the PIC32 server
using port 9760. Use any network tools (“netcat”, etc.) or special applications, scripts
(TCL, Python, etc.) to transmit and receive data files.
2. Start app2 TCP client: