Pebble Development

Notes by Dan Wilcox (@danomatika) for IACD 2015

The Pebble Watch

Kickstarted in 2012, the Pebble Smartwatch is one of the first commercially successful smart watches. It pairs with a smart phone using Bluetooth and features a 144×168 E-Paper display, 5–7 day battery life, vibration motor, 3-axis accelerometer, magnetometer, and ambient light sensor. It runs the FreeRTOS (Real Time Operating System), a simple operating system for embedded devices. It can be programmed using C or Javascript, using the Pebble SDK, through the CloudPebble online IDE.

Website: https://getpebble.com

Developer Links (seriously, everything is here, read them):

CloudPebble

cloudpebble-c-project

http://cloudpebble.net

CloudPebble is an online app IDE (Integrated Development Environment) for the Pebble Smartwatch. Using CloudPebble, you create projects, write code, and compile your app online. Running the app compiles and sends it from the CloudPebble website to your Pebble through the Pebble Smartwatch iOS/Android app running on your phone. Kind of convoluted but it works as long as both your phone and computer are online and the watch and phone are paired.

To reiterate: You write the code for your Pebble watch in a web browser, using the (online) CloudPebble IDE. The compilation of your code is done in the cloud; a binary is created on a Linux server somewhere. That binary is loaded onto the Pebble watch through a special App on your phone. Your phone must be connected to the Internet (to fetch the binary) as well as paired (via bluetooth) with the Pebble Watch.

CloudPebble -> *internet* -> Mobile Phone -> *bluetooth* -> Pebble Smartwatch

Note: In order for this to work, your phone must have an internet connection, the Pebble Smartwatch iOS/Android app should be running, and the watch must be paired to your phone.

Setting up CloudPebble with your watch:

  1. Sign up for a Pebble account on CloudPebble
  2. Install the Pebble Smartwatch App on your iOS or Android smartphone, and log in
  3. Follow the instructions to pair the watch and the phone; make sure to enable notifications
  4. Go ahead and update the watch to the latest OS version
  5. Enable Developer Mode in your phone’s app settings, then enable the Developer Connection from the main screen

Pebble Development Using CloudPebble

You can create two types of programs using the Pebble SDK:

  • WatchApp: a regular app started from the main menu
  • WatchFace: a custom watch face

Pebble apps can be developed using C or Pebble.js (Javascript), while faces can be developed only in C. Given the large number of C examples, it may be easier to develop in C than in JavaScript.

SDK documentation (your dear friend):

Using CloudPebble

Log in to CloudPebble and create a new project, either C or Pebble.js. Currently, there are a large number of C project templates, while there is only one template for Pebble.js. Chose one and open your project, then select a source file from the left menu bar. There should now be a Run button in the upper right of the text editor. Hit that to compile the app and run it on the watch. If everything is set up correctly, your app will be installed to the watch and started.

If you are using images and other resource files, they can be added using the menu item on the left panel.

Note: You can only have up to 8 apps loaded on a Pebble at a time. Apps can be swapped on and off the watch using the Pebble Smartwatch iOS/Android app.

Other Ideas

If-This-Then-That notifications on Pebble: http://forums.getpebble.com/discussion/4764/notifications-to-pebble-via-ifttt-if-this-then-that