Van Router – Auto Connect to Home Network

1413825786_thumb.jpegSo I’ve been wrestling with a way to have the van router automagically connect to the home wifi network when ever its turned in at home.

Obviously I could simply setup the router as both a client to connect to the home network and access point to enable devices to connect to the van router. This works fine whilst I’m at home. The minute the router cant find the home network (For example when traveling) and it simply kills wifi from ever starting up meaning devices cant connect to router.

After searching the web, I’ve managed to find a very clever solution that i dont understand why I didnt think of myself. So elegant and yet so simple.  Now I didn’t come up with the script.  I simply plagerised it from here

On startup… Have the router try and download the google.com page, if of course this works it means we’re at home and the home network is obviously avaiable. Therefor leave it enabled.

If we try the download and it fails – Obviously the home network is not available and as such it should be disabled. Its this disabling of the home network settings that then enables the router to continue start up wifi.

so heres what we do:

1st we create our wifi-check.sh file

vi /usr/bin/wifi-check.sh

in this file we paste the following

#wifi-check.sh
#!/bin/sh

# test both networks.

logger “Enabling home wifi network for uplink test”

uci set wireless.@wifi-iface[1].disabled=0;
uci commit wireless;
wifi

# wait some time and test
sleep 15
rm index.html
logger “Testing uplink state….”
if wget http://google.com; then

logger “You have uplink, Leaving network alone.”

# disable uplink wifi and restart if no connection is available
else

uci set wireless.@wifi-iface[1].disabled=1;
logger “No uplink available, Disabled home network
uci commit wireless;
wifi
fi

save this file.

now we change the file permissions.. being i’m lazy i did it this way as the router doesn’t need to be super secure. I mean come on I use it for camping.. lol

chmod 777 /usr/bin/wifi-check.sh

next we edit rc.local to enable the script to run on bootup

vi /etc/rc.local

add the following line before the exit 0 statement

wifi-check.sh &

Save the file and reboot.

You should have access to your home network. Now turn off the home wifi router and reboot your van router. You should find that after an extra 15 seconds than normal, you will have wifi available.

This is super awesome as it means we now have way to automate backup of home files to the van router when it becomes available at home. On successful uplink test we could theoretically then start an rbackup of say a movie folder. The skys the limit.

 

Actually I’ve just had a thought.  If we start the connection at home, and then drive away do things mess up.  Rather than rebooting – What if the wps button could toggle the home wifi network on and off, that might be even easier…

I’ll do some fudging around and see what I come up with….. Stay tuned

How to automatically download TV Shows using bit torrent

This ones a pretty quick post just to go over the basics.

Steps involved:

1. Install uTorrent

You can download utorrent from www.utorrent.com

Simply download and install like any other app.  Be careful not to install the bloatware that comes with it (There’s tick boxes during the install.

2. Configure RSS Feeds for TV Shows

There are a few feeds you can add.  The two main ones are:

To add these to utorrent – Right click on feeds on the left hand side and in the box displayed paste in one of the above links and press ok.  You can repeat this step a number of times to add both or more if you find them.

3. Right click on feeds on the left and select update feed.

4. Once the list of shows currently in the list populates, right click on a favorite and select add to favorites.  This will then present another dialogue box where you can fine tune some settings.  Typically changing the show name to remove the release group is a good idea and replacing spaces with question marks works as well as an asterisk at the end of the show name.  for example NCIS LA S01E01 would change to NCIS?LA*

After about a week of monitoring the feed you will have a list of favorites and your tv shows will become a set and forget type of affair.

As always, any questions, feel free to ask.

Cheers