So I'm playing around with this arduino project:
https://arduino-info.wikispaces.com/ethernet-temp-humidity
Basically I can take temperature and humidity readings and calculate the dew point and have them displayed on the internet using an Ethernet shield.
The problem is when I figured out how to assign the sensor/ethernet shield an IP address, it turns out its a local ip address which prevents me from accessing the readings from a device outside my LAN, like my phone using 3G or LTE.
My question is how can I assign the ethernet/sensor a global ip address that would allow me to view the readings from anywhere? I"m using an arduino uno with DHT11 temp sensor. My router is an Netgear n300 Wn2000.
The ethernet/sensor is operating though my wireless router at home. If you can, please include relevant websites PDFs, articles, that my be of help.
I'm a EE student so I know some tech stuff, but to be honest network stuff I"m pretty nube to.Thanks again.
You have encountered what is known as "Pandoras box"
What you need to do is set your ethernet board a static IP so that you know where it is (instead of a moving target) using a local address on your LAN. Then you go into the router and enable "port forwarding" and point it at your local ethernet board. This has several issues worth giving serious consideration to:
-
many ISP's will block port 80 from going to your WAN to prevent their users from having their own servers (of course for $$$ they will be glad to "assist" you in that endeavor .. ).
-
you have now opened that gate to let all those hackers out there probe your board (you would be amazed if you saw how many probes your router blocks all the time!!!!! :o )
-
the WAN address you have on your router (which is where you would point your phone etc.) is subject to change - typically your ISP hands out IP addresses using DHCP using "leasing" which needs to be renewed periodically - at that point you may get a new address. There are some services out there with an associated program that runs on your computer that periodically checks the address of your WAN and updates the information if it changes.
Short reply thank you so much for the time you put into your response. I'm in class right now. When I get home I'll read over again and return with more questions.
ok so I made some head way. I'm at the port forwarding part now and I'm having a bit of trouble determining what port to use. I've played around with canyouseeme.org with no success. Do I just trial and error with different ports or what? I've already assigned a static ip address to the ethernet shield. Any words of advice on the port allocation? Thanks again
That gets into a fuzzy area - for http, the normal port is 80, however many ISP's will block that to prevent their customers from having their own servers. You can try ports like 8080 or something - right off the top, I can't remember if it is 1024 or 2048 that is the top of assigned ports (for things like FTP, telnet, http etc.) you can use any above that. Recognize you have to not only configure the router, but you also have to tell your browser what port to look at (80 is assumed for http - you have to specify if using a different one) you also have to configure your shield to listen on the port you want to use so there are 3 places you have to specify if using a non-standard port.
Here is some additional information on ports used for "stuff":
List of Ports for TCP and UDP
Common Ports
Well known port numbers
What is port forwarding
Hope that helps.