Monday, 8 May 2017

How to scan for Bluetooth Smart / BLE (iBeacon) devices on Linux (Raspberry Pi)

Assuming you are using a Debian based Linux distribution like for example Ubuntu and Raspbian on the Raspberry Pi...

The following have been verified using Ubuntu 14.04 and Raspbian 'September 1014'.

Overview

The following demonstrates how to use the command line in Linux to scan for Bluetooth Smart devices (BLE, or iBeacon).

Install

Install the Linux Bluetooth stack (Bluez) for use of it's HCI (Host Controller Interface) tools.
e.g.
sudo apt-get install bluez
sudo apt-get install bluez-hcidump

Scan

Firstly start sniffing HCI traffic to and from your Bluetooth device.
e.g.
sudo hcidump -i hci0 &

Next instruct your Bluetooth device to start looking for Bluetooth Smart devices.
e.g.
sudo hcitool -i hci0 lescan --duplicates

References

http://www.linuxcommand.org/man_pages/hcidump8.html
http://linuxcommand.org/man_pages/hcitool1.html

No comments:

Post a Comment