1.20 TCP/IP WEB NET Server PPP

The TCP/IP WEB NET Server PPP configuration demonstrates creating an PPP interface (a network connection using a serial interface) and hosting an HTTP web server on a Microchip board. The Non-Volatile Memory (NVM) Microchip Proprietary File System (MPFS) is used for storing the web pages in the internal Flash.

The board is configured with dual network interfaces, which are Internal GMAC & PPP interface.

The Point-to-Point Protocol (PPP) provides a standard method for transporting multi-protocol datagrams over point-to-point links.

TCP/IP WEB NET Server PPP MCC Configuration

The following Project Graph diagram shows the Harmony components included in the WEB NET Server PPP application demonstration.

  • MCC is launched by selecting Tools > Embedded > MPLAB® Code Configurator from the MPLAB X IDE and after opening the project, TCP/IP demo project is ready to be configured and regenerated.

  • TCP/IP Root Layer Project Graph

    The root layer project shows that SERCOM2 peripheral is selected to do read and write operation for TCP/IP commands.

    This is the basic configuration with SYS_CONSOLE, SYS_DEBUG and SYS_COMMAND modules. These modules are required for TCP/IP command execution.

    Note: The PPP demo is designed to run on hardware that supports the Token Manager library. It won't run on a regular board.

    The PPP source code is not available. It is distributed as a .a library only.

    tcpip_same54_project

    The file system component is required to select MPFS module. This is the below snapshot for the FS configuration.

    tcpip_same54_project
  • TCP/IP Configuration

    • SAM E54 Xplained Pro
      tcpip_same54_project
  • TCP/IP Required Application

    TCP/IP demo use these application module components for this demo.

    Announce module to discover the Microchip devices within a local network.

    DHCP Client module to discover the IPv4 address from the nearest DHCP Server.

    DNS Client provides DNS resolution capabilities to the stack.

    HTTPNET Server module is selected to run the web_server for the port number 80.

    NBNS NetBIOS Name Service protocol associates host names with IP addresses. This assign of human-name host names to access boards on the same subnet.

    SMTP CLIENT let applications send e-mails to any recipient worldwide.

    SNTP Simple Network Time Protocol updates its internal time periodically using a pool of public global time servers.

  • TCP/IP Data Link Layer

    1. Internal ethernet driver(GMAC)

      Internal ethernet driver(GMAC) is enabled with the KSZ8091 PHY driver library for the board. The MIIM Driver supports asynchronous read/write and scan operations for accessing the external PHY registers and notification when MIIM operations have completed.

    2. PPP driver

      The PPP MAC device driver provides a simple interface to manage the PPP peripheral.

      PPP in the MAC layer is enabled with the serial line SERCOM peripheral library.

      Refer below for the components selected in the Data Link Layer of the TCP/IP stack

      tcpip_same54_project

      The PPP configurations are as follows:

      tcpip_same54_project

      The SERCOM5 configurations are as follows:

      tcpip_same54_project

TCP/IP WEB NET Server PPP Hardware Configuration

This is the following section describes the hardware configuration used for this application demonstration.

  1. This section describes SAM E54 Xplained Pro custom hardware configuration which uses the on-board debugger and programmer with Internal GMAC and PPP interface for this application demonstration.

    • Refer to the SAM E54 Xplained Pro User Guide for the programming/debugging options supported & setting up the hardware.

      required_hardware
    • Connect the micro USB cable from the computer to the DEBUG USB connector on the SAM E54 Xplained Pro.

    • Connect a serial FTDI connector to the board serial port that's configured for the PPP connection (this shows in the MCC PPP configuration).

    • Connect the other end of the cable (USB) to the test Linux machine running PPPd.

    • Establish a connection between the router/switch with the SAM E54 Xplained Pro through the RJ45 connector on KSZ8091 PHY daughter board interface.

TCP/IP WEB NET Server PPP Running Application

This table list the name and location of the MPLAB X IDE project folder for the demonstration.

Project NameTarget DeviceTarget Development BoardDescription
sam_e54_xpro.XATSAME54P20ASAM E54 Xplained ProDemonstrates the WEB NET Server PPP on development board with ATSAME54P20A device and KSZ8091 PHY daughter board. The board has two interfaces (eth0 & ppp0 interface). This is a bare-metal (non-RTOS) implementation

Running Demonstration Steps

  1. Build and download the demonstration project on the target board.

  2. PPP Daemon Setup:

    1. To install PPP on a Linux machine (like Ubuntu, Debian, etc):

      > sudo apt install ppp
    2. Insert a USB to serial cable into a USB slot on the Linux machine. This will create a TTY USB device, let's say /dev/ttyUSB0

    3. Allow the usage of the tty port by the PPP server:

      >sudo chmod -R 777 /dev/ttyUSB0
    4. start pppd:

      We use the IP address 192.168.1.179 for the local machine (Linux) and 192.168.1.181 for the remote machine (the SAME54 board). Adjust based on your network configuration.

      >sudo pppd /dev/ttyUSB0 115200 passive local noauth nocrtscts asyncmap ffffffff lcp-max-configure 1 persist 192.168.1.179:192.168.1.181
    5. Start the application on the SAME54 side.

      After start up, using the command 'netinfo' you should see that the interface 'ppp0' is present. The connection to the Linux server should be done and the PPP interface on the test board should have an IP address: 192.168.1.181 in our example.

    6. At this point the PPP interface is configured.

      You can use it as a regular interface: to ping to/from the Linux box, to access the on board web server from the Linux box, etc.

    7. The Linux /var/log/syslog or /var/log/messages, /var/log/debug will contain details about the PPP occurring events.

    8. At any time, if you need to stop the Linux PPP daemon, use:

      > ps -e | grep pppd
      
      > kill -15 pppp_process_id
    9. Other Linux PPP options are explained in the /etc/ppp/options.

  3. Execution :

    • Start the demo. Check that the PPP interface gets an IP address

      tcpip_same54_project
    • You can use the PPP interface as a regular network interface now.

    • Demo Test:

      To test the web server functionality, refer TCP/IP WEB NET Server NVM MPFS demo.