pebble
play

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,


  1. Pebble INTRODUCTION AND HANDS-ON Introduction to the Pebble smartwatch. Installation of the SDK and base operations with Python.

  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

  3. Specs • Dimensions • Sensors – 52mm L, 36 mm W, – 3D accelerometer 11.5mm T – e-compass capable • Display (with a future software update) – 1.26’’, 144 x 168 pixel – ambient light sensor – LED backlight and • Battery lasts 5-7 days scratch resistant • Bluetooth 4.0 • Localized in English, only • Haptic feedback • Water resistant (5 ATM) 4/16/2014 Pebble 3

  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

  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

  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

  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

  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

  9. Interact with a Pebble via command line THE PEBBLE TOOL 4/16/2014 Pebble 9

  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

  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

  12. Send a ping and a textual notification to the Pebble NOTIFICATIONS 4/16/2014 Pebble 12

  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

  14. Control a music server with the Pebble Music app LET THE MUSIC PLAY 4/16/2014 Pebble 14

  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

  16. Results • Checkout all the examples on GitHub – http://github.com/AmI-2014/Python-Pebble 4/16/2014 Pebble 16

  17. Questions? 01PRD A MBIENT I NTELLIGENCE : T ECHNOLOGY AND D ESIGN Luigi De Russis luigi.derussis@polito.it

  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 or 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 one. To view a copy of this license, visit • http://creativecommons.org/license/by-nc-sa/3.0/ 4/16/2014 Pebble 18

Recommend


More recommend