| Utility to configure Qualcomm DIAG, read, decode and display the |
| DIAG messages. It can enable logging and format/print the log |
| messages generated by the various subsystems of the baseband. |
| |
| To build this software a copy of the Osmocom libosmocore |
| library is required. Your distribution might already contain |
| the necessary utility. |
| |
| In general all Qualcomm devices that export DIAG should be |
| supported. We have tested it with the Quectel UC20, EC20 and |
| EC25 devices. |
| |
| The convenient way to create a pcap dump of the messages is to run |
| ./capture.sh -s /dev/ttyUSB0 -f outfilename.pcap |
| This requires tcpdump, as well as the required permissions |
| to capture, i.e. on ubuntu this can be conveniently achieved by |
| sudo setcap cap_net_raw,cap_net_admin=ep /usr/sbin/tcpdump |
| |
| In order to distinguish multiple different modems in the capture file |
| passing a GSMTAP destination ip is possible with the -i parameter, i.e. |
| ./capture.sh -s /dev/ttyUSB0 -f outfilename.pcap -i 127.0.0.4 |
| This will "just work" on linux, since there is a default 127.0.0.0/8 route. |
| |
| Additionally wireshark needs Edit->Preferences->Protocols->NAS-EPS |
| "Force dissect as plain EPS" set to true, since capturing encrypted NAS |
| messages is fairly useless (although possible), so unencrypted |
| unprotected NAS messages are emitted, but wireshark will by default |
| refuse to dissect plain messages because according to the spec most |
| messages need to be at least integrity protected. |
| |
| Ubuntus ModemManager will interfere with the modem, so it needs to be |
| told to leave the modem alone. This can be accomplished by adding the |
| following line to |
| /etc/udev/rules.d/69-block-mm.rules : |
| ATTRS{idVendor}=="2c7c" ATTRS{idProduct}=="0125", ENV{ID_MM_DEVICE_IGNORE}="1 |
| |
| This example is for quectel ec25-e, adjust the USB VID:PID according to |
| what lsusb tells you about your particular modem. The rules then need to |
| be reloaded and ModemManager restarted: |
| sudo udevadm control --reload-rules |
| sudo udevadm trigger |
| sudo systemctl restart ModemManager |
| |
| There appears to be a bug on Ubuntu 18.04 and the ModemManager will still |
| interfere, see |
| https://bugs.launchpad.net/ubuntu/+source/modemmanager/+bug/1827328 |
| |
| |