Holger Hans Peter Freyther | 1d53544 | 2016-12-26 16:04:02 +0100 | [diff] [blame] | 1 | Utility to configure Qualcomm DIAG, read, decode and display the |
| 2 | DIAG messages. It can enable logging and format/print the log |
| 3 | messages generated by the various subsystems of the baseband. |
| 4 | |
| 5 | To build this software a copy of the Osmocom libosmocore |
| 6 | library is required. Your distribution might already contain |
| 7 | the necessary utility. |
| 8 | |
| 9 | In general all Qualcomm devices that export DIAG should be |
| 10 | supported. We have tested it with the Quectel UC20, EC20 and |
| 11 | EC25 devices. |
Eric Wild | 6f9290d | 2020-05-12 17:02:03 +0200 | [diff] [blame] | 12 | |
| 13 | The convenient way to create a pcap dump of the messages is to run |
Eric Wild | a3ffa99 | 2020-05-12 18:26:10 +0200 | [diff] [blame] | 14 | ./capture.sh -s /dev/ttyUSB0 -f outfilename.pcap |
Eric Wild | 6f9290d | 2020-05-12 17:02:03 +0200 | [diff] [blame] | 15 | This requires tcpdump, as well as the required permissions |
| 16 | to capture, i.e. on ubuntu this can be conveniently achieved by |
| 17 | sudo setcap cap_net_raw,cap_net_admin=ep /usr/sbin/tcpdump |
| 18 | |
Eric Wild | acb8008 | 2020-12-09 04:24:13 +0100 | [diff] [blame] | 19 | In order to distinguish multiple different modems in the capture file |
| 20 | passing a GSMTAP destination ip is possible with the -i parameter, i.e. |
| 21 | ./capture.sh -s /dev/ttyUSB0 -f outfilename.pcap -i 127.0.0.4 |
| 22 | This will "just work" on linux, since there is a default 127.0.0.0/8 route. |
| 23 | |
Eric Wild | 6f9290d | 2020-05-12 17:02:03 +0200 | [diff] [blame] | 24 | Additionally wireshark needs Edit->Preferences->Protocols->NAS-EPS |
| 25 | "Force dissect as plain EPS" set to true, since capturing encrypted NAS |
| 26 | messages is fairly useless (although possible), so unencrypted |
| 27 | unprotected NAS messages are emitted, but wireshark will by default |
| 28 | refuse to dissect plain messages because according to the spec most |
| 29 | messages need to be at least integrity protected. |
| 30 | |
| 31 | Ubuntus ModemManager will interfere with the modem, so it needs to be |
| 32 | told to leave the modem alone. This can be accomplished by adding the |
| 33 | following line to |
| 34 | /etc/udev/rules.d/69-block-mm.rules : |
| 35 | ATTRS{idVendor}=="2c7c" ATTRS{idProduct}=="0125", ENV{ID_MM_DEVICE_IGNORE}="1 |
| 36 | |
| 37 | This example is for quectel ec25-e, adjust the USB VID:PID according to |
| 38 | what lsusb tells you about your particular modem. The rules then need to |
| 39 | be reloaded and ModemManager restarted: |
| 40 | sudo udevadm control --reload-rules |
| 41 | sudo udevadm trigger |
| 42 | sudo systemctl restart ModemManager |
| 43 | |
| 44 | There appears to be a bug on Ubuntu 18.04 and the ModemManager will still |
| 45 | interfere, see |
| 46 | https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1827328 |
| 47 | |
| 48 | |