trigger a pin via the internet?

Ok, so i have a server that host minecraft at my home, but it doesnt run 24/7 due to noise and power consumption (mostly the last)

i need to be able to turn it off when im not at home, and at first i thought i would do this, by sending it a sms using a GSM shield, those are however terribly expensive, so i now think im gonna go with the ethernet shield (well im gonna make a board that has the ATmega328 chip with a bootloader and the xtal and other stuff to run it, a transistor to act as a switch (wired in parallel with the servers on button) and a WIZ811MJ ethernet module. it will work like an arduino with a ethernet shield)

what i need is to have a webpage that has a button that say´s something like turn on and when pushed it sends something to the arduino that make the transistor do something like this:

digitalWrite(pin, HIGH);
delay(500);
digitalWrite(pin, LOW);

I have read up on different libraries and examples, but i still have got no clue of what to do :/

i would really apreciate if someone could help me :)

ALOT! :D

What do you think of a movement detector combined with a RTC = real time clock?

If there is no movement in the house OR it is time to sleep switch off the server. Can be used simultaneously as burglar alarm ;)

You might start with something like this: - http://www.communitymx.com/content/article.cfm?page=2&cid=8658A -

i would really apreciate if someone could help me

Have you tried any of the examples provided with the Ethernet library? When the Arduino acts as a server, it handles GET requests. A request for a web page containing a form, with a action button that sends the form data back to the same server, with parsing code on the Arduino, will allow the Arduino to determine if it is to do something (like set a pin HIGH, then LOW after a period of time).

well i need this for when im not at home and have forgotten to turn the server on, i can turn it on via a webpage.

i have read through the examples, but i dont understand how i should do what im interested in :/

i know a tiny bit PHP and are pretty sure i know how to make the site it self, however setting it up the arduino is were im stuck :/

can i make the arduino act as any other webserver, that just sends/opens the file called index.html when someone visits the site?

can i make the arduino act as any other webserver, that just sends/opens the file called index.html when someone visits the site?

Perhaps you could start with making your shift key work.

It does not sound like you have any experience with web design (necessary if the Arduino is to be a web server), form design.usage (necessary if the data entered is to be sent back to the Arduino), or Arduino programming (necessary to interpret and use what you get back).

I'd recommend that you break this project into three parts. Install a web server on your computer - Apache is free, easy to install and configure and dirt simple to use. Then, learn some stuff about serving web pages.

Progress to serving forms, with input boxes and/or buttons. Learn to write a script that is invoked when the form is requested/submitted.

When you have your PC serving up three pages - the initial form, the ON page and the OFF page, in response to the selection of the ON and OFF buttons on the form, you are then in a position to make the Arduino serve up and respond to the form submission.

It's not a difficult project at all if you have experience in web (form) design, web scripting (responding to the form data), and Arduino programming. It's a big job if you have none of the three skills.

A big sign on the door that says "TURN THE SERVER OFF" is cheaper and easier.

its not for turning the server off. Its for turning it on, if not in proximity of it.

i do have experience in HTML and CSS but not in making forms (other than a PHP email form) i also have some Ardunio experience (limited)

Oh and for assigning the MAC address.

in all examples its something like:

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

however when i think of MAC addresses i think of them like this: 07:e0:17:8f:11:2f or this 07-e0-17-8f-11-2f

is it me not understanding the byte value?

its not for turning the server off. Its for turning it on, if not in proximity of it.

i need to be able to turn it off when im not at home

Well, which is it?

however when i think of MAC addresses i think of them like this: 07:e0:17:8f:11:2f or this 07-e0-17-8f-11-2f

The MAC address consists of 6 btyes. Whether those bytes are shown with colons or dashes or commas between them matters not. The important part is the 6 actual values.

If you have a W5100 based ethernet adapter, then the below is a simple setup to try.

//zoomkat 12-18-10
//routerbot code
//for use with IDE 0021
//open serial monitor to see what the arduino receives
//use the \ slash to escape the " in the html 
//address will look like http://192.168.1.102:84/ when submited
//for use with W5100 based ethernet shields

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 102 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
Server server(84); //server port

String readString; 
 
 //////////////////////

void setup(){

pinMode(4, OUTPUT); //pin selected to control
//start Ethernet
Ethernet.begin(mac, ip, gateway, subnet);
server.begin();

//enable serial data print 
Serial.begin(9600); 
Serial.println("servertest1"); // so I can keep track of what is loaded
}

void loop(){
// Create a client connection
Client client = server.available();
if (client) {
while (client.connected()) {
if (client.available()) {
char c = client.read();

//read char by char HTTP request
if (readString.length() < 100) {

//store characters to string 
readString += c; 
//Serial.print(c);
} 

//if HTTP request has ended
if (c == '\n') {

///////////////
Serial.println(readString);

  //now output HTML data header

  client.println("HTTP/1.1 200 OK");
  client.println("Content-Type: text/html");
  client.println();

client.println("<HTML>");
   client.println("<HEAD>");
     client.println("<TITLE>Arduino GET test page</TITLE>");
   client.println("</HEAD>");
   client.println("<BODY>");
    
    client.println("<H1>HTML form GET example</H1>");

    client.println("<FORM ACTION=\"http://192.168.1.102:84\" method=get >");

    client.println("Pin 4 \"on\" or \"off\": <INPUT TYPE=TEXT NAME=\"LED\" VALUE=\"\" SIZE=\"25\" MAXLENGTH=\"50\">
");

        client.println("<INPUT TYPE=SUBMIT NAME=\"submit\" VALUE=\"Change Pin 4!\">");

    client.println("</FORM>");
    
client.println("
");

   client.println("</BODY>");
client.println("</HTML>");

  delay(1);
  //stopping client
client.stop();

/////////////////////
if(readString.indexOf("on") >0)//checks for on
           {
             digitalWrite(4, HIGH);    // set pin 4 high
             Serial.println("Led On");
             }
if(readString.indexOf("off") >0)//checks for off
           {
             digitalWrite(4, LOW);    // set pin 4 low
             Serial.println("Led Off");
             }
//clearing string for next read
readString="";
  
}}}}}