Samrung
Samrung

Reputation: 53

How to retrieve advertising payload from iBeacon / BLE

How do you retrieve the advertising payload for a Bluetooth LE emitter in Linux?

Specifically, I've configured Arduinos and Raspberry Pis using hcitool to act as iBeacons.

What I'm looking for is a command to print out what the current advertising payload is for the device.

Upvotes: 5

Views: 19344

Answers (3)

Abdul Wajid
Abdul Wajid

Reputation: 1

sudo hcitool lescan --duplicates &
sudo hcitool spinq

Both commands runs an infinite loop how to run a finite loop and get the data

Upvotes: 0

Pierz
Pierz

Reputation: 8088

Since libpcap-1.0+ now supports Bluetooth capture you can use Wireshark/tshark/tcpdump to capture and display Bluetooth packets - both BTLE and other packet types.

To capture the LE packets with Wireshark you will still need to tell the Bluetooth interface to query for LE packets, as mentioned in the previous answer:

sudo hcitool lescan --duplicates &

In addition if you want the adapter to do a periodic query for Bluetooth devices, which are in discoverable mode, you can run (though these queries won't pick up BTLE emissions):

sudo hcitool spinq

Upvotes: 0

davidgyoung
davidgyoung

Reputation: 64916

At Radius Networks, we put together a set of scripts that parse the iBeacon identifiers out of BLE advertisement detected on Linux. You can find a description of this here.

If you simply want to see the raw advertisement bytes, you can start scanning on Linux with:

sudo hcitool lescan --duplicates &

And then see the results with:

sudo hcidump --raw 

More details are in the answer linked above.

Upvotes: 5

Related Questions