Skip to content

BLE Connect

Uffe Björklund edited this page Jun 16, 2015 · 5 revisions

1. Scan for devices

hcitool lescan

When a device is found you will see something like

34:B1:F7:D5:05:D7 SensorTag

Write the uuid of your tag down to use later on.

2. Register GATTTOOL

cp /usr/lib/bluez-5.30/attrib/gatttool /usr/local/bin

3. Connect

Now we can connect to the BLE device (sensortag) with the gatttool using the uuid of sensortag.

gatttool -b 34:B1:F7:D5:05:D7 -I

This will return something like

[34:B1:F7:D5:05:D7][LE]

Then just write "connect"

The complete operation would look like

root@raspberrypi:/# gatttool -b 34:B1:F7:D5:05:D7 -I
[34:B1:F7:D5:05:D7][LE]> connect
Attempting to connect to 34:B1:F7:D5:05:D7
Connection successful
[34:B1:F7:D5:05:D7][LE]>

next

Clone this wiki locally