Skip to content

Instantly share code, notes, and snippets.

@savelee
Last active January 2, 2016 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save savelee/3098563c5566fdf8e320 to your computer and use it in GitHub Desktop.
Save savelee/3098563c5566fdf8e320 to your computer and use it in GitHub Desktop.
Connect BB-8 by Sphero with JavaScript on a Mac
First create a folder in your htdocs, then run the following commands:
$ sudo npm install sphero
$ sudo npm install noble
$ cd node_modules/noble
$ npm install
$ sudo npm install xpc-connection
To connect to your BB-8, you first need to determine UUID. Once you have Noble installed,
you can use the advertisement-discovery.js program to determine the device UUID, by scanning
all your bluetooth devices. Hold BB-8 next to your computer and run:
$ node examples/advertisement-discovery.js
This outputs information similar to:
peripheral discovered (68da9181e0c444b28a4a8bb854ea219f with address <unknown, unknown>,
connectable true, RSSI -41:
hello my local name is:
BB-7F1E
can I interest you in any of the following advertised services:
[]
here is my manufacturer data:
"3330"
my TX power level is:
6
In the above output, my device UUID is 68da9181e0c444b28a4a8bb854ea219f.
Use this value to connect to your BB-8.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment