Simply internet checking with Ethernet shield

Hi to everyone! I write to you becouse i need to understand something about ethrnet shield. I decided to made up a simply sketch that check the internet status every n minutes but honestly i don't want to ping a server or make a get request (like i can find in the example here) i just need to check the internet connection, is the router online properly? OK, wait n minutes, ask again, wow the router is offline..some problems are occured! In this case, maybe i will active a relè for n second in order to "reset" the router. This is a 3G router i simply plug arduino into router, router is also connected to a pc or something and i use arduino to check the connection. This kind of router isnt so reliable..

I try to ping and ask a get request ok, i just need a very simply code in order to avoid errors in code you know.

Have you got any advise ?

I read the reference about Ethernet lib, if i (pseudo coding) use the "EthernetClient" is a good choice ? is it a bool so i can easly check the status or something.. i am not so good in ethernet field :)

Thank you for any help!

i just need to check the internet connection, is the router online properly?

A router is a piece of hardware. It isn't online or offline. It simply is. It may allow you to connect to another machine, or it may not. The only way to know is to try to talk to that machine. If the attempt succeeds, the router is working. If not, there may be any number of reasons why the attempt failed.

The router being down is not at the top of the list.

Sorry, i was out city for Easter Holiday.

Yeah, you know, i meant access point.

In my case i got a 3G access point (it use a SIM Card and provide connection via cable or via WiFi).

In my case i got a 3G access point

In this case read the manual of your device how the get the connection status. This is very device specific and you didn't provide a link to your hardware so don't expect any more help from us. BTW: Even if your device reports that it's online there may still exist a problem somewhere on the path to the Internet. Pinging a host (or a bunch of hosts like www.google.com) is the easiest and much more reliable way to get your online status.

You know, but is it a little bit hard to me find a tecnical manual of access point (it's sort of a chinese product) but thank you, i will try this way.

Now, i try to make a client.connecton and client.avaible for check the internet status it's doesnt work well as i hoped.. Maybe i can try to ping a bunch of server it's a good solution, i try with ICMPPing but actually i cant manage the time out.

I will try with more attention.

Thank you.

Hi to everyone.

At the end i choose to ping a server every n minutes, if i get n bad result i assume there is some problem so i reset the access point.

I hope it is a good solution.

I also log the bad result on the SD card

Can you show you scatch and library to ping?

Ps.Myne solution for unpower and power back adsl2 router on connection lost. http://publikz.com/wp-content/uploads/2013/04/sketch_mar31a.rar Icmp library is slightly changed.