Osmocom tools for Qualcomm DIAG
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Eric Wild acb80088b3 allow specifying gsmtap dest ip 2 years ago
doc Add some notes and examples on the protocol 10 years ago
src allow specifying gsmtap dest ip 2 years ago
tools Add python script to generate value_string from file with #defines 6 years ago
.gitignore add *.pyc to .gitignore 6 years ago
COPYING Add GPLv2-or-later license text + headers + rename to osmo-qcdiag-log 6 years ago
HISTORY Modernize README, move the old information to HISTORY 6 years ago
README allow specifying gsmtap dest ip 2 years ago
TODO Fix typos 6 years ago
capture.sh allow specifying gsmtap dest ip 2 years ago


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
This will "just work" on linux, since there is a default 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