This instructable is going to show you how you can make your own "ServDuino" web server, and get it on the web without some of the roadblocks that I, and many others have faced.
Some of this instructable is a work in progress - specifically the code on the programming step. Not all of the code was released as of the publishing of this instructable because I am always improving or writing new code for my projects. I am also seeking help from the instructables community in writing code, not because I am lazy, but because I know that I don't have the most efficient code, as I have been programming in c for only a few years, most of which is spent in the world of Arduino.
Don't forget to rate!
I entered this into the Microcontroller contest, so if you think its awesome, or it helps you off the ground with the ethernet shield, vote for it! :)
Remove these ads by
Signing UpStep 1: What You Will Need
The Required Parts are:
An Arduino
An Arduino Ethernet Shield - Note: If you have an older shield, you will not be able to use an SD card with it. If you don't have a shield, get the newest version!!!
Optional Parts:
A box to put it in - Recommended
A Servo
An LCD Screen
Some LEDs
An SD Card
Even More Optional Parts - These are for external controls and/or sensors:
A Second Arduino
Whatever sonsers and controllers you want
Either a Long Cable or a wireless Transciever (like an Xbee)












































Visit Our Store »
Go Pro Today »




Catch just me with the Arduino and its potential deal.
Since I need a web server that reads all data from the SD card
I have the script on my Arduino SDWEBSERVER_FAST_LCD.
Running with the DYNDNS perfect.
Only when I: http://NAME.DYDNS.COM/test/ (here in directory there is an index.htm) write, appears donload windows.
I give but a http://NAME.DYDNS.COM/test/ index.htm
goes to the page.
There's an error in your script?
My question 2:
I would now like Led and power switch on the Web, but the code is not in the store Adruino special embed in the HTML file.
Adjust so I just need to code the HTML and not always in the code Ardoino.
Is that how and when do you do that?
Thank you.
Newark Part Number: 65T3485
Thank you so much for the helpful Instructable.
Good luck with your server! Glad you found this 'ible helpful!
Unfortunately, I think the only way to speed up the connection would be to use parallel communication with the wiznet chip. That would require a rewrite of the ethernet libraries.
As to the FTP, I don't think it would be possible. The Arduino libraries only allow 1 open port, and to have http plus ftp would require 3 ports (ftp takes 20 and 21). Plus you would need a way to store the files to the card...Things would become very complicated very quickly.
anyone have idea to give me an example, thanx...
I think all the right text is there but the stuff about blocking ports and port forwarding should be moved to the relevant paragraph instead of sending people on a wild goose chase when trying to sort out a problem in their LAN :)
The line which says " Somebody could get into your router through your firewall and access personal information" when all they have is your IP address just makes me angry. IP addresses are public information - you reveal it to everyone every time you send them an email or give out the domain name. This statement is totally wrong and just confusing for the user and the author clearly doesn't understand the basics of the Internet. You cannot get through a firewall and access personal information (that's the entire point of a firewall). Similarly, if you give them a domain name, then that obviously reveals the IP address too as you can see if you "ping" the domain name and see the IP - it doesn't hide anything.
I now realize that this step is misleading and incomplete. When I find the time, I plan on rewriting it to be much more organized and systematic.
As to the firewall and ip issue, I feel stupid and ignorant now having wrote that a while ago. I understand that that is false and confusing information. I have replaced it with a more reasonable substitute: We are not very good at remembering strings of numbers, but we are good at remembering words and names.
I hope that this comment and future work will help to clarify the process.
I understand the issues and I understand perfectly what you are trying to say, believe me. Basically I will break the step down into a few main paragraphs. The first being about finding out the router's ip range and testing the server with the default program. The second being about port forwarding and alternate ports. And the third paragraph being on finding the external ip and testing the server from it. If I find three paragraphs to be too crowded or misleading, I will break it up even further.
Trust that at some point I will fix the issues but also understand that they are of little concern to me as of present.
Sdwebserver fast don't work With arduino UNO.
Client.write(buf,maxbyte) don't send data.
Tanks for attention!!!
indeed, better to change tje ip address in the program to one that is available on yr network and that depends on the router you may be using. Some go in the 192.168.1.xxx range, others in the 192.168.0.xxx range, or even the 10.0.0.xxx adress range as mentioned earlier.
If someone had my -external- ip address and I have a webserver running, then indeed by typing in that ip address, they could have a look at the main page of that websever, provided I had forwarded port 80. But that is still a far cry from being able to access my personal information, unless I would put that on that particular webserver.
As most arduino / ethernet adepts will probably use it to read out temperatures and put that on a web page, All the culprit wld be able to see is how warm your house or garden is.
It would be different ofcourse if you set up a webserver ro control functions, then any passer by (provided you have an open webserver) could alter functions in your house, like switch the lights on or off :-)
Is what i have been looking for.
Thanks for sharing.
Timóteo
Thanks
code:
// variables for input pin and control LED
int analogInput = 1;
int LEDpin = 13;
int prev = LOW;
int refresh = 1000;
float vout = 0.0;
float vin = 0.0;
float R1 = 45000.0; // !! resistance of R1 !!
float R2 = 4500.0; // !! resistance of R2 !!
// variable to store the value
int value = 0;
void setup(){
// declaration of pin modes
pinMode(analogInput, INPUT);
pinMode(LEDpin, OUTPUT);
// begin sending over serial port
Serial.begin(9600);
}
void loop(){
// read the value on analog input
value = analogRead(analogInput);
//Serial.print("value=");
//Serial.println(value);
if (value >= 1023) {
Serial.println("MAX!!");
delay(refresh);
return;
}
else if (value <= 0) {
Serial.println("MIN!!");
delay(refresh);
return;
}
// blink the LED
if (prev == LOW) {
prev = HIGH;
} else {
prev = LOW;
}
digitalWrite(LEDpin, prev);
// print result over the serial port
vout = (value * 5.0) / 1024.0;
vin = vout / (R2/(R1+R2));
//Serial.print("vout=");
//Serial.println(vout);
Serial.print(vin);
Serial.println(" volt");
// sleep...
delay(refresh);
}
In order to help you get this working, can you please give me some insight on what you are trying to do? I would like to know what this code is supposed to do and how you want me to get it working with the webserver programs. If you could please, can you tell me if you are trying to make this work along side the code or make all of the information in the Serial.print lines be displayed on the webpage? If you get back to me with some information I will gladly give assistance as best as I can.
I would like to make a web server with a voltmeter it doesn't have to be anything fancy just something like 'Solar Panel Battery Voltage' '12.24 Volts'. The code I posted was an example of how the volt meter works. I don't know how to add a code along side the main bit that runs the server.
Thanks for your help! :)
I must apologize for I am really busy right now so I probably won't be able to get the code running and tested until later in the week. If you need it before Friday please let me know and I will do my best.
Sorry once again,
Gigavolt
I wrote and tested the code and it works. If you have any question about it or need help with anything else, please ask.
Gigavolt
Because I'm going to make my office controlled by a ethernet arduino.
Controlling lights and powersources and showing some enviromental data on a webpage.
I was thinking to pull and push the data and controls by ajax.
Arduino by itself is no problem but I never tried the ethernet shield and/or the SD libraries.
And I'm going to use the ENC28J60 ethernet module.
I hope there is enough space on the arduino chip.