Pages: [1]   Go Down
Author Topic: My Arduino Web Server  (Read 7745 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 16, 2011, 10:03:31 pm by physic.dude » Logged

Florida
Offline Offline
Sr. Member
****
Karma: 4
Posts: 431
hookedup!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 !
Logged

Florida
Offline Offline
Sr. Member
****
Karma: 4
Posts: 431
hookedup!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Logged

Oxford, UK
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Minnesota!
Offline Offline
Sr. Member
****
Karma: 0
Posts: 386
My nickname on the forum used to be Soapy29.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How do you do the hit counter?
Logged

Find AKSoapy29 on:
Youtube
Website

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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:
Code:
int hits = 0;
int bangs = 0;
The following code should come after the main HTML content is sent out,
Code:
        //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.

« Last Edit: January 18, 2011, 07:37:03 pm by physic.dude » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Very nice project, and that box looks elite!
« Last Edit: January 18, 2011, 07:45:08 pm by klz327 » Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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

Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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

« Last Edit: January 18, 2011, 08:07:04 pm by physic.dude » Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-wink
Logged

UK
Offline Offline
Newbie
*
Karma: 0
Posts: 8
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  smiley-wink
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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. smiley
Logged

Pages: [1]   Go Up
Jump to: