Updating the Filesystem for the uIP Webserver
A few simple steps are all that's required to add your own web pages and images to the uIP webserver
The LPC2148 Code Base includes a basic port of Adam Dunkel's uIP 1.0 TCP/IP stack, allowing you to internet-enable the LPC2148. Along with the core TCP/IP functionality, a basic webserver app is included that can be used to serve webpages directly from the LPC2148 (using an Ethernet expansion board or your own Ethernet hardware). Since the web content is compiled and written directly onto the flash memory of the LPC2148, however, there are a few steps you'll need to follow if you wish to change the html content displayed by the webserver or add new files or images. Thankfully, the process is pretty painless.
To make converting HTML pages, CSS files and images as easy as possible, a basic PERL script is included in the "uip/apps/webserver" folder of the code base. The file, named "makefsdata", can be executed by dropping down to the command-line, entering into the appropriate folder and simply entering: perl makefsdata
If you're using a Windows-based PC there's a very high chance that you don't have a PERL parser installed, but a free, easy to install and very mature version named ActivePerl is available from ActiveState (click on the previous link to download it). Simpy install ActivePerl and you should be able to run the conversion script without any troubles.
- Place all of your updated HTML files, images and CSS files into the httpd-fs folder
- From the command line (one-level higher than httpd-fs) enter: perl makefsdata ... you should see a screen similar to the following showing the results of the conversion process:
- The perl script has just updated the httpd-fsdata.c file with a compileable version of all of your files. The LPC2148 Code Base automatically includes this file during compilation, and all you have to do is recompile your project and redeploy the updated firmware to your hardware.
- Now you can navigate to the IP address of the LPC2148 Base Board in your web browser -- for example http://192.168.1.6 -- and you should see the update index.html page by default and any other content you placed in httpd-fs will be accessible using the same structure as the source files, including any subfolders. (For reference sake, the current IP address can always be retrieved or set from the Monitor by typing "uip ip".)