0%

Book Description

This book is where your adventures with Bluetooth LE begin. You'll start your journey by getting familiar with your hardware options: Arduino, BLE modules, computers (including Raspberry Pi!), and mobile phones. From there, you'll write code and wire circuits to connect off-the-shelf sensors, and even go all the way to writing your own Bluetooth Services. Along the way you'll look at lightbulbs, locks, and Apple's iBeacon technology, as well as get an understanding of Bluetooth security--both how to beat other people's security, and how to make your hardware secure.

Table of Contents

  1. Preface
    1. What Makes Bluetooth LE Unique?
      1. But I Like Serial Connections!
    2. Building a Custom Service
    3. Who Should Read This Book?
    4. What You Should Already Know
    5. What You Will Learn
    6. What’s In This Book
    7. Conventions Used in This Book
    8. Using Code Examples
    9. Safari® Books Online
    10. How to Contact Us
    11. Acknowledgements by Alasdair Allan
    12. Acknowledgements by Don Coleman
    13. Acknowledgements by Sandeep Mistry
  2. 1. Introduction
    1. Talking About Bluetooth LE
    2. Protocols and Profiles
      1. The GAP
      2. The GATT
      3. Services and Characteristics
    3. UUIDs
      1. An Example Service
    4. Making Sure Your Machine Has Bluetooth LE
      1. OS X
      2. Apple iOS
      3. Linux
      4. Android
      5. Microsoft Windows
    5. What Haven’t We Told You About Bluetooth LE?
  3. 2. Getting Started
    1. The Arduino
      1. The Board
      2. Powering the Board
      3. Input and Output
      4. Communicating with the Board
    2. Installing the Arduino IDE
      1. Installing on OS X
      2. Installing on Linux
      3. Installing on MS Windows
    3. Connecting to the Board
    4. Installing the BLE Peripheral Library
    5. Setting Up Raspberry Pi
      1. Installing BlueZ
      2. Verifying the Bluetooth LE
    6. Node.js
    7. Installing Node.js
      1. On Linux and Raspberry Pi
    8. Installing Libraries with npm
    9. Setting Up Dependencies for noble and bleno
      1. OS X
      2. Raspberry Pi and Linux
    10. Installing PhoneGap
      1. PhoneGap Developer App
      2. Bluetooth Low Energy Plugin
      3. PhoneGap Versus Cordova
      4. Platform Tools
      5. Android
  4. 3. Smart Light Switch
    1. What Is a Smart Switch?
    2. Hardware
      1. The Breadboard
    3. Getting Started
      1. Resistor Color-Coding
      2. Blinking an LED
      3. Adding a Switch
      4. Software Debouncing
    4. Making a Real Light Switch
      1. By Changing the Hardware
      2. Changing the Software
    5. Adding Bluetooth
      1. Wiring Up the Adafruit Bluefruit LE Module
      2. Modifying Our Sketch
      3. Testing the Service
    6. Using Real Lightbulbs
    7. Conclusion
  5. 4. BLE Lock
    1. Lock Service
    2. Hardware
    3. Lock Software
      1. Programming
      2. Setup
      3. Loop
      4. Unlock Characteristic Written
      5. Open Lock
      6. Reset Lock
    4. Testing the Lock
      1. iOS
      2. Android
    5. Mobile Application
      1. Callbacks
      2. BLE Lock App
      3. CSS
      4. HTML
      5. JavaScript
      6. Run the App
    6. Improving the Lock
  6. 5. Bleno Lock
    1. Hardware
    2. Lock Software
      1. Libraries
      2. Programming
    3. Conclusion
  7. 6. Weather Station
    1. Hardware
    2. Libraries
    3. Programming
    4. Compile and Upload
    5. Serial Monitor
    6. Using the Service
      1. Using LightBlue on iOS
      2. Using nRF Master Control Panel on Android
    7. PhoneGap
      1. Create the Project
      2. HTML
      3. JavaScript
      4. Run the App
    8. What’s Next?
  8. 7. NeoPixel Lamp
    1. Hardware
      1. NeoPixels
      2. Building the Hardware
    2. Software
      1. LED Service
      2. Programming the Arduino
      3. Generic Bluetooth Client
    3. Building a Phone App
      1. Create the Project
      2. HTML
      3. CSS
      4. JavaScript
      5. Run the App
    4. Enhancements
      1. Physical Switch and Dimmer
      2. Lamp
  9. 8. SensorTag Remote
    1. Hardware
    2. Create the Project
    3. SensorTag and Noble
    4. SensorTag Remote
    5. A Simpler Version
    6. Next Steps
    7. Arduino Simple Key Service
  10. 9. HID over GATT
    1. HOGP and BLEPeripheral
    2. Volume Knob
      1. Hardware
      2. Arduino Library Setup
      3. Testing the Rotary Encoder
      4. Implementing the Volume Knob
    3. Conclusion
  11. 10. Beacons
    1. What You’ll Need
    2. iBeacon
      1. What Data Does an iBeacon Advertise?
      2. Building and Detecting a Beacon
      3. Creating a Mobile App that Uses iBeacons
    3. Eddystone Beacons and the Physical Web
      1. What Data Does an Eddystone Beacon Advertise?
      2. Building and Detecting Your Own Beacon
    4. Conclusion
  12. 11. Drones
    1. What You’ll Need
    2. Testing Out the Drone
    3. Controlling the Rolling Spider with Node.js
      1. Setting Up the Project
      2. Discovering the Drone
      3. Getting Started: Basic Takeoff and Landing
      4. Keyboard Control
    4. Conclusion
  13. 12. Going Further
    1. The Arduino
    2. Hardware Suggestions
    3. Further Reading
  14. A. HID Over GATT Pairing
    1. iOS
      1. Pairing
      2. Unpairing
    2. Android
      1. Pairing
      2. Unpairing
    3. OS X
      1. Pairing
      2. Unpairing
  15. Index
34.230.68.214