Public Ip of my eth shield

Hi all

my problem is the sequent:

im able to use my arduino+ardu eth in my home sub net but i'm not able to find the public ip of my device(arduino ethenet shield).
I know that the ip is dynamic, but is another problem, becouse if i dont switch off my modem the ip dont change, i think, may change only the route(another problem again).

for example, in my sub net my ip is 192.168.0.xxx.
with my browser i can pilot arduino sendig comand at http:\192.168.0.xxx

BUT, if i go out of my sub net i don know what is my address.

I hope that some one can explain me how to find the public address.

Thanks to all.

im able to use my arduino+ardu eth in my home sub net but i'm not able to find the public ip of my device(arduino ethenet shield).

That's because it doesn't have one, most likely. If you have a router, the router has a public IP address. The Arduino does not. The router needs to route data for a particular port to the Arduino.

ok,

that why i have reconfigured the port 80 of my router.

but now i ask you, how can i find the ip of my router?
Because i think it is different from public ip of my pc.

And when i know the ip of my router, what I have got to do?
I'm trying to use the example "web server":
Can you say me all passages to ping the ardu server from a remote station beginning from "web server" ?
For the dynamic ip there is no problem, suppose that the program have to run just one time.

thanks :slight_smile:

Are you asking how you can find the public IP of your router? From any computer inside your network go to http://www.whatismyip.com and it will tell you.

If you want to access your Arduino from the Internet then in your router you would add a rule to forward TCP port 80 traffic from the public interface to the IP address of your Arduino. Different routers do this different ways; if you can't figure it out let us know the model # of your router and we'll try to help.

ok, now I'm not at home, I'm at the university and now my ip in 79.7.175.12.

for the router i think to it is configured properly because in my subnet from my pc(by wireless) the server ping (by ethernet connession) correctly.

check the site - www.no-ip.com - you can get a real hostname that maps onto your router.
Forward the router-port to your arduino -
The Arduino must have a fixed IP address in your local network (outside your DHCP range)

and your done (between 1-10 hours later :slight_smile:

I'm already recorded in no-ip.com and i will use host service when i will see that I'm able to communicate with ardu eth.

This are all "ideas", i need pratical advice for find my ip :relaxed:
All the rest are secondary problems :slight_smile:

tanks all

This are all "ideas", i need pratical advice for find my ip

Once again, which IP address are you wanting to find, the IP address assigned to the arduino ethernet shield, the LAN IP address of your router, or the WAN IP address of the router which the outside world uses to connect to your router?

good question :~

I think that i need to know the last one.
I need to connect a remote device to my router which communicate to eth shield

I think that i need to know the last one.

To find the router WAN IP address you can 1). go to your router's setup application and see the assigned WAN IP address there, 2). write some code to parse the return info from the http://www.whatismyip.com site, or use the www.no-ip.com service to do the work for you. Study up on these options.

Have you seen - http://arduino.cc/forum/index.php/topic,95456.0.html - is a no-ip topic too.

WTF..

I'm trying to connect to no-ip.com

why not compile??

he say me:

sketch_mar07a.cpp:10:1: error: ‘EthernetClient’ does not name a type
sketch_mar07a.cpp: In function ‘void setup()’:
sketch_mar07a.cpp:15:25: error: no matching function for call to ‘EthernetClass::begin(byte [6])’
/usr/share/arduino/libraries/Ethernet/Ethernet.h:16:8: note: candidates are: void EthernetClass::begin(uint8_t*, uint8_t*)
/usr/share/arduino/libraries/Ethernet/Ethernet.h:17:8: note: void EthernetClass::begin(uint8_t*, uint8_t*, uint8_t*)
/usr/share/arduino/libraries/Ethernet/Ethernet.h:18:8: note: void EthernetClass::begin(uint8_t*, uint8_t*, uint8_t*, uint8_t*)
sketch_mar07a.cpp:24:6: error: ‘client’ was not declared in this scope

The first error refers to:

EthernetClient client;

but I have imported

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

=( =( =( =( =( =( =( =( =( =( =(

why not compile??

Probably something wrong with the code you have NOT posted. For help you need to post your code with the sensitive parts removed.

I use a cose of a another post:
http://arduino.cc/forum/index.php/topic,95456.0.html

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

byte mac[] = { 0x90, 0xA2, 0xDA, 0x00, 0x04, 0x16 };
char noipServer[] = "https://dynupdate.no-ip.com";

EthernetClient client;

void setup() {
  Serial.begin(9600);
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
    // no point in carrying on, so do nothing forevermore:
    while(true);
  }
 
  //Give time to initilize:
  delay(2000);
 
  if(client.connect(noipServer, 80)){
    Serial.println("Connected to noip");
   
    client.println("GET /nic/update?hostname=johndoe.no-ip.org HTTP/1.0");
    client.println("Host: dynupdate.no-ip.com");
    client.println("Authorization: john.doe@gmail.com:mypassword");
    client.println("User-Agent: Johns Arduino Client/0.0 john.doe@gmail.com");
    client.println();
   
//Wait for response

   while(client.connected())
   {    
      // stay in this loop until the server closes the connection

       while(client.available())
       {
         // The server will not close the connection until it has sent the last packet
         // and this buffer is empty

         char read_char = client.read(); 
         Serial.write(read_char);
       }
   }
   // close your end after the server closes its end
   client.stop();   


    
    
  }
}

void loop() {

}

Thanks to all

Nobody see the error?

and if the error is made by the IDE?

my OS is ubuntu 10.04.

renzo893010:
Nobody see the error?

Yes. This is a SSL connection (port 443) and requires encryption, which the Arduino library code does not support.

char noipServer[] = "https://dynupdate.no-ip.com";

You are connecting to port 80

if(client.connect(noipServer, 80)){
    Serial.println("Connected to noip");

sketch_mar07a.cpp:10:1: error: ‘EthernetClient’ does not name a type
sketch_mar07a.cpp: In function ‘void setup()’:
sketch_mar07a.cpp:15:25: error: no matching function for call to ‘EthernetClass::begin(byte [6])’

You need to address the issues in the order that they are listed. Which version of the IDE are you trying to compile this code on?

When I try compiling it on 1.0, the only "error" I get is:

Binary sketch size: 12984 bytes (of a 30720 byte maximum)

Per the below, one probably should be using the http:// instead of https://.

Dynamic updates are performed by making an http request to one of the following URLs:
http://dynupdate.no-ip.com/nic/update


https://dynupdate.no-ip.com/nic/update