My Arduino Web Server

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 been looking to do something similar but no time yet, so your project may be a good starting point.

Thanks for posting your working CS card reading web server code - good stuff.

470 hits in 24 hours, cool.

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.

Very Cool !
like the poster above, a web server may be in a future project, and i'm sure your info will be helpful then.
Thanks !

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).

Very impressive! Thanks for posting physics-dude. You can learn a lot from doing projects like this :slight_smile:

How do you do the hit counter?

How do you do the hit counter?

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,

         //Hit counter
          if(bangs >= 2)
          {  
            hits ++;
            bangs = 0;
          }
          bangs +=1;

          client.print("Hits: ");   
          client.print(hits);   
          //End hit counter

"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 nice project, and that box looks elite!

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

Very nice project, and that box looks elite!

Thanks,
The case was originally a really old 2 way parallel port selector box. Here is what it looked like before.
http://www.national-tech.com/hires/40d3-17602.jpg

I think its broken mate. I keep pressing refresh but the hit counter isn't going up in the picture.

Only joking by the way. Awsome project, very well put together. I think that 1 should go down as a success. :wink:

I think its broken mate. I keep pressing refresh but the hit counter isn't going up in the picture.

Only joking by the way. Awsome project, very well put together. I think that 1 should go down as a success. :wink:

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?

Just to keep things organized,
When the New Arduino forums are up, I will remake this topic over there.

Don't bother to post in this thread anymore, I'll be asking more questions on the new forum. :slight_smile: