SlideShare a Scribd company logo
Getting Physical
with Web Bluetooth
in the browser
Dan Jenkins
@dan_jenkins
@dan_jenkins
Dan Jenkins
@dan_jenkins
nimblea.pe
dan@nimblea.pe
@nimbleapeltd
Google Dev Expert
@dan_jenkins
Wouldn't it be
cool to interact
with real life
using JavaScript
In the Browser?
@dan_jenkins
Imagine
walking up to
something...
@dan_jenkins
And being
able to use it.
With the Web.
@dan_jenkins
Drones, BB8,
Fitbits, Adult toys...
Bluetooth Low
Energy
@dan_jenkins
Let's take a
step back
@dan_jenkins
What is this magic?
@dan_jenkins
Physical Web
@dan_jenkins
Web Bluetooth
@dan_jenkins
Getting
Physical
Physical
@dan_jenkins
Ever wished you could "click"
on things in real life and find
out more about them?
@dan_jenkins
Been
somewhere
that had
these?
@dan_jenkins
They're
everywhere!
@dan_jenkins
But there are
many other
places where
we want to
interact with
something
around us
@dan_jenkins
The Physical Web
@dan_jenkins
@dan_jenkins
@dan_jenkins
How do I use this magic?
@dan_jenkins
Seeing
Physical Web
Notifications
@dan_jenkins
Android or
iOS
@dan_jenkins
Android iOS
• Location & Bluetooth turned on

• Android "Nearby" enabled (default)
https://android.googleblog.com/2016/06/introducing-nearby-new-way-to-discover.html
• Bluetooth turned on

• Chrome Notifications enabled 

(Allow the Chrome widget in
Notification Center)
https://docs.pushmote.com/docs/how-to-enable-chromes-physical-web-extension-on-the-ios
@dan_jenkins
Android caveat
They've just rolled back to Chrome doing the Physical
Web notifications in latest Chrome for Android
https://goo.gl/MrAXUw
https://goo.gl/PMwBY2
@dan_jenkins
Android caveat
But that'll only be for 6 or so weeks...
@dan_jenkins
@dan_jenkins
Transmitting
Physical
Web URLs
@dan_jenkins
Beacons
@dan_jenkins
Apps
@dan_jenkins
Anything that can emit using
Bluetooth Low Energy
@dan_jenkins
What makes up the Physical Web?
@dan_jenkins
Eddystone
•
Open Message Format
•
Eddystone URLs have 18 bytes worth of data that
can be broadcast
•
https://developers.google.com/beacons/eddystone
@dan_jenkins
Chrome•
Chrome on iOS and Nearby on Android scans for BLE beacons with
Eddystone URLs
•
Chrome only supports HTTPS URLs
•
Chrome then sends those URLs up to Google's Proxy service
(does some extra magic)
•
The Proxy service then sends those URLs back to Chrome
•
Chrome/Nearby shows a notification
All of this doesn't work unless you have data & location turned on
@dan_jenkins
@dan_jenkins
And they're being used
today
@dan_jenkinshttp://www.proxama.com/news/proxama-partners-with-google-to-deliver-worlds-first-physical-web-experience-for-consumers/
@dan_jenkinshttp://www.proxama.com/news/proxama-partners-with-google-to-deliver-worlds-first-physical-web-experience-for-consumers/
@dan_jenkins
And there are beacons
here today
@dan_jenkins
And you don't have to
use Chrome to get
them
https://www.phy.net/physical-web-browsers/
@dan_jenkins
That's great for
linking the
Physical World
to your Phone
@dan_jenkins
BUT,
There's more...
@dan_jenkins
Web
Bluetooth
@dan_jenkins
Your browser can
connect to
Bluetooth Low Energy
(BLE) devices directly
@dan_jenkins
Using JavaScript, we
can now connect to
physical devices using
BLE and control them
@dan_jenkins
@dan_jenkins
BLE (not just toys)
45
@dan_jenkins
BLE (not just toys)
46
@dan_jenkins
BLE (okay... a fair few toys)
47
@dan_jenkins
Stepping back, what is BLE?
•
Low Bandwidth
•
Bluetooth v4 - Bluetooth Low Energy (0.3 Mbps)
•
Bluetooth v3 (54 Mbps)
•
A set of Standard Services
•
But you can also build your own services
@dan_jenkins
BLE GATT Server
Gatt Server
Custom ServiceBattery Service
Battery Level
Characteristic
Custom
Characteristic #1
Custom
Characteristic #1
@dan_jenkins
Let's take a look at the
Web Bluetooth API
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', boop);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function boop(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
var options = { filters: [{ services: ['heart_rate'] }] };
navigator.bluetooth.requestDevice(options)
.then(device => device.gatt.connect())
.then(server => server.getPrimaryService('heart_rate'))
.then(service => service.getCharacteristic('heart_rate_measurement'))
.then(characteristic => {
characteristic.addEventListener('characteristicvaluechanged', beep);
return characteristic.startNotifications();
})
.catch(error => { console.log(error); });
function beep(event) { console.log(event.target.value); }
@dan_jenkins
But what if the device was
broadcasting a URL
where it can be controlled
from?
@dan_jenkins
@dan_jenkins
Today, there's no way to
bypass that device
selection
Which kinda sucks
@dan_jenkins
But that's changing soon too
var referringDevice = navigator.bluetooth.referringDevice;
if (referringDevice) {
referringDevice.gatt.connect()
.then(server => { ... })
.catch(error => { console.log(error); });
}
@dan_jenkins
But that's changing soon too
var referringDevice = navigator.bluetooth.referringDevice;
if (referringDevice) {
referringDevice.gatt.connect()
.then(server => { ... })
.catch(error => { console.log(error); });
}
@dan_jenkins
Where can I play with Web
Bluetooth today?
In short.... Chrome/Chromium on...
Android
M & N
ChromeOS Linux
Android L with Chromium
OSX
(Chrome 53)
Windows (a little)
@dan_jenkins
But for more info...
https://goo.gl/rDu2UT
@dan_jenkins
And you have to enable it...
chrome://flags
@dan_jenkins
But there is a Google
Chrome Origin Trial ongoing
https://goo.gl/hzczDR
@dan_jenkins
And the Chrome team has
announced their intent to ship in 56
https://goo.gl/KMmjda
@dan_jenkins
Oh and only on
Localhost & HTTPS...
There are quite a few hoops!
@dan_jenkins
Loads of demos out there
https://webbluetoothcg.github.io/demos/
@dan_jenkins
And you can make your own peripherals
BBC micro:bit
Arduino
Tessel
Raspberry Pi 3
@dan_jenkins
Developing for Web
Bluetooth has become
easier.
@dan_jenkins
Unless you're
developing on
Windows... but that's
changing too
@dan_jenkins
Hardware with BLE is
cheap
@dan_jenkins
Your dev environment
just needs to have BLE
(Bluetooth 4)
@dan_jenkins
One last
demo
@dan_jenkins
Build things
with the Web
@dan_jenkins
There are less
and less
reasons to build
native apps
@dan_jenkins
goo.gl/7uAtkY
3 great Google I/O videos
about the Physical Web
and Web Bluetooth
@dan_jenkins
Thanks!
@dan_jenkins

More Related Content

PDF
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
PDF
Getting physical with web bluetooth in the browser
PDF
Getting physical with web bluetooth in the browser
PDF
WebRTC 101 - How to get started building your first WebRTC application
PPTX
Beacons, Raspberry Pi & Node.js
PPTX
Eddystone Beacons - Physical Web - Giving a URL to All Objects
PDF
Divolte collector overview
PDF
Prototyping online ML with Divolte Collector
Getting Physical with Web Bluetooth in the Browser Full Stack Toronto
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browser
WebRTC 101 - How to get started building your first WebRTC application
Beacons, Raspberry Pi & Node.js
Eddystone Beacons - Physical Web - Giving a URL to All Objects
Divolte collector overview
Prototyping online ML with Divolte Collector

What's hot (20)

PDF
Divolte Collector - meetup presentation
PDF
async/await in Swift
PDF
JavaCro'15 - Remote controlling Parrot AR Drone with Spring Boot and Vaadin -...
PDF
Android dev toolbox - Shem Magnezi, WeWork
PDF
How To Electrocute Yourself using the Internet
PPT
Android wearpp
PPTX
Automated release management with team city & octopusdeploy - NDC 2013
KEY
A language for the Internet: Why JavaScript and Node.js is right for Internet...
PDF
Rethink Async With RXJS
KEY
Socket applications
PPT
Google compute presentation puppet conf
PDF
Measuring Real User Performance in the Browser
PDF
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
PPTX
Ultimate Node.js countdown: the coolest Application Express examples
PDF
Forensic Tools for In-Depth Performance Investigations
PDF
Extending spring
PDF
Effectively Producing And Shipping Frameworks For Multiple Platforms
PDF
Programming For Google Wave
PDF
I/O Extended 2019 WebTech - New capabilities for the web
Divolte Collector - meetup presentation
async/await in Swift
JavaCro'15 - Remote controlling Parrot AR Drone with Spring Boot and Vaadin -...
Android dev toolbox - Shem Magnezi, WeWork
How To Electrocute Yourself using the Internet
Android wearpp
Automated release management with team city & octopusdeploy - NDC 2013
A language for the Internet: Why JavaScript and Node.js is right for Internet...
Rethink Async With RXJS
Socket applications
Google compute presentation puppet conf
Measuring Real User Performance in the Browser
JavaScript APIs - The Web is the Platform - .toster conference, Moscow
Ultimate Node.js countdown: the coolest Application Express examples
Forensic Tools for In-Depth Performance Investigations
Extending spring
Effectively Producing And Shipping Frameworks For Multiple Platforms
Programming For Google Wave
I/O Extended 2019 WebTech - New capabilities for the web

Viewers also liked (20)

PDF
Asterisk, HTML5 and NodeJS; a world of endless possibilities
PDF
Predictability for the Web
PDF
Get to know Holiday Extras 2011
PDF
Presentation Hassle Free Anna
PDF
Holiday Extras
PDF
How to get started with Roadio in under 60 seconds
PDF
How to manage your payments
PPT
Hotleads:upsell
PDF
Break away old
PDF
Design+Startup 2013
PDF
Structuring Data from Unstructured Things. Sean Lorenz
PDF
Exploring Open Date with BigQuery: Jenny Tong
PDF
BreakAway
PDF
Social business online information 201112
KEY
Access to iDevices
PDF
Static Sites Can be the Solution (Simon Wood)
ODP
Polyglot polywhat polywhy
PPT
Online Presence
PDF
Scottish Communicators Network - 22 October 2014 - People Make Glasgow
Asterisk, HTML5 and NodeJS; a world of endless possibilities
Predictability for the Web
Get to know Holiday Extras 2011
Presentation Hassle Free Anna
Holiday Extras
How to get started with Roadio in under 60 seconds
How to manage your payments
Hotleads:upsell
Break away old
Design+Startup 2013
Structuring Data from Unstructured Things. Sean Lorenz
Exploring Open Date with BigQuery: Jenny Tong
BreakAway
Social business online information 201112
Access to iDevices
Static Sites Can be the Solution (Simon Wood)
Polyglot polywhat polywhy
Online Presence
Scottish Communicators Network - 22 October 2014 - People Make Glasgow

Similar to Getting physical with web bluetooth in the browser hackference (20)

PDF
Let's Get Physical
PDF
Cold front - bridging the web and the physical world
PDF
JAM805 - Beyond the Device
PDF
THAT_2023_BLE.pdf
PDF
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
PDF
Physical web inside and out final
PPTX
Can a browser become an IoT Gateway?
PPTX
Bluetooth low energy final version
PDF
A brief overview of BLE on Android
PDF
XebiCon'16 : The Physical Web : un coup d'oeil sur le futur d'IoT et de la mo...
PDF
Intern_Report
PDF
Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016
PPTX
Controlling Bluetooth Low Energy Devices
PPTX
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
PDF
Practical Core Bluetooth in IoT & Wearable projects @ AltConf 2016
PDF
Let's Get Physical
PDF
Exploring the physical web
PPT
Droidcon: Nick Hunn: Evolving past the fingertip- 29/10/2010
PDF
(Sacon) Sumanth Naropanth - IoT network & ecosystem security attacks & secur...
PDF
Web technology is getting physical, join the journey
Let's Get Physical
Cold front - bridging the web and the physical world
JAM805 - Beyond the Device
THAT_2023_BLE.pdf
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Physical web inside and out final
Can a browser become an IoT Gateway?
Bluetooth low energy final version
A brief overview of BLE on Android
XebiCon'16 : The Physical Web : un coup d'oeil sur le futur d'IoT et de la mo...
Intern_Report
Practical Core Bluetooth in IoT & Wearable projects @ UIKonf 2016
Controlling Bluetooth Low Energy Devices
SenchaCon 2016: A Look Ahead: Survey Next-Gen Modern Browser APIs - Shikhir S...
Practical Core Bluetooth in IoT & Wearable projects @ AltConf 2016
Let's Get Physical
Exploring the physical web
Droidcon: Nick Hunn: Evolving past the fingertip- 29/10/2010
(Sacon) Sumanth Naropanth - IoT network & ecosystem security attacks & secur...
Web technology is getting physical, join the journey

More from Dan Jenkins (20)

PPTX
Yup... WebRTC Still Sucks
PDF
Professional AV with WebRTC
PDF
SIMCON 3
PDF
Getting started with WebRTC
PDF
JanusCon - Building Native Mobile Apps with WebRTC
PDF
Astricon 2016 - Scaling ARI and Production
PDF
WebRTC Reborn SignalConf 2016
PDF
Building the Best Experience for Your Customers and Your Business
PDF
WebRTC Reborn - Full Stack Toronto
PDF
WebRTC Reborn - Cloud Expo / WebRTC Summit
PDF
WebRTC Reborn - Full Stack
PDF
Developing Yourself for Industry - University of Kent EDA MTD DA
PDF
Building 21st Century Contact Centre Applications
PDF
WebRTC Reborn Hackference
PDF
WebRTC Reborn Over The Air
PDF
WebRTC Reborn London Node User Group
PDF
Bringing choas to order in your node.js app
PDF
What is WebRTC? What can I do with it?
PDF
Getting the Best Out Of WebRTC - Astricon 2014
PDF
Future of Web Apps - Giving Customer Support using WebRTC
Yup... WebRTC Still Sucks
Professional AV with WebRTC
SIMCON 3
Getting started with WebRTC
JanusCon - Building Native Mobile Apps with WebRTC
Astricon 2016 - Scaling ARI and Production
WebRTC Reborn SignalConf 2016
Building the Best Experience for Your Customers and Your Business
WebRTC Reborn - Full Stack Toronto
WebRTC Reborn - Cloud Expo / WebRTC Summit
WebRTC Reborn - Full Stack
Developing Yourself for Industry - University of Kent EDA MTD DA
Building 21st Century Contact Centre Applications
WebRTC Reborn Hackference
WebRTC Reborn Over The Air
WebRTC Reborn London Node User Group
Bringing choas to order in your node.js app
What is WebRTC? What can I do with it?
Getting the Best Out Of WebRTC - Astricon 2014
Future of Web Apps - Giving Customer Support using WebRTC

Recently uploaded (20)

PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
KodekX | Application Modernization Development
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Bridging biosciences and deep learning for revolutionary discoveries: a compr...
Encapsulation_ Review paper, used for researhc scholars
Dropbox Q2 2025 Financial Results & Investor Presentation
CIFDAQ's Market Insight: SEC Turns Pro Crypto
20250228 LYD VKU AI Blended-Learning.pptx
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
Diabetes mellitus diagnosis method based random forest with bat algorithm
Digital-Transformation-Roadmap-for-Companies.pptx
KodekX | Application Modernization Development
Network Security Unit 5.pdf for BCA BBA.
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Understanding_Digital_Forensics_Presentation.pptx
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Mobile App Security Testing_ A Comprehensive Guide.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Bridging biosciences and deep learning for revolutionary discoveries: a compr...

Getting physical with web bluetooth in the browser hackference