Pages: [1] 2   Go Down
Author Topic: Public Ip of my eth shield  (Read 3135 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 644
Posts: 50452
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
Logged

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: March 06, 2012, 12:03:55 pm by magagna » Logged

http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 224
Posts: 13917
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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 smiley
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-slim
All the rest are secondary problems :-)

tanks all
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9698
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

good question smiley-confuse

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
 
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9698
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 224
Posts: 13917
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>

 smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry smiley-cry
Logged

0
Offline Offline
Tesla Member
***
Karma: 145
Posts: 9698
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Code:
#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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nobody see the error?

and if the error is made by the IDE?

my OS is ubuntu 10.04.
Logged

Pages: [1] 2   Go Up
Jump to: