Bbb sniffer

Jump to: navigation, search

This page explains how to setup a USB sniffer on the BeagleBone Black.
This is possible thanks to the USBProxy project.


  • a BeagleBone Black
  • a micro SD card

SD card setup

This section explains how to setup the SD card on a Linux desktop.

mkdir ~/bbb
cd ~/bbb
md5sum bone-debian-7.5-2014-05-14-2gb.img.xz

(result should be 35877ce21e8ed0eb1bdc6819ad71c317)

xz --stdout -d bone-debian-7.5-2014-05-14-2gb.img.xz | sudo dd of=/dev/sdX bs=4096

Where /dev/sdX is the sdcard device. Don't try anything if you don't know what 'X' should be (you could wipe your hard drive).

Remove the sdcard.

tar xzvf 3.8.13-bone50.tar.gz 
cd linux-dev-3.8.13-bone50/

If needed, modify tools/ so that it detects your Linux distribution.


This script will eventually tell you to run commands to install missing packages, e.g.:

sudo apt-get update
sudo apt-get install device-tree-compiler lzma

Patch and rebuild USB gadget modules:

cd KERNEL/drivers/usb/gadget/
patch < inode.c.patch
cd ~/bbb/linux-dev-3.8.13-bone50

Insert and mount the sdcard (e.g. to /mnt/rootfs).

cp ~/bbb/linux-dev-3.8.13-bone50/KERNEL/drivers/usb/gadget/*.ko /mnt/rootfs/lib/modules/3.8.13-bone50/kernel/drivers/usb/gadget/

Modify the /mnt/rootfs/opt/scripts/boot/ file so that the usb0 related lines are commented out.

Unmount the sdcard, plug it in the BBB, and power it on.

USBProxy installation

This section explains how to install USBProxy on the BeagleBone Black.

depmod -a
apt-get install libudev-dev
mkdir sniffer
cd sniffer
tar xzvf v1.0.19.tar.gz
cd libusb-1.0.19/
make install
mv /etc/ /etc/

Install USBProxy as explained in the README.

Install tcpdump:

apt-get install tcpdump


The pcap logger included in USBProxy has many issues.
I recommend using usbmon and tcpdump instead.

Start tcpdump:

modprobe usbmon
tcpdump -i usbmon1 -w capture.pcap

Start USBProxy:


The capture.pcap file can be opened with wireshark.