Ethernet to Internet ??? Addressing problem.

I get a Arduino Ethernet Shield on my Arduino Uno board.
Make a sketch that initialize my Ethernet with the folowing code :

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

byte ip[] = { 192, 168, 0, 198 }; //Manual setup only
byte gateway[] = { 173, 242, 209, 65 }; //Manual setup only
byte subnet[] = { 255, 255, 255, 224 }; //Manual setup only

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

EthernetServer server = EthernetServer(80); //port 80

Ethernet.begin(mac, ip, gateway, subnet); //for manual setup
server.begin(); /* Ethernet */

and send data with

client.print();

My sketch work weel if I stay within my router. But if I go outside my router (on internet not Ethernet) unable to find the URL.

Propably a question of addressing my router or my Arduino shield.

If someone can help....it will be appreciate.

Thank

Your challenge is due to this:

byte ip[] = { 192, 168, 0, 198 };   //Manual setup only
byte gateway[] = { 173, 242, 209, 65 }; //Manual setup only
byte subnet[] = { 255, 255, 255, 224 }; //Manual setup only

On this localnet, your gateway is unreachable. Since it works localnet, I presume the ip is correct, but the subnet mask and/or gateway is incorrect.

edit:

// this
Ethernet.begin(mac, ip, gateway, subnet);
// should be this
Ethernet.begin(mac, ip, gateway, gateway, subnet);

Thank for the help...

I take the subnet mask and the default gateway number on my DLINK device info page on the WAN section.

This is how my code look:

byte ip[] = { 192, 168, 0, 198 }; //Manual setup only
byte gateway[] = { 173, 242, 209, 65 }; //Manual setup only
byte subnet[] = { 255, 255, 255, 224 }; //Manual setup only
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

EthernetServer server = EthernetServer(80); //port 80

void setup()
{

Ethernet.begin(mac, ip, gateway, gateway, subnet); //for manual setup

server.begin();
.
.
..
}

Which URL address I have to call on my browser to access my arduino outside my localnet ?

Thank again...very appreciate

Alain

Trying different thing......pffffff

Now getting the information by IPCONFIG command in <accessory/dos command>

This is how my code look now:

byte ip[] = { 192, 168, 0, 198 };
byte gateway[] = { 192, 168, 0, 1 };
byte subnet[] = { 255, 255, 255, 0 };
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

EthernetServer server = EthernetServer(80); //port 80

void setup()
{

Ethernet.begin(mac, ip, gateway, gateway, subnet); //for manual setup

server.begin();
.
.
..
}

But still don't know which URL address I have to call on my browser to access my arduino outside my localnet ?

Thank again...very appreciate

Alain

Router port forwarding and a dynamic IP service are probably what you need.

https://www.google.com/search?num=100&lr=&hl=en&as_qdr=all&q=router+port+forward+site:http://arduino.cc/forum/&spell=1&sa=X&ei=TjRrUZvMAsXE4AOqw4HgDQ&ved=0CC8QvwUoAA&biw=1134&bih=618

You're right Zoomcat !!! and you too SurferTim the right code was "Ethernet.begin(mac, ip, gateway, gateway, subnet);"

Found the information by reading your old message on this forum before you get back to me Zoomcat...héhéhé

But THANK A LOT for the present message and the old one ....hahahaaha.

I do a port fowarding on my router and it's WORK now. Testing on my cellular.

I think it will work until I shut off my router.... after that my Internet provider will probably assign me a new IP address and i will have to make a new port forwarding or get a dynamic IP service.

Am I obligate to my Internet provider to have a dynamic IP address or it exist differents ways ?

Again thank all for the help....

Alain

u need a Dynamic DNS service

http://dnslookup.me/dynamic-dns/