-
Notifications
You must be signed in to change notification settings - Fork 156
Getting Started With Bluetooth LE SensorTag on Linux
Günter Obiltschnig edited this page Oct 28, 2018
·
7 revisions
This page describes how to get started with Bluetooth LE and the TI SensorTag on a Linux device (including a Raspberry Pi).
Bluetooth support in macchina.io requires the bluepy-helper executable that's part of the bluepy project.
$ sudo apt-get update
$ sudo apt-get install libssl-dev
$ sudo apt-get install bluetooth
$ sudo apt-get install build-essential libglib2.0-dev libdbus-1-dev
$ git clone https://github.com/macchina-io/macchina.io.git
$ cd macchina.io
$ make -s -j2 DEFAULT_TARGET=shared_release
$ cd ..
$ git clone https://github.com/macchina-io/bluepy.git
$ cd bluepy/bluepy
$ make
$ sudo cp bluepy-helper /usr/local/bin/
$ sudo hciconfig hci0 up
$ sudo hcitool lescan
LE Scan ...
C4:BE:84:72:C5:06 (unknown)
C4:BE:84:72:C5:06 CC2650 SensorTag
^C
Edit macchina.io/server/macchina.properties and add the following lines:
#
# Bluetooth LE/SensorTag
#
btle.bluez.helper = /usr/local/bin/bluepy-helper
sensortag.sensors.1.address = C4:BE:84:72:C5:06
The SensorTag address must match the address discovered with sudo hcitool lescan.
$ export MACCHINA_BASE=/path/to/macchina.io
$ export LD_LIBRARY_PATH=$MACCHINA_BASE/platform/lib/Linux/armv7l:$LD_LIBRARY_PATH
$ cd macchina.io/server
$ bin/Linux/armv7l/macchina
Note: in the export LD_LIBRARY_PATH
command, replace armv7l
with the proper hardware architecture
of your system (e.g., x86_64
).
The sensors from the SensorTag should now be visible in the Sensors & Devices app in the web user interface.