Pebble INTRODUCTION AND HANDS-ON Introduction to the Pebble - - PowerPoint PPT Presentation

pebble
SMART_READER_LITE
LIVE PREVIEW

Pebble INTRODUCTION AND HANDS-ON Introduction to the Pebble - - PowerPoint PPT Presentation

Pebble INTRODUCTION AND HANDS-ON Introduction to the Pebble smartwatch. Installation of the SDK and base operations with Python. Im the Pebble A smartwatch http://getpebble.com Project funded on Kickstarter, initially on May,


slide-1
SLIDE 1

Pebble

INTRODUCTION AND HANDS-ON

Introduction to the Pebble smartwatch. Installation of the SDK and base operations with Python.

slide-2
SLIDE 2

I’m the Pebble

  • A smartwatch

– http://getpebble.com

  • Project funded on Kickstarter, initially

– on May, 2012

  • Thought as an extension of your smartphone

– works with iOS and Android – uses Bluetooth for communication

  • “Open” platform for developers

– SDK – Pebble appstore

4/16/2014 Pebble 2

slide-3
SLIDE 3

Specs

  • Dimensions

– 52mm L, 36 mm W, 11.5mm T

  • Display

– 1.26’’, 144 x 168 pixel – LED backlight and scratch resistant

  • Bluetooth 4.0
  • Haptic feedback
  • Sensors

– 3D accelerometer – e-compass capable (with a future software update) – ambient light sensor

  • Battery lasts 5-7 days
  • Localized in English,
  • nly
  • Water resistant (5

ATM)

4/16/2014 Pebble 3

slide-4
SLIDE 4

For developers…

  • An SDK is freely available

– registration is required – version 2.x (2.0.2, currently) – for Linux and Mac, only

  • Pebble apps can be written in C
  • Library available for Android and iOS

– optionally, for interacting via JavaScript

  • Documentation

– http://developer.pebble.com/2/

4/16/2014 Pebble 4

slide-5
SLIDE 5

What about Python?

  • The Pebble SDK comes with a pebble command line

tool

– interacts with a Pebble from a computer – written in Python

  • sources are available in the SDK
  • It is possible, therefore, to connect a computer with

a Pebble via Bluetooth

– works with Linux (Debian and derivatives) and Mac OS X

  • Notice that, in general, only one device at time can

be connected to a Pebble

4/16/2014 Pebble 5

slide-6
SLIDE 6

Python meets Pebble

  • No Windows
  • Download and install the Pebble SDK

– for Linux: https://developer.getpebble.com/2/getting- started/linux – for Mac OS X: https://developer.getpebble.com/2/getting- started/macosx

  • Add the folder “PebbleSDK-

2.0.2/tools/pebble” to the PYTHONPATH

– e.g., by creating a symbolic link named pebblelibs in /usr/lib/python2.7/, by configuring it in Eclipse, or…

4/16/2014 Pebble 6

slide-7
SLIDE 7

Python meets Pebble

  • Install the following additional components (via

pip install)

– freetype-py==1.0 – twisted==12.0.0 – autobahn==0.5.14 – websocket-client == 0.12.0 – sh == 1.08 – pyserial>=2.6 – pypng == 0.0.16

4/16/2014 Pebble 7

slide-8
SLIDE 8

Lightblue

  • We need the Lightblue library for Bluetooth
  • Ubuntu

– install libopenobex1-dev and python-bluez via apt-get

  • Mac OS X

– install PyObjC via pip install

  • Finally, install Lightblue 0.4 via pip install

– pip install git+http://github.com/pebble/lightblue- 0.4#egg=lightblue-0.4

  • In alternative, it should be possible to map the

Bluetooth to a serial port

4/16/2014 Pebble 8

slide-9
SLIDE 9

THE PEBBLE TOOL

Interact with a Pebble via command line

4/16/2014 Pebble 9

slide-10
SLIDE 10

Goals

  • Ping the Pebble watch
  • Take a screenshot of what the Pebble displays
  • Use the pebble command line, only
  • Communicate via Bluetooth

4/16/2014 Pebble 10

slide-11
SLIDE 11

The pebble tool

  • Allows the creation of new projects, build them,

install apps, remove apps, take screenshot, etc.

  • Configuration and available commands

– https://developer.getpebble.com/2/getting- started/pebble-tool

  • Examples:

– pebble ping --pebble_id BT_MAC_Address – pebble screenshot --pebble_id BT_MAC_Address

4/16/2014 Pebble 11

slide-12
SLIDE 12

NOTIFICATIONS

Send a ping and a textual notification to the Pebble

4/16/2014 Pebble 12

slide-13
SLIDE 13

Goals

  • Ping the Pebble watch
  • Send a custom notification to the Pebble
  • Use Python code, only
  • Communicate via Bluetooth

4/16/2014 Pebble 13

slide-14
SLIDE 14

LET THE MUSIC PLAY

Control a music server with the Pebble Music app

4/16/2014 Pebble 14

slide-15
SLIDE 15

Goals

  • Play or stop music from a playlist
  • Execute the next track in the playlist
  • Use the RESTful music server developed few

weeks ago

  • Communicate via Bluetooth

4/16/2014 Pebble 15

slide-16
SLIDE 16

Results

  • Checkout all the examples on GitHub

– http://github.com/AmI-2014/Python-Pebble

4/16/2014 Pebble 16

slide-17
SLIDE 17

Questions?

01PRD AMBIENT INTELLIGENCE: TECHNOLOGY AND DESIGN

Luigi De Russis luigi.derussis@polito.it

slide-18
SLIDE 18

License

  • This work is licensed under the Creative Commons “Attribution-

NonCommercial-ShareAlike Unported (CC BY-NC-SA 3,0)” License.

  • You are free:

– to Share - to copy, distribute and transmit the work – to Remix - to adapt the work

  • Under the following conditions:

– Attribution - You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you

  • r your use of the work).

– Noncommercial - You may not use this work for commercial purposes. – Share Alike - If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this

  • ne.
  • To view a copy of this license, visit

http://creativecommons.org/license/by-nc-sa/3.0/

4/16/2014 Pebble 18