You are currently browsing the archives for the Tips & Tricks category


iPhone App V1.4 Notes

The iPhone App V1.4 release on Sep 12th 2013 adds a new field to the caddy configuration. The field allows the user to select the Firmware Version.

When upgrading to 1.4 make sure you select the correct Firmware Version for your caddy or the app might not display the zones properly.

New Config Field V1.4

DHCP or Static IP addresses ?

A while back I realized that most users are unaware of a very useful feature most new internet routers provide. That is the ability to tell the router to always assign the same IP address to the same MAC address while still using DHCP addresses.

Many IrrigationCaddy users like to enjoy the ability of controlling their caddy from the Internet, while on vacation, on a trip, or whatever the reason. Most however tend to want to set a static IP address on the IrrigationCaddy, so that then they can do Port Forwarding to that IP address, knowing that the IP will never change. The fear is that if the router reboots for example, that if the caddy is on a DHCP address, port forwarding would be lost. The good news is that most modern routers will allow the user to fix a DHCP address to a specified MAC address.

Note that either method works just as well, whether the user sets a Static IP on the caddy, or fixes a DHCP address on the router.

The following is a screenshot from my Linksys router running a “DD-WRT” firmware, which is an open source router firmware.

Fixing a DHCP address to a MAC Address

Fixing a DHCP address to a MAC Address

 

Almost all modern routers will allow users to do this type of static lease assignment. If you are curious you might want to check.

The benefit of doing this, is that there is no setup needed on the caddy. Even if you reset the caddy and clear all its settings, the next time it boots the caddy will still get the same IP address; if the settings were set with a static IP and the caddy is reset, the user would have to specify the static IP address again.

API

One of our users wanted to be able to control the IrrigationCaddy from another application he uses, and so we helped him figure out how to do that using HTTP POST and GET requests. I know some of you reading this post might also be interested in this type of capability. The user has been kind enough to share his work on Sourceforge:

http://sourceforge.net/projects/irrigationcli/

and here is a screenshot:

Controlling the IrrigationCaddy from the Internet

Controlling the IrrigationCaddy from the Internet, either from your smartphone device, or from any computing device with a standard web browser is simple.

The best known method to do this, is by using “Port Forwarding“. Port Forwarding is the ability to map an external port on your router, to an internal IP address + port combination.

External IP Address

Most residential users have a DSL/Cable Router. I own a WRT610N router made by Linksys. I will use my router’s interface to guide you through, however you will have to adapt the instructions to your own router’s interface. The router is your gateway to the internet. All traffic coming into or going out of your network has to go through your router. Now the router has an IP address assigned to it by your ISP (Internet Service Provider).  

Router's external IP address

Router's external IP address

So that is your external IP address. This is the address you have to use when you are on the Internet in order to access your network. By default your router will reject pretty much anything trying to get into your network using this IP address. So let’s say your External IP is:

70.116.168.52

if you go to your browser and type:

http://70.116.168.52

you will probably get an error message, and nothing will display. However what you would like to do is to type something like:

http://70.116.168.52:8095

and in return get the IrrigationCaddy user interface. The 8095 number after the colon is the port number.

Internal IP Address

When you install the IrrigationCaddy on your network, the IrrigationCaddy will have its own IP address, which is “internal” to your network. This IP Address is only valid within your own home network, and you cannot reach it from the Internet; unless you use Port Forwarding that is.

Internal IP Address

Internal IP Address

You will notice that above the Internal IP Address, on the Settings page, the “HTTP Listen Port” is also listed. This is the port number that the IrrigationCaddy is listening on for HTTP connections. So when you are sitting at your computer, and type the following on your web browser:

http://192.168.0.120:80

the IrrigationCaddy’s user interface shows up. Since 80 is a standard port number, you don’t have to explicitly write it on the address, but I am listing it here for illustration purposes.

Port Forwarding

Now the fun begins.

The idea is to map the external IP address, and some port of your choosing on the Router, to the Internal IP address and the port number that the caddy is listening on. So that when you are away from home, and just got notified that your city just applied watering restrictions, and you would like to change your watering schedule, you can do it from your phone, simply and quickly. This is done by configuring your router to do Port Forwarding.

Pretty much every modern DSL/Cable router supports this feature. They all have different user interfaces, but the concepts are the same, and you should be able to adapt the methods explained here, to your own router.

On my router, the Port Forwarding feature is under the “Applications & Gaming” tab.

 

Port Forwarding
Port Forwarding

In  the picture shown above, you can see that the settings required to setup port forwarding are pretty self explanatory. There is an “External Port”, an “Internal Port”, a “Protocol” (TCP or UDP. You need at least TCP ), and the “To IP Address” ( this is your internal IP Address ).

In the example shown we are telling the router that when someone tries to access our router using the “external” IP address,  and it is going to port number 8093, that the call should be routed to the internal IP address “192.168.0.120″ on port 80. Now it just happens that that IP address is the IrrigationCaddy’s IP address, and that 80 is also the port number where the IrrigationCaddy is listening for connections.

The result is that when you open your web browser and while on the internet you type:

http://70.116.168.52:8093

the IrrigationCaddy will respond to this call, and answer by sending back the IrrigationCaddy’s user interface HTML code. If the call was made from a web browser somewhere on the internet, the browser will display the familiar IrrigationCaddy web page.

Security

NOTE: Make sure that when you setup Port Forwarding, you also enable “Authentication” on the IrrigationCaddy. When Port Forwarding is enabled, anyone on the Internet, which knows your External IP address, is now able to do what you can do on the browser. So you want to make sure that if someone is able to access the IrrigationCaddy through the internet, that they are not able to login and change your settings. You don’t want people you don’t know playing with your water bill; so be careful.