LwIP PPP Project

From DDCIDeos
Jump to navigationJump to search

Description

Add PPP support to LwIP, specifically for the MPC5676k, but ideally more generally.

This is in support of the Louie_Program.

Be a Maintainer

  1. Checkout LwIP head from mainline.
  2. compile LwIP.
  3. Follow steps below in #Target/LwIP.

The serial interface to lwip is still in the works. The change above was required to support the PPP on the MPC5675K. Any serial driver used with the changes above must support and honor the len parameter for serial_read. Our delivered serial driver does not currently support this, so local changes would be required. Once the serial interface is formalized, the serial driver implementations for our current distribution, the MPC5675K, and the MPC5676R can be updated accordingly.

TODO/Issues

  1. Serial driver must support controlling DTR.
  2. Serial driver must support non-blocking read and write of blocks of data, e.g., read whatever data is currently available up to 1500 bytes.
  3. DMA directly into an LwIP pbuf does not seem likely.
  4. Need to agree on function names for interfaces, e.g., serial_read, serial_write, etc., or perhaps introduce a File Operations structure.
    • Currently LwIP loads a library and uses getLibrarySymbolAddress().
  5. Define lwip.config PPP interface configuration.
    1. Must support serial port config.
    2. Might need to support IP options.

Setup

Target/LwIP

  1. Make LwIP own the resources from the serial example
  2. Add libserial.so to the load list.
  3. PPP support is currently either on or off depending on how LwIP is compiled, i.e., how to modify lwip.config to support PPP is still TBD.

Hardware

Put null-modem cable between serial ports on the boxes.

Host Configuration

Linux

 pppd ttyS1 1200 noauth passive debug 192.168.32.1:192.168.32.2 crtscts modem


Windows 7

This is fraught with peril. The following instructions are preliminary and mostly based on Google searche results. The closest was: mikebeach Note that his procedure supposedly is for Windows 7, but it has changed. And, of course, the procedure differs between windows versions. A support nightmare for sure.

Part 1, install the modem device

  1. Start > Control Panel > Phone and Modem
  2. Modems tab, click Add
  3. Check Don’t detect my modem, I will select it from a list and click Next
  4. Under Manufacturer, select (Standard Modem Types)
  5. Under Models, select Communications cable between two computers
  6. Click Next
  7. Click Selected Ports radio button and select the serial port that you will be connecting the cable to (default: COM1)
  8. Click Next
  9. Windows sets up the modem
  10. Click Finish
  11. Click Ok to close the Phone and Modems dialog box

Part 2, install the incomming connection

  1. Start > Control Panel > Network and Sharing Center
  2. Change adapter settings
  3. Type "Alt-F" to bring up the File menu and select New Incomming Connection
  4. In "Who may connect to this computer?", select Guest (we'll undo this later), then Next
  5. In the next dialog:
    • Unselect Through the Internet.
    • Select Through a dial-up modem
      • Check Communications cable between two computers (COM1)
    • select Next
  6. In the Networking software: dialog.
    • Select IP v4.
    • Deselect IP v6
    • Don't care for File and Printer Sharing for Microsoft Networks and QoS Packet Scheduler
    • Select Allow access
  7. The final dialog The people you chose can now connect to this computer should appear, select Close.
  8. Sometimes the new connection does not appear in the Network Connections display. Sometimes an F5 refresh works, but most of the time it is necessary to Close and reopen the Network and Sharing Center
  9. Right click on Incomming Connections and select Properties.
  10. In the General tab, make sure the communications cable is selected, and select the Properties button.
    • Set the Port speed and Flow control to match the configuration in LwIP.
    • In the Advanced tab, make sure the Data bits, Parity, and Stop bits match the configuration used by LwIP, normally 8, none, 1 respectively, then OK
  11. In the Users tab:
    • Unselect Guest
    • Unselect Require all users to secure their passwords and data
    • Select Always allow directly connected devices ... without a password
  12. In the Networking tab:
    • Select Internet Protocol Version 4 (TCP/IPv4) and select Properties
    • Select Allow callers to access my local area network
    • Select Specify IP addresses. AL: I'm not sure this is required, DHCP might also work.
      • Pick an unused subnet and set the From to be something 1 or greater, and To to be larger than From and less than 255, e.g., From=2, To=3.
  13. Select OK twice.

At this point things don't work, but a reboot of windows seems to get things going.