Osmocom tools for Qualcomm DIAG
Go to file
Eric Wild acb80088b3 allow specifying gsmtap dest ip
This allows distinguishing multiple modems by specifying another
loopback ip i.e. -i 127.0.0.4
Linux has a default local route for 127.0.0.0/8 so it "just works".
2020-12-09 04:27:20 +01:00
doc Add some notes and examples on the protocol 2013-05-30 17:50:39 +02:00
src allow specifying gsmtap dest ip 2020-12-09 04:27:20 +01:00
tools Add python script to generate value_string from file with #defines 2017-01-24 17:09:26 +01:00
.gitignore add *.pyc to .gitignore 2017-01-22 19:13:00 +01:00
COPYING Add GPLv2-or-later license text + headers + rename to osmo-qcdiag-log 2016-12-24 10:31:07 +01:00
HISTORY Modernize README, move the old information to HISTORY 2016-12-26 16:04:02 +01:00
README allow specifying gsmtap dest ip 2020-12-09 04:27:20 +01:00
TODO Fix typos 2016-12-28 15:12:38 +01:00
capture.sh allow specifying gsmtap dest ip 2020-12-09 04:27:20 +01:00

README

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