When I am not at home, I use Remote Desktop connection to log onto a computer at home and monitor several things like X10 activity, Video security cameras, etc
The problem always is that your IP address can change for various reasons, unless you have a fixed IP.
The other problem I have very rarely, is that my DSL modem/Router will lock up during heavy thunderstorms, even though it is on a UPS battery backup.
I think that mild surges on the phone lines cause that, and so I have to power off the router and power it back on to get my DSL internet connection going again.
I am going out west on vacation soon and so I thought it was about time I wrote a program that can take care of the situations mentioned above.
I need to stay in touch with my home computers and Murphy's law says that things will go wrong the minute I leave the house on vacation.
I have created a VB.net program using VB 2008 express that you can download and experiment with.
Unzip the whole project and then change the variables that need to be changed.
I have added lots of comments, so it should be easy to personalize the program.
Here's how it works:
The program goes to whatsmyip.com at an interval, (set by you, I do it once an hour).
It gets a small .txt file from whatsmyip.com that contains your main IP address.
It saves that text file to your local hard drive.
This file gets overwritten every time the program goes to get your IP again.
It then opens that text file and reads your IP.
It saves your IP and other status info to another file on your hard drive.
This status file gets uploaded via FTP to a web server.
If your IP is the same as last time it checked, it does not bother to FTP upload the file again.
You can then use a browser anywhere in the world to find out what your current IP address.
Now, if the program cannot get the IP file from whatsmyip.com, it will timeout after an interval you can set.
The program will retry the file download as many times as you set it to.
I have it set to retry 3 times with a 30 second timeout for each try
It could be that your router is down or that web site is down, or your ISP is down.
I have not spent any time trying to narrow down why the connection timed out, but this could be improved.
If after so many retries, the program cannot fetch the IP file from whatsmyip.com, it will recycle the router power off and then on via and X10 command.
I just plugged my router into an appliance module and I have the program variable set to module h16, but you can change it to any valid x10 module number.
After the program turns the router power back on, it will wait a certain interval and then try to download the IP file again from whatismyip.com.
If the router was the problem, it should fetch the file.
If your ISP is down or the whatsmyip.com page is down, it will go back into the timeout loop stuff again.
I suppose the program could also check to see if google.com or some other pages were up and that would eliminate the whatsmyip.com page being down as the problem.
There is also a small browser window below the main status window that will display the status file on the server.
If you do not have X10, you can remove or bypass the code that references it.
It still is a handy program to just have your IP uploaded via FTP to a web server at an interval.
At the bottom of the code is where all the variables are set.
You will have to change things like FTP server addresses, FTP username, FTP password, timeouts, retries, X10 module names, etc.
Anyone that comes up with any really cool improvements, I hope will share those.
Here's a couple screen shots of the status file info and what the browser file looks like
Here's the link to the VB2008 express zipped up project file.
http://www.el34world.com/Misc/home/Files/CopyofIpaddress.zip