Skip to main content
Capture the Bluetooth LE radio traffic that a sniffer net hears, and save it as a pcap file on your computer. The sniffer is an nRF52840 Dongle that runs Nordic’s nRF Sniffer for Bluetooth LE firmware. Wireshark and tshark open the file.

Syntax

With no command, lager ble-sniffer --box <BOX> lists the BLE sniffer nets.

Commands

Command Reference

capture

The Lager Box records in a background job and writes the capture under /tmp/lager-output/ble-sniffer. The CLI polls the job about once a second, then downloads the file and deletes the box copy. The sniffer always follows scan responses and auxiliary advertising packets, as the Wireshark plugin does. Without --follow or --follow-by-name, it stays on the advertising channels: it records advertising and connection requests, but not the traffic of the connections. To capture a connection, follow one of its devices before it connects. When a follow was asked for and nothing from that device was captured, the command prints a warning, and --json has "follow_seen": false. A wrong --public/--random makes the sniffer follow nothing. Ctrl+C stops the capture on the box, then downloads what was recorded and exits with status 130. A second Ctrl+C exits at once with status 130 and leaves the file on the box. A capture holds the sniffer for its full duration. A second capture on the same sniffer fails at once with a busy error. stop ends the first one from another shell. A sniffer that does not answer within 2 s fails the capture; unplug and replug it. If the sniffer stops answering mid-capture, the CLI saves the packets recorded so far and exits with status 1. The error is printed, and --json carries it in error.

stop

Stops a capture that capture started on this sniffer. The capture ends within a second, and its file stays on the box for a day. A capture from a lager python script cannot be stopped this way.

status

Reports the sniffer’s serial port on the Lager Box and whether a capture holds it. It also shows the last capture that capture started: its state, packets, elapsed time and file on the box. It does not open the sniffer.

Output

duration is the measured capture time. followed is the address a follow request was sent for, and follow_seen says whether anything from it was captured (null without a follow). The pcap link type is NORDIC_BLE (272). Wireshark decodes it with its nordic_ble dissector. Packet times come from the sniffer’s microsecond clock.

Setting up a sniffer

The Lager Box talks to the nRF Sniffer firmware directly, so nothing is installed on the box. Lager is tested with firmware 5.0.0. Flash the firmware once, from any computer:
  1. Get the firmware from Nordic’s nrfutil-ble-sniffer package. Nordic’s license does not allow redistributing it. On Linux x86-64:
  2. Press the dongle’s side RESET button. The red LED fades in and out while its bootloader runs.
  3. Program the package with nrfutil device program --firmware <zip>, or with nRF Connect Programmer.
After the flash, the dongle enumerates as USB 1915:522a, “nRF Sniffer for Bluetooth LE”. Firmware 5.x exposes two serial ports, and the sniffer runs on the second one. Lager picks that port itself. The dongle shows up in lager instruments as Nordic_nRF_Sniffer. Add the net with its address from that list:

Examples

Notes

  • The default net comes from lager defaults add --ble-sniffer-net <NET>.
  • Decryption keys (IRK, LTK) are not available from the CLI yet.