BluetoothWorld hero image

Bring Your Own Laptop: Web Bluetooth developer training

Loading

Bring Your Own Laptop: Web Bluetooth developer training

19-Sep-2018
Developer Session Room 1

Web Bluetooth allows the development of web applications which can interact with Bluetooth low energy peripherals. This class will discuss Web Bluetooth, its status and APIs, and will provide hands-on development experience of a Web Bluetooth application.

In this session, you will learn:

  • How to get started with a Web Bluetooth application
  • Coding for a basic Web Bluetooth application 

  
Audience pre-requisites:
This session is best for developers at any level of experience. Familiarity with basic HTML and JavaScript may be advantageous, but is not essential.

Equipment requirements:

Hardware

A laptop running Windows or Linux or a Macbook. Whatever kind of laptop it is, it must include a properly configured Bluetooth adapter and software otherwise no matter how hard you try, your Web Bluetooth code will not work!

Software

Your laptop needs the following installed on it:

  • A local web server with support for SSL (self-signed certificate is OK)
  • A text editor·Google Chrome

 

Linux users need BlueZ and should be running a recent version. We tested on BlueZ 5.50. You will also need to enable experimental features in Chrome by going to this address in Chrome: chrome://flags/#enable-experimental-web-platform-features

These instructions will help you get your BlueZ installation up to the required version.

Windows users will either need to install a small software component known as a polyfill as a Chrome extension to give Chrome on Windows the level of Web Bluetooth support that we need OR they will need to use Chrome Canary. Chrome Canary can be downloaded from https://www.google.com/chrome/canary/

Test your browser using the device info Web Bluetooth sample (https://googlechrome.github.io/samples/web-bluetooth/device-info.html ) with any Bluetooth LE peripheral device. Make sure you select the All Devices checkbox.

You can use any web server but if you do not already have a favorite, local-web-server.js is recommended. It uses nodejs so you'll need to install it if you do not already have it and decide to use this web server.

Instructions follow:

node js
Get and install node js from here.
install and set up local-web-server (short version)
    mkdir web_projects
    npm install -g local-web-server
    cd web_projects
    ws --https --verbose

The directory web_projects is just an example name. Call it whatever you like. This is where you will edit your html, css, JS etc and launching ws from that directory will make them available from this URL.

Windows users - install the Web Bluetooth polyfill for ChromeFollow the instructions here to install the required polyfill.

Seating is limited; developer kits are provided on a first-come-first-served basis.

Please arrive 5-10 minutes prior to the start of the session to secure your seat.

Speakers
Martin Woolley, Developer Relations Manager, EMEA - Bluetooth SIG