Ping From USB

Hello,
Hi im planning a school project. I need my arduino to ping a web address. I also want the arduino to show some status lights. Like connected to the internet, and if it pings a address show status based on the response of that page. So I can either have that page spoof a error like 404 or 403, or just have that page send a variable back. What would you best recommend I use to complete this.
Thanks,
-tomagig

You need an Ethernet shield in order to do this.
Alternatively get something like Processing to do it and communicate it to the arduino down the serial port.
The title of this post is not very accurate as you can't ping from USB.

Thanks,
Is there a way without software on the computer you can plug the ardueno into a computer and it can access the internet from the computer. I didn't think you can but if it is possible that would be nice.
Thanks tho.

Without any software on the computer no.

Ok thanks,
Do you know of any tutorials on programming for the ardueno and for the Ethernet shield. I program for the web as of now.

If you look at any of the Ethernet shields available they all come with their own versions of example code to do this. This code will be different on different Ethernet interfaces so there is no one universal example to follow.

Ok what is the best and cheapest one available.
Thanks,

Two questions, normally you can't have both.
Also if you are looking for a recommendation you have to say where in the world you are. You should fill in that part of your account or mention it.

Im in United States of America. I know I can't have both but the closest or one that you have used and know that works great.

Try this one:-

Thanks

I need my arduino to ping a web address. I also want the arduino to show some status lights. Like connected to the internet, and if it pings a address show status based on the response of that page.
[...]Is there a way without software on the computer you can plug the ardueno into a computer and it can access the internet from the computer

Actually you don't need the computer at all! Arduino can work as a standalone webserver, hence it's just a matter of properly programming it to "ping" a site.
But I don't know how "ping" works, sorry.

Anyway I guess it's just a matter of "printing" proper strings on the network.
These are strings Arduino "prints" on network upon receiving an HTML request:

client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("<html>");
client.print("<head><meta http-equiv=\"refresh\" content=\"1\"></head>");
client.println("<body>");

I found this code to act as client rather than as server:

#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 88 };
byte gw[] = {192,168,1,1};
byte server[] = { xxx, xxx, xxx, xxx  }; // Server IP
byte subnet[] = { 255, 255, 255, 0 };
int data = 0;
int tempPin = 2;  // In This case the temperature is taken from pin 2 and sent to a sql server

void setup()
{

pinMode(tempPin, INPUT);
Serial.begin(9600);               // Used for serial debugging

}
void loop()
{

Serial.println("Program running...");

 delay(5000);
 senddata();                                 // Data is sent every 5 seconds

}
void senddata()
{

data = analogRead(tempPin);           //Reading analog data


Ethernet.begin(mac, ip, gw, subnet);
Client client(server, 80);
Serial.println();
Serial.println("Forbinder?");
delay(1000);                                    //Keeps the connection from freezing

if (client.connect()) {
Serial.println("Connected");
client.print("GET http://server.com/script.php?vaerdi=");
client.print(data);
client.println(" HTTP/1.1");
client.println("Host: www.server.com");
client.println();
Serial.println();
                           }

else
{
Serial.println("Connection unsuccesfull");
}
//}
 //stop client
 client.stop();
 while(client.status() != 0)
{
  delay(5);
}
}

But I don't know how "ping" works, sorry.

Ping is an ICMP message. ICMP is a brother of TCP and UDP. details see

Be aware that a computer is not required to react to a PING and many ISP's filter them out.

Actually there is a solution that can work without an ethernet shield.

GoBetwino can ping a server and tell Arduino over the serial port if it answers or not.

Thanks all. I also want to set up some boards and some how contact them with a command to do something. Is there a tutorial on this?

The way to do that depends a lot on your planned topology.

One board? many boards ? how are they connected ? what is a command ? Should the boards reply ?

More info needed :slight_smile:

Actually there is a solution that can work without an ethernet shield.

But it requires a whole PC!

Yes and that is exactly what the original poster requested.

A way to do it over USB

Well that's ok because the person using the buzzer will have a whole pc. You see I created a jeopardy alternative. Called Drew's Quiz Cube, found at www.drewsquizcube.tk. And as it is now they have a window with a button that they click to buzz in. What I want to do is have it so when they click a button it buzzes them in. It's a cool game check it out if you wish, im still alpha testing.