Hardware Reference
In-Depth Information
credentials. (If you never changed them from the default values, you might be
able to find them in your router's setup manual.)
If that IP address does not work, you need to determine it manually. On
Windows, you can open a command prompt and type ipconfig . You want to
use the Default Gateway address for your active network connection. If you
are on a Mac, access System Preferences, go to Network, click the Advanced
button, go to the TCP/IP tab, and use the Router Address. If you are in Linux,
open a terminal, type route -n, and use the last Gateway Address listing that
is nonzero.
Reserving Your Arduino's DHCP Address
Once in your router's admin console, look for an option to reserve DHCP addresses.
By reserving a DHCP address, you are ensuring that every time a device with
a particular MAC address connects to the router it will be assigned the same
local IP. Reserved IP addresses are never given to clients with a MAC address
other than the specified address, even if that reserved client is not presently
connected to the router. By reserving your Arduino's DHCP IP address, you
ensure that you'll always be able to forward web traffic to it in the next step.
Once you find the option, reserve whatever IP address your Arduino is cur-
rently using by assigning it to the MAC address that you set in the sketch earlier.
Be sure to apply the setting, which may require restarting your router. You can
confirm that this works by restarting your router and the Arduino and seeing
if your Arduino gets the same IP when it reconnects.
You can also accomplish the same effect by giving your Arduino a static IP
(not using DHCP) in the sketch. The Arduino website describes how to do this:
http://arduino.cc/en/Reference/EthernetIPAddress .
Forwarding Port 80 to Your Arduino
Now that you have an unchanging local IP address for your Arduino, you need
to pipe incoming web traffic to that internal IP address. Port forwarding is the
act of listening for traffic on a certain port of router and always forwarding
that traffic to a specific internal IP address. Port 80 is the default port for HTTP
communication, so that is what you will use. Locate the right option in your
router administration panel and forward external port 80 to internal port 80
on the IP that you just assigned to your Arduino. If the router specifies a range
for the ports, just make the range 80-80. Now, all traffic to your router on port
80 will go to your Arduino.
Using a Dynamic DNS Updating Service
The last step is to figure out how to access your router from elsewhere in the
world. If you are working on a commercial network (or you pay a lot for your
home's Internet connection), you might have a static global IP address. This
Search WWH ::




Custom Search