Raspberry Pi Garage Door Opener (updated)

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.

I bought the relay from the guide and wired it up the way it is explained and it works out fine. (yes its held in place by cardboard and zipties :wink: )

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

Edit 2:

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:

  1. 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.

  2. 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).

  3. 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.

I’d go with a wireless signal repeater in the garage, with a mac filter on both the devices.

I do have a repeater near the front of my apartment but it kinda sucks. I might move it into the garage and plug it in right next to the pi to see if that helps. Ill have to run to frys and get a little surge protector.

As for mac filtering. it seems kinda obvious now that you say it lol.

Ill test the repeater with an extension cord or something to see if its viable.

I’d put the repeater right next to the door !

Thx for the idea, I might do that too

it was SUPER easy. Just that living in an apartment limits my ability to have a strong wifi signal outside the garage door. I pick up like 40 other signals.

I’ve always been torn between the idea of creating home automation this way, or the easy way with ready to go products such as insteon and the likes. It seems tempting to go the easy way but in the end once you have the raspberry pi, you can add as many relays as you want for a fraction of the price of new hubs or switches from ready to go brands.

If I had to go out and buy everything from scratch, I would probably use an Arduino. I just happened to have a raspberry pi lying around not doing anything. For other home automation tasks, you could easily scale up by buying more Arduinos for your simple tasks and have to communicate to the raspberry pi server on your network. would be much cheaper and way more fun than those all-in-one solutions

1 Like

Have you seen openhab? This interface would allow you to connect that raspberry pi to any windows or mac os device

I haven’t but I’m looking into now. It seems like the necessary software to pull off what I was describing lol. Really cool stuff!

Now I need more projects. I have a big upright fan that could use an Arduino makeover :slight_smile:

Back on the garage door project, It seems like If I plug my crappy range extender into the ceiling where my garage door is, I should be able to get a reliable enough signal to connect to with my phone. I’m going to frys to buy a small surge protector and ill probably pick up an Arduino to play around with.

When this is all done I’m going to put the code into a GitHub project so others can look at it.

Wow you’re lucky you can get adruinos at the store! All I can have is simple or double relays 5v to 12, 24 or 120v because of my work. We don’t have good electronic stores around.

1 Like