Skip to content

Commit 24a7b05

Browse files
Documentation: Add usage of Wireshark for USB monitor
For: #15595 Ref: https://wiki.wireshark.org/CaptureSetup/USB Signed-off-by: wangjianyu3 <[email protected]>
1 parent de4135a commit 24a7b05

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,55 @@
11
===================
22
USB Monitor support
33
===================
4+
5+
Wireshark
6+
=========
7+
The wireshark software USB capture can capture URBs (USB Request Blocks) rather than raw USB packets when device connect to host directly.
8+
To capture raw USB packets, a sniffer is needed.
9+
10+
Linux
11+
-----
12+
1. Install Wireshark::
13+
14+
sudo apt update
15+
sudo apt install wireshark
16+
17+
2. (Optional) Configurate Wireshark
18+
19+
Wireshark offical documentation: https://wiki.wireshark.org/CaptureSetup/USB
20+
21+
3. Load the usbmon kernel module and run Wireshark::
22+
23+
sudo modprobe usbmon
24+
sudo wireshark
25+
26+
4. Find bus the device connects::
27+
28+
$ adb devices -l
29+
List of devices attached
30+
1234 device usb:1-9.4 product:adb dev model:adb_board device:NuttX device transport_id:1000
31+
32+
$ dmesg
33+
[3713722.861582] usb 1-9.4: New USB device found, idVendor=18d1, idProduct=4e11, bcdDevice= 1.01
34+
35+
$ lsusb
36+
Bus 001 Device 035: ID 18d1:4e11 Google Inc. Nexus One
37+
38+
5. Filter device
39+
40+
- Select usbmon (Bus 001): usbmon1
41+
- Wireshark filter (Bus 001 Device 035): usb.addr[0:4] == "1.35"
42+
43+
6. Example
44+
45+
Capturing ADB packets with filter (usb.addr[0:4] == "1.35"), on board `ESP32S3-DevKit:ADB <https://nuttx.apache.org/docs/latest/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.html#adb>`_::
46+
47+
adb -s 1234 shell ls /dev/
48+
49+
The example PcapNg(Packet CAPture Next Generation) file can be downloaded from :download:`here <./usbmonitor_wireshark_linux_example_adb.pcapng>`.
50+
51+
.. figure:: usbmonitor_wireshark_linux_example_adb.png
52+
:align: center
53+
54+
Wireshark Capturing
55+
Loading

0 commit comments

Comments
 (0)