Bluetooth™ Low Energy and RasPi

BLE USB Stick with Raspberry Pi

Step1: The basic installation of Bluetooth stack on the Raspian OS

sudo apt-get install libusb-dev libdbus-1-dev libglib2.0-dev libudev-dev libical-dev libreadline-dev libbluetooth-dev

sudo wget www.kernel.org/pub/linux/bluetooth/bluez-5.15.tar.xz

sudo unxz bluez-5.15.tar.xz

sudo tar xvf bluez-5.15.tar

cd bluez-5.15

sudo ./configure –disable-systemd

sudo make

sudo make install

Step2: Power up your BLE USB Stick

hciconfig hci0 up 

Step3: Receive first sensor data, e.g. using TI’s SensorTag

pi@raspberrypi ~/node-red $ sudo hcitool lescan

LE Scan …

BC:6A:29:C3:90:9B (unknown)

BC:6A:29:C3:90:9B SensorTag

pi@raspberrypi ~/node-red $ sudo hcitool lecc BC:6A:29:C3:90:9B

Connection handle 64

pi@raspberrypi ~/node-red $ gatttool -b BC:6A:29:C3:90:9B –interactive

[   ][BC:6A:29:C3:90:9B][LE]> connect

[CON][BC:6A:29:C3:90:9B][LE]> char-read-hnd 0x25

[CON][BC:6A:29:C3:90:9B][LE]>

Characteristic value/descriptor: 00 00 00 00

[CON][BC:6A:29:C3:90:9B][LE]> char-write-cmd 0x29 01

[CON][BC:6A:29:C3:90:9B][LE]> char-read-hnd 0x25

[CON][BC:6A:29:C3:90:9B][LE]>

Characteristic value/descriptor: ce ff a8 0b

[CON][BC:6A:29:C3:90:9B][LE]> exit