Tuesday, September 22, 2015

Pebble watch programming.

Time for a new watch. I chose the Pebble classic because I like the idea of a daylight-readable (e-paper) display and multi-day battery life between charges. The fact that several were available on ebay at good prices didn't hurt either.
Yes, I do love the display. It's a crisp and clear monochrome, easily readable in sunlight. In the photo, you may notice a bit of "rainbow" effect to the left of the time and date. That seems to be a polarization effect: it's noticeable when wearing polarized sunglasses or with indirect illumination from a clear sky. In direct sunlight or artificial light the rainbows go away.


The watch has an ARM chip in it, so of course I have to develop my own watch face. Pebble has an online development platform, but I decided to install the SDK on my Debian PC. I got the SDK from developer.getpebble.com/sdk/ and installed it per the instructions, which includes installing several libraries and python packages. A couple of notes:
  • The "pip install -r requirements.txt" command takes a long time to run -- several minutes.
  • I did not install the Pebble-supplied ARM compiler: it requires a later version of glibc than I have installed. I already had a compiler installed (blog.sensicomm.com/2014/02/stm32-on-linux-again.html), and it seems to work fine.
  • To tell the SDK where the existing compiler is:
    • cd $HOME/pebble-dev/PebbleSDK-3.3/
    • ln -s  /opt/gcc-arm-none-eabi arm-cs-tools
And it works. I was able to compile a sample program using the "pebble build" command and install it using Bluetooth and an Android phone.