Garage Door, meet Pebble Watch

2015-03-17 19.13.14

I love remote-controlling things.  Last week I made my Pebble Watch control our garage door.  Here’s how:

 

The Garage Door

To open and close the garage door I used a Raspberry Pi A+ computer connected to a 5 volt relay.  I found a great tutorial on Instructables.com and followed it to the letter.  It takes about an hour to set up.

Screenshot 2015-04-08 22.29.26

The tutorial leads you through configuring your Raspberry Pi as a web server on your local network.  The author provides his code for a hosted web page with a single button.  When you click on the button it tells the Raspberry Pi to briefly complete the relay circuit (like pushing your garage door’s button).

Voila!  You can control your garage door from a website in your house.  Now let’s get that control on your wrist ;-)

 

Adjusting the Website

Let’s take a closer look at the code in the instructable.  In the index.php file (the main page for the website) we can see the PHP code that fires the relay on button click:

 

The code is saying “when the ‘trigger’ (website button) is pushed, change the GPIO pin 7 (output pin on the Raspberry Pi that we have the relay plugged into) to on for 1,000,000 microseconds (1 second)”

Well this is great for controlling the door from a website, but how do we do it from our watch?

I started playing with the Pebble Watch SDK and found that with Pebble.js you can make AJAX calls super easily.  Huzzah!

Side-note: Pebble’s new web-based SDK CloudPebble is awesome.  You can write and deploy apps from within a browser and they install over the web to your smartphone, and then via bluetooth to your watch.  Welcome to 2015.

If we can make AJAX calls from our watch with Pebble.js, that means we can make a watch app that loads our Raspberry Pi’s website.  We’ll be in business if we create a special webpage on the Raspberry Pi that auto-opens the garage door when the page is loaded!

I copied the index.php page and renamed it to ‘auto.php’, then removed the IF statement in the PHP so the GPIO pin is set on page-load instead of button-click.

 

Now when you load the page, the garage opens.  Whoop!

 

Pebble Watch Control

I signed up with CloudPebble and turned Developer Mode ON in my Pebble App on my iPhone.  Then I wrote a very simple Pebble.js app that makes an AJAX GET request to the auto.php page when it’s opened.

 

Once you install the app on your Pebble, you should be able to open your garage door from your watch.  Boom!

 

‘Better’ Security 

I’m still pretty new to web development, but I know that having a page with this much physical world power, even if it’s only available on our local network, is not a good idea.  To make my system a teeny bit more secure, I added a URL Parameter password to the auto.php page:

 

Now, if a user visits our Raspberry Pi’s auto.php page, they’ll see “You’ve entered the wrong password”.  But if they add “?pw=ooglyboogly” to the end of the URL, the door will open!

Adjusting this on the Pebble App is as simple as changing the URL that the AJAX request uses.

Thanks for reading!

 

 

Summer Web Projects

My 2011 summer was superb. It involved a lot of outdoor adventures including hiking, mountain biking, paragliding, and exploring condemned buildings. More on that to come.

One of my work projects this summer was developing a website for an office complex in downtown Anchorage that just got a huge solar retrofit. The building now has 96 solar panels on its south wall that are rated at 180W each. The system has a potential output of 17.28 kW!

Along with building the website, I installed the monitoring hardware and software for the solar system. This keeps track of how much energy is being produced in real-time. A lot of the monitoring data is on the website, and it updates as often as every 10 minutes.

The website is nearly complete. The last thing being developed is a custom graphing system for the solar power data. The current graphs on the Solar Power Output page are provided by the software that comes with the monitoring hardware. Unfortunately these are not very appealing visually, and they aren’t as flexible as I’d like. The new graphs will be gorgeous.

Take a look at www.AnchorageSolarBuilding.com!

     

Goal0 Solar Panel and Battery

A few weeks ago I picked up a Goal0 solar panel and battery pack for the 970to907 road trip.

The solar panel is flexible and encased in fabric, so it’s very durable. The output is 13.5Watts. The battery is also very durable and has 50 Watt-hours of capacity. As a reference point, the iPad 2 battery is 25Watt-Hour, and the iPad will run for 10 hours on that. So this battery pack could hypothetically power the iPad for 20 hours from a full charge; that 20 hours doesn’t factor in more charge coming from the solar panel.

The Goal0 team has been extremely helpful in getting me a great setup for the road trip. This panel and battery will also be practical for charging my MacBook Pro on the go or at home.

Fast, now on the App Store!

 

Fast, my speedometer app for iPhone, has been approved and is now in the App Store!

Fast has a beautiful interface. There is both a digital readout and a classic speedometer gauge. Along with being a great speedometer, Fast will also keep track of your top speed. You can put your iPhone in your pocket while skiing, snowboarding, biking or anything – and check how fast you’ve gone once you are done.

I was skiing with my father and some friends today. We used the Top Speed feature to track ourselves. I was able to clock 44MPH. My dad’s friend hit 56MPH. (I’m just getting back on skis after snowboarding for 11 years).

Want a free download of Fast? Just let me know and I’ll get you a promotional code. All you have to do is leave a review once you’ve tried the app!

 

A Big PhotoRotate Update

I’ve had great results with PhotoRotate so far. There have been over 8,000 downloads of the free version, and all of the reviews have been extremely positive!

Until just recently, the paid and free versions of PhotoRotate were not very different. The free version had ads, and the paid version did not. I wanted to add something that would give our paying users more of an experience, and simply show all of our users that we’re continuing to support the apps.

Now, the space in the free version that is occupied by ads, has become a functions toolbar in the paid version. Users can select between rotating, adjusting the brightness, and adjusting the contrast of their images. Triple the feature set!

Along with the added functions in the paid version, both the paid and free versions now have a Save menu. This menu lets users Email their edited image, Copy it to the Clipboard for sending in Text messages, or simply save it to their Photo Library.

This update has been a big project. Now, we’re settling back in to focus on The Helicopter.

The Helicopter!

We have a new app in the mix. This one is a game, and it’s called The Helicopter.

The Helicopter has a great story behind it and a bunch of neat features that I think will make it one of the best games in the App Store. I can’t say TOO much about gameplay yet, but we just got the official app website set up at TheHelicopterApp.com. You can also check our updates on Twitter at @helicopterapp.

As we progress in development the website will be host to game screenshots, explaining our progress, discussions about features, recruiting beta testers, and more. If you’re interested, make sure to follow the twitter feed or the RSS from the website.

I’m working very hard on The Helicopter, as are my teammates Ben and Connor. We’re dedicated to making a kickass game for the iPhone and iPod touch.

New Projects

I’m really not good at keeping this blog updated with progress. It’s just not something in my daily routine. I think an update is due, though.

Recently I’ve started working on two big projects. The first is Green iPhone, an iPhone recycling company. It spurred out of my casual iPhone sales on Craigslist and it has developed into a working business model. Green iPhone has an iPhone Buy-Back program that buys used/broken iPhones from individuals and companies. On the flip side, we have a sales portal on the Green iPhone website where we sell professionally refurbished iPhones.

Green iPhone is just starting, and it has been a magnificent experience so far. Our full website will launch on November 1st 2010. You’ll be able to find it here. Here’s our logo:

The second project to mention is iPhone App development. My first applications, PhotoRotate and PhotoRotate Free were approved by Apple and put into the App Store this Monday. PhotoRotate is simple app, and the title should make it self explanatory. Unfortunately the iPhone’s operating system, iOS, does not have a photo rotating function built in. With all of the pictures that I take for eBay (I take them at interesting angles sometimes), I end up with incorrectly oriented images a LOT. I wanted a solution, and none of the rotating Apps in the store looked good enough for me.

PhotoRotate seemed like a great App to do some ice-breaking with. And it was! I got a great development team together, and we put together a really polished and intuitive photo rotator. I’m happy to say that the apps are in the store, and they are doing quite well. – My support page for PhotoRotate is actually on this site, here.

Now we’re moving on to much more complex Apps. There is a full-featured game in the works, and I think it’s going to be phenomenal. I will post an update when it’s complete.

That’s it for now!

More Solar MacBook Pondering

In my last post I discussed the feasibility of a 34Watt solar panel for charging portable electronics. One of the main points that I made was the charge times: With a custom 34W panel, you’re looking at about 2.5 hours to fully charge a MacBook Pro battery.

I started talking about these numbers with my roommate today. I mentioned that the MBP battery lasts a good 5 to 6 hours on casual use. This means that with a 34W panel, you could successfully USE AND CHARGE (simultaneously) a MacBookPro with that solar panel. If you dropped the panel in size to a 17Watt, you would be looking at a 5hour time for full charge. – But that means that you could use the laptop while charging, and essentially counteract the battery’s ‘uncharging’!

A 17W panel could be made small. Maybe as small as my MacBook Pro’s lid. Exciting…