Go Down

Topic: Obtainning the public IP with EtherCard Library and ... (Read 1 time) previous topic - next topic

phantom89

I built a simple arduino server,using the EtherCard library..
Can I obtain my public ip address ?.. and can I make my arduino server listen only to a selected port?

dxw00d

Try http://www.whatsmyip.org from a web browser.

I don't know about making the Arduino only listen for a particular port, but your router should be configurable to only forward a particular port to the Arduino's IP address.

pYro_65

Forum Mod anyone?
https://arduino.land/Moduino/

phantom89

may configuring my router would help.thanx for the idea.

But I need to obtain my Public ip by arduino itself...cant EtherCard library do that?

dxw00d

I imagine that you could make it read http://www.whatsmyip.org, and parse the result. Why does the Arduino need to know your public address?

phantom89

thats a good idea, is it possible to do so?

Im building this server so I can access thos via internt also, not just a lan server. But I have a DSL connection Dynamic IP . so I have to update my website with my server IP frequently. There are other ways such as DDNS and pachube.. But as this is a Uni project I need to do something by myself. so I had this little idea of obtaining my public ip qith arduino n update my web page with that some how.

pYro_65

#6
Feb 07, 2012, 01:54 pm Last Edit: Feb 07, 2012, 01:57 pm by pYro_65 Reason: 1
if you can write php, have the arduino occasionally call a website page ( RefreshArduinoIP.php ), then use the php server variables to get the ip address of the client, then save that in a text file your other pages can read to talk to the arduino.

EDIT:
I believe the $_SERVER[ 'REMOTE_ADDR' ] variable will contain the public IP of the client.
Forum Mod anyone?
https://arduino.land/Moduino/

Go Up