Skip to content

Instantly share code, notes, and snippets.

@ggreen88
Forked from jkeefe/raspberry-pi-ble-sniffer.md
Created September 22, 2017 18:03
Show Gist options
  • Save ggreen88/3e37bcb3cb1a9e85d46be5112eda3277 to your computer and use it in GitHub Desktop.
Save ggreen88/3e37bcb3cb1a9e85d46be5112eda3277 to your computer and use it in GitHub Desktop.
Notes on using Adafruit's "Bluefruit" BLE sniffer with a Raspberry Pi

BLUETOOTH SNIFFER

Working to sniff Bluetooth Low Energy with the adafruit sniffer

For more information, see this blog post

Going the python route, as described here

before installing pySerial, did ...

apt-get update
apt-get upgrade

which was probably unnecessary and took a long time :-(

then did

sudo pip install pyserial

downloaded the adafruit python sniffer package, sniffer.py

sudo git clone https://github.com/adafruit/Adafruit_BLESniffer_Python.git

changed into that directory

cd Adafruit_BLESniffer_Python/

tried their example command, which worked:

sudo python sniffer.py -h

in order to get pyserial to talk with the usb port, apparently need to do this, to add the "pi" user to the dialout group:

sudo usermod -a -G dialout pi

ok, so now I need a port to listen to ... where the sniffer device is. so apparently I do this:

ls -l /dev/tty*

which lists a whole bunch of things I don't understand, except that the last lines are:

crw------- 1 root root      4,  7 Dec 31  1969 /dev/tty7
crw------- 1 root root      4,  8 Dec 31  1969 /dev/tty8
crw------- 1 root root      4,  9 Dec 31  1969 /dev/tty9
crw-rw---- 1 root tty     204, 64 May 16 13:09 /dev/ttyAMA0
crw-rw---T 1 root dialout   5,  3 Dec 31  1969 /dev/ttyprintk
crw-rw---T 1 root dialout 188,  0 Dec 31  1969 /dev/ttyUSB0

Tried the AMA0 one, which didn't work. The USB0 one, did!

sudo python sniffer.py /dev/ttyUSB0

Results:

Scanning for BLE devices (5s) ...
Found 2 BLE devices:

  [1] "" (B8:78:2E:1C:2F:10, RSSI = -104)
  [2] "MetaWear" (EA:A1:88:31:45:21, RSSI = -88)

Select a device to sniff, or '0' to scan again
> 

Very cool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment