First I want to say that the credit for most of the work I did goes to the guy who wrote this:
I decided that I wanted to be able to open my garage door using my phone because at my apartment, my garage door works like 70% of the time. The buttons sometimes work and sometimes don’t, the signal box on the garage door itself has been replaced a couple times and every time they have to call a 3rd party to come out and fix it which takes forever. I’m basically sick of it so I figured I could use my spare raspberry pi to do the job with my phone.
This guide also has a web page that he wrote, but I ended up modifying it quite a bit and making it so that all I had to do was hit the page from a tasker command on my phone in order to open the garage door.
This solution works as intended but only if you are logged in to the local wifi at my apartment. The problem with that is the wifi doesn’t exactly reach when you are outside the garage door. If I am connected to the wifi on my phone, I am able to walk out of my garage and across the street and still close the garage door. But, if I arrive home and try to connect to the wifi from outside of the garage, my phone cant find the signal reliably.
What I need to do now is to either improve my signal past the outside of the garage somehow or I need to fire the script from over the internet (using the 4g signal on my phone) which would obviously require some sort of authentication to avoid a random person from connecting to my webpage and opening my garage door.
Any thoughts on this would be appreciated.
Here is the GitHub link
So I decided that the best thing for me to do is to setup a VPN connection to my home network on my phone which would allow me to hit the local web server and open the garage door. Don’t know why I didn’t think of this before. I have a powerful router running DDWRT firmware which made this extremely easy. I will post pictures to go with this to help others understand but it will take me some time to get around to it. I will also add the tasker apk to the github. To pull this off you need to:
setup a dynamic dns service. There are many ways to do this. I have a DDWRT router that allows me to log into my free noip account and have my dynamic ip address mapped to a hostname. It may seem complicated but its simple and there are good videos and guides all over that can help someone achieve this.
setup a vpn to the home network using your DDNS hostname. Again, DDWRT ftw. It allows me to run a PPTP server on my router. I create a username and STRONG password which I can use from my laptop or phone to log into my VPN from any network (including my cellular network as I drive up to my garage).
log into the vpn on phone. When I am connected to my vpn from my phone, I am basically on my local network even when I am on my cellular network. I run my tasker task and the garage opens without me having to connect to my wifi network.
The big reason for this change is that, even with the range extender, it takes me 30 seconds minimum to connect to the wifi network from outside my garage. The range extender I have is probably crap but it is what I had laying around and I’m not willing to go and spend money on a better one for this single purpose. Also, the range extender I have has WPS enabled and I can’t turn it off, which adds an attack vector to my network and that bothers me quite a lot.