?

Log in

No account? Create an account
Android Garage Door Opener, part 2 - brad's life [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Android Garage Door Opener, part 2 [Oct. 26th, 2008|12:06 pm]
Brad Fitzpatrick
[Tags|, , , ]

This is a follow-up to my previous post to say:

SO. FUCKING. AWESOME.

I got it all working. I now have an Android Activity (GarageDoorActivity) which interacts with an Android Service I wrote (InRangeService), letting me start and stop the service's wifi scanning task. The service gets the system WifiManager, holds a WifiLock to keep the radio active, and then does a Wifi scan every couple seconds, looking for my house.

When my house is in range, it does the magic HTTP request to my garage door opener's webserver (HMAC-signed timestamped URL, for non-replayability/forgeability if sniffed) and my garage door opens. Complete with a bunch of fun Toast notifications (like Growl) and Android Notifications (both persistent ongoing notifications for background scanning, and one-time notifications for things like the garage door actually opening).

I just threw on some shoes and hopped on my motorcycle to do a test lap around the neighborhood. When I got to the corner, I pulled up the activity and press "Start" (aka "Going home now"). A lady on the corner saw me playing with my phone on my motorcycle and said, "The reception's not so good up here." I thanked her, not wanting to explain what I was actually doing.

I then finished the lap around the block and the garage door started opening a few houses away. By the time I pulled up, I could already back the bike into the garage. HELL YES.

Update 2008-11-16: The source code is now available.
LinkReply

Comments:
[User Picture]From: mart
2008-10-26 08:03 pm (UTC)

Re: ours isn't nearly as fancy

I got a look much like that when I was staying at Brad's. I left the house in the morning through the garage and crossed over to the other side of the street where reception is better for some reason, then looked back at the house and fumbled with my phone a bit to close the door. A guy who was waiting by a car on the sidewalk looked like he was about to ask about it but then he got into his car and drove away.

The weird thing is that it seems that phone-controlled doors aren't that unusual. The apartment block I'm in right now has a phone-accessible door control that I can in theory call and press 9 to open the door, though they use caller-id as the access control and I've not told them my number so I've not tried it out. I think the intended way to use it is for the door to call you and you to let other people in, but according to the instructions it works both ways.

(Reply) (Parent) (Thread)
[User Picture]From: sajith
2008-10-27 07:22 am (UTC)

Re: ours isn't nearly as fancy

Caller ID can be spoofed trivially... all you need is Asterisk and a SIP (PRI also perhaps?) provider that allows/ignores that sort of thing. AFAIK there is legislation against this in the US, and only in the US. Ah, the possibilities!
(Reply) (Parent) (Thread)