I'm interested in serving my website from an arduino. This would be done in conjunction with an ethernet shield with a webserver on the arduino that serves pages from an sd card. It should be all self contained (not linked to a computer).
Is this realistic? Could it be done? It will only be serving simple html pages/images. I will not need to support a lot of users.
Its possible to serve up web pages from an Arduino with an ethernet shield, but there are a lot of limitations.
Most of the inexpensive (< $100) ethernet shields can only handle a single connection at a time. This is fine if its in a closed network, and you're the only one ever using it. It gets a bit more complicated if you want it connected to the public internet, and expect it to serve up content to more than one person at a time.
Will the Arduino be doing anything else besides being a web server?
Actually, it's "doable". I put together a web server a while back.
The Arduino Ethernet shield (using the Wiznet 5100 chip) is actually just right for serving and controlling the Arduino. It can handle up to 4 connections at a time (useful for serving pages and images - although, I would not recommend serving large images from the Arduino )
Have a look at my example (there is a demo there):
Have you had people access it successfully over the internet?
I heard about this maximum connection limit and apparently a single user could max it out as their browser makes more than one connection.
You could try only serving up the actual HTML from the Arduino, and linking to some other site for images, css files, etc. That should reduce the number of concurrent connections that the browser asks the Arduino for.
Borb - if you check out my example, it's publicly available. It's running right now (I can't guarantee how long it will be up for). Connections get queued, so a client will just wait until a connection is free. The bottom line is that you can have a mazillion people hit the server and they will get serviced as long as the client waits long enough.
estranged - the best balance, IMO, is to put static files on a separate server.
Emyr - Ben's webduino library is pretty cool, but it doesn't have any of apache's directives Kidding aside, the WizNet 5100 is pretty decent at handling requests.
bhagman: Thanks that's an excellent proof of concept. So you're handling the queuing in your software correct? Good idea. Question: why the uMMC module? Doesn't the ethernet shield have an SD card slot that could be used?
Also, would there any way to output the number of connections that the wiznet is making at any one time to some hardware (such as activity/usage indicator LED type thing)
There really is no queuing per se. When the server is busy, it accepts no more connections. The client keeps trying to make the connection until it makes a connection or reaches it's time-out for waiting.
The Rogue Robotics uMMC makes life easier for writing/reading from and SD card. You could always do your own SD card interface, but for about $10 more than buying a breakout board, you can have it all done for you.
It's non-trivial for an average person to put together a circuit to communicate with an SD card. There are a bunch of threads around here showing how to do it, but you'll find that there is a lot of work involved.
The SD card socket on the ethernet shield is not wired properly to be used effectively with the Arduino. So you'll find it's a lot of effort to get it working (lots of cuts, jumper wires, and headaches).
Now, to see the number of connections that are coming in, you would have to dig a bit deeper into the WizNet docs to see how to check each socket's status. It can be done.