I developed an app for the Pebble Smart Watch that allows me to remote start my truck from my watch.
With all the discussion about smart watches going around, and what you may be able to do with an Apple Watch, I decided it was time to move from idea to reality. This app isn’t just screen mock ups or screen shots from a simulator, it’s actual code that works and it’s on my wrist right now. . Let’s get into the how it works/what I had to do.
Truck Equipment
Let’s start with the basics here. I installed a remote start alarm with keyless entry module into my truck. This let’s me start my truck from a few hundred feet away with a remote. Then I added an upgrade box to the remote start system that contains a cellular modem and companion app. Essentially the App communicates with a server on the internet that sends commands to the cell modem that now resides in my truck. This all allows me to remote start my truck from my iPhone.
Reverse Engineering
Knowing that my phone was interfacing with my remote start system over the internet the next step was to learn how. Using the Charles Web Debugging Proxy I was able to record my phones interactions with the server and reverse engineer the REST API it uses. From there it was a simple matter of figuring out the authentication used and defining the REST calls I would have to make to the server.
Programming the Pebble
Pebble native apps are programmable in C. Old school, tried and true, used in embedded systems C. Pebble also offers Pebble.js which allows you to make full apps in JavaScript that runs on top of things. Being an Objective C guy I went the C route. This is where things get a bit tricky though, in order to access the internet you still need to use JavaScript via PebbleKit JS. You do this using an object called AppMessage that sends key value pairs back and forth between C and JS code.
Basically I defined values 0-3 for each of the commands I wanted Lock, Unlock, Car Finder (honks the horn 5 times) and remote start. Whenever I selected a value on the UI it would send that code to the JavaScript which would then transmit the appropriate command to the Remote Start server on the web.
What’s Next
I’m working on cleaning up the UI a bit. ). I’m going to post a video on the app in action, I just have to wait for a day when it’s not snowing and Ill post a link to it.
I’ll also admit I’m keen to finish up my code to make it work on an Apple Watch (look for a separate post on that). At some point I want to add an Arduino unit to my truck along with a 3G connection for it. Ideally I want to be able to do things like open all my windows and moon roof in the summer.
A Note On Apple Watch
I’ll admit I’m still fascinated by the Apple Watch and I’ll probably buy one. I already have code working that will allow me to remote start my truck from my iPhone. I just have to finish the requisite iOS extension and lay out the User Interface and I’ll have a functional Apple Watch app. This is certainly a great example of a first generation Apple Watch app. As mentioned before the apple watch could make a great controller for other connected devices / “The Internet of Things” (I hate that term…).
A Key Fob-ish remotes start app is a quick use case associated with an action that you may not want to take your phone out of your pocket for. It’s a connected action but not a data or interface heavy one. You push a button, a REST call gets made, something happens in the real world.
Summary
In conclusion I can remote start my truck from anywhere where my phone and my truck have an Internet connection.