I went a little overboard on this project, at first it was just a basic "Hello World" type of sketch, and then it turned into this. http://physicsdude.dyndns.tv/
Keep in mind that this is an Arduino. So,if the web pages start to load very slowly, its probably because you are not the only one viewing the site.
Thanks to everyone who helped me on these and other forums, it was a fun project. ;D
Don't hesitate to ask me questions, I was thinking about adding an FAQ section in the future.
I have a question though, is there a way I can change files on the SD card without removing it? Its a pain to take apart everything when I need to do so.
Yes you should be able to change the files. I have done test read and write to the SD card (not the same one, but same library I think).
So you could basically send from the computer to the arduino, via serial, a command that says "update file" and provides the filename and content. The arduino would then write the file content to the SD card.
Naturally you have to program both sides of that (arduino and PC code).
If you are hosting a web page from HTML files on the SD card you are going to make the Arduino send out data 2 times, one of the HTML file and one from the hit counter and/or other HTML code written directly on to the Arduino which is not part of the requested HTML file.
I have the source on the site already but here are the hit counter sections:
First define the variables:
int hits = 0;
int bangs = 0;
The following code should come after the main HTML content is sent out,
"Bangs" is simply a random variable I came up with. I'll be uploading new code soon and I changed it to something a little more understandable, "SentItems". It really doesn't matter what it is though.
Very impressive! Thanks for posting physics-dude. You can learn a lot from doing projects like this Smiley
Your right arduinomstr, besides learning more about the Arduino, I actually had to teach myself HTML since I decided to build most of the web site through a text editor. ;D
This project is not finished, I'm still working on it.
If I wanted to give it a version number it would be v0.83.
One think I really want to try to do is set it up where I can edit the SD card contents without removing the SD card, perhaps over the Ethernet or serial.
Any Ideas?