DIY Tiny Webserver
kyllikki writes "Oh no no another one? Yes but this time the idea is that its simple enough for those with just a small amount of electronics experience to actualy build it! Everything you need except the physical components and a PIC programmer (theres a link to a 11 component one) is on the website. There is source code , binary hex file (for those to lazy to assemble their own) , hardware design and layout even a parts list and costings... Go have a look and build your own!" No pretty pictures, but a lucid explanation of how you can (cheaply) build a tiny spitter-up-of-html, driven by their GPL'd software.
I've seen a number of comments above where the poster has lept to the conclusion that this thing is comparable to a "real" web server, such as apache running on a unix platform.
The most important limitation that I can see in the code is that it only remembers information from the previously received packet, and it can only send a packet in response to receiving one, but can't retransmit on a timeout not having received an ACK. Calling this TCP is a streatch at best. It's certainly a long way from RFC-1122.
For example, consider the case where two clients attempt to access this little web server at the same time, which is not unlikely running the data pipe at 19200 baud, and having CTS inhibiting data flow in between every received byte, and during all data transmission. The remote IP address is overwritten as the second packet is received, causing all knowledge of the first connection to be lost. Most of that information will be regained when the first host sends another packet, but the point is that this little web server isn't going to work well with multiple connections at the same time, and probably won't work at all if the TCP retransmit is require because of any packet loss.
It is a neat project, and doing even this minimal tx follows rx without pre-connection state is some impressive code for such a small chip. Neat as it is, it just isn't a viable web server for any application where multiple clients may use it. It probably won't do well on networks that have packet loss, duplicated packet and the other not-so-common problems that come with the best-effort (but unreliable) IP datagram service.
And now for a shameless plug.... for the posters above who were talking about connecting a disk drive, here's a little project I did that connects a IDE hard drive to a 8051 microcontroller. Maybe it could be used with a PIC? My code is public domain, so it could be combined with a GPL'd project, like this little web server.
PJRC: Electronic Projects, 8051 Microcontroller Tools
If you can embed a web server into it, you can embed a napster client into it. All you have to do is program the PIC chip for the napster protocol, hook up a network connection, and pop in one of those multi-gigabyte matchbook drives from IBM. Hook the whole thing up to your stero, and voila! Napster-in-a-box!
Of course, you would have to have some way of getting input from the user... a two-line display should handle that well.
Friends don't let friends misuse the subjunctive.