You are viewing an older revision! See the latest version
Networking
Library¶
Import Library:
http://mbed.org/projects/cookbook/svn/EMAC/lwip/trunk
or import precompiled Library:
http://mbed.org/projects/cookbook/svn/EMAC/lwip/precomp
Import Example program:
http://mbed.org/projects/cookbook/svn/EMAC/lwip/examples/HTTPServer
- For details on how to use this in the compiler, see Importing Projects and Libraries into the Compiler
Hardware¶
To use this Library you have to connect the Ethernet pins of your mbed board with a Network. I have used a MagJack SI-60002-F to provide a RJ45 Jack.
| | | | --||--||--||--||----- Socket mbed / 8 | 6 | 4 | 2 | /| 1 RD+ / 7 5 3 1 / | 2 / / | 3 RD- / Bel Stewart / | 4 TD- / MagJack / | 5 / SI-60002-F / | 6 TD+ /___________________ / | | -------- | | | -- -- | | | --- | ---- | / || /--/-/-/-/-/-/-|| / ___ ________ || / 8 7 6 5 4 3 2|| / ________________ -/ \- ____ | ____ | || / / / / / / / / || / ,= ,++, /, , , , , ,\|, , ,| , , /, ,| , |, , ,_| || / / / / / / / / /|| / ============================================================ ||/ ' ' ' ' ' ' ' ' || / | | | | | | | | | | | | | | | | | | | | | ------------------- |/ | | | | | | | | | | | | | | | | | | | | --------------------- ^ ^ ^ ^ Ethernet Socket Front mbed Board TD+TD-RD+RD-
HTTP Server¶
A very easy to use HTTP Server which will server files from the flashdrive. The default file is called "index.htm".
Furthermore it can serve rpc requests when you request a page starting with /rpc. For example: "http://mbed-ip-or-hostname/rpc/led1/write+1"
For the rpc path you can use rather ,
or +
or =
or in a modern browser space which will be converted to %20
.
By default the server uses DHCP to connect to the network and will print out it's IP address to stdout (by default USB serial).
API¶
- Full api at http://mbed.org/projects/cookbook/api/EMAC/lwip/trunk/HTTPServer
- Full source at http://mbed.org/projects/cookbook/svn/EMAC/lwip/trunk/
Resources¶
HTTP Client¶
- HTTP Client - The HTTPClient class.
- Twitter - A simple demo how to use the HTTPClient class with twitter
- Timetric - A simple demo how to use the HTTPClient class with timetric
lwIP internal examples¶
- Pure lwip HTTP Server - Using lwIP direct to building a http server
- Pure lwip HTTP Client - Using lwIP direct to build a http client
- Simple HTTP Server - TCPCallback classes to build a http server to how how to use the classes
- Simple HTTP Client - TCPCallback classes to build a http client to how how to use the classes