Make a directory inside your “tessel-code” folder called “ble”, change directory into that folder, and initialize a tessel project:
mkdir ble; cd ble; t2 init
Plug Tessel into your computer via USB, then plug the BLE module into either of Tessel’s USB ports.
noble by typing
npm install noble --force into the command line (the
--force flag is in case you are on OSX. The library is compatible with Linux (which Tessel uses) but not OSX, so npm blocks downloads to incompatible systems).
Rename “index.js” to “ble.js” and replace the file’s contents with the following:
Save the file.
In your command line,
t2 run ble.js
Be sure your BLE peripheral(s) are enabled! You should see Tessel output the address of any nearby BLE peripherals.
Bonus: Make your BLE dongle advertise as a peripheral. Hint: you will need the
bleno library instead of