Mobile Radio Monitor

mrm-launcher

The Mobile Radio Monitor is a new (GPLv3+ licensed) application I wrote this summer, which lets you grab signal and power information from QMI-powered modems, and displays it in time-based graphs. I really wanted to use some of the shiny new things available in GTK+ 3.9.x, so this application seemed a good excuse to play around with the GtkStack, GtkListBox, templates and such.

Internally, this application does not talk to ModemManager at all. The other thing that I wanted to try out with this application was the use of the ‘qmi-proxy‘ approach in libqmi, which lets you share a QMI port between different processes, and therefore this UI application can run alongside ModemManager without much collision between the two.

Launching

The Mobile Radio Application installs a desktop file, so it can be launched directly from the desktop shell. It needs to run as root, so “pkexec” takes care of requesting user authentication to gain privileges through polkit. The other option, of course is to just launch it from the command line using “sudo” or the like.

BTW, yes, the icon is the same one from gnome-system-monitor with just different colors. Quick and dirty hack, but looks good to me. Thanks to jimmac, who I think draw the icon originally πŸ˜‰

Device list

When the application starts you’ll be greeted with the QMI device list detected by the application. Unusable modems will be shown as deactivated items (e.g. when modem requires a SIM but there is no SIM inserted), and for the usable ones you’ll be able to insert the PIN if required.

mrm-device-list

Signal information

Once a device has been selected, the application will switch to the Signal information tab, where you can see graphs for things like RSSI, Ec/Io, S/N, RSRP and RSRQ

mrm-signal-tab

Not every technology exposes all the previous values, though. GSM will only show RSSI, while UMTS/HSPA will show RSSI and Ec/Io. In addition to the graphs, the current instant value of each signal property is also given in the legend box.

Hiding/showing graphs based on the current used access technology was an idea, but I left it out because you can actually switch the preferred technology using e.g. qmicli’s --nas-set-system-selection-preference, and therefore you would be able to see graphs with both access technologies.

Power information

In addition to signal information, the application also exposes receiver and transmitter power values in the Power information tab.

mrm-power-tab

Thanks to being able to have ModemManager running at the same time, you can actually get the modem connected and see how both the RX and TX power values go up and down.

Want to try it? (updated Feb 2015)

You can grab the sources from the following Bitbucket git repo:
https://bitbucket.org/aleksander0m/mobile-radio-monitor.

Or directly from the 1.0 tagged release here:
https://aleksander.es/software/mobile-radio-monitor-1.0.tar.xz

If you’re a brave Arch Linux user, you can also just get it built from AUR:
https://aur.archlinux.org/packages/mobile-radio-monitor/

As always, comments and patches welcome πŸ™‚

Posted on September 17, 2013, in Development, FreeDesktop Planet, GNOME Planet, Planets and tagged , , , , . Bookmark the permalink. 28 Comments.

  1. Hi Aleksander,

    When using the mobile-radio-monitor I receive the following warning:
    * (mobile-radio-monitor:15156): WARNING **: Error loading signal info: Cannot send message: QMI service ‘nas’ version ‘1.8’ required, got version ‘1.0’
    The result is that the GUI is displayed but the graphs are not populated with data.

    I tried with two different USB modems (ZTE MF 190 and Huawei E160G) both give the same error.
    Using qmicli the USB modems are available:
    $s udo qmicli -d /dev/cdc-wdm0 –nas-get-signal-strength
    [/dev/cdc-wdm0] Successfully got signal strength
    Current:
    Network ‘umts’: ‘-97 dBm’

    Is this maybe caused by a limitation in the QMI operations these USB modems support ?
    There are quite some operations on the qmicli that return InvalidQmiCommand. E.g:
    sudo qmicli -d /dev/cdc-wdm0 –nas-get-signal-info
    error: couldn’t get signal info: QMI protocol error (71): ‘InvalidQmiCommand’

    Is there such a thing as a β€œGet Version Info” command in the qmicli to see which versions of the different QMI services a device supports ?

    What are my options with these modems ( as updated firmware of these modems to the latest version the manufacturs provide did not help) or should I just simply acquire USB modems with nas 1.8 support. How could I know in advance which USB modem is suitable for your tool ?

    [For completeless :
    -dmesg
    [ 2163.696898] qmi_wwan 2-1.4:1.3: cdc-wdm0: USB WDM device
    [ 2163.697572] qmi_wwan 2-1.4:1.3 wwan0: register ‘qmi_wwan’ at usb-0000:00:1d.0-1.4, WWAN/QMI device, 2a:a4:17:71:85:81

    – uname -r
    : 3.11.0-12-generic
    , I am on Ubuntu 13.10
    – qmicli version (qmicli -V
    qmicli 1.7.0)
    – kernel drivers
    /lib/modules/3.11.0-12-generic/kernel/drivers/net/usb$ ls *qmi*
    qmi_wwan.ko
    $ lsmod | grep qmi
    qmi_wwan 17363 0
    cdc_wdm 18399 1 qmi_wwan
    usbnet 37607 1 qmi_wwan
    ]
    – ldd /usr/local/bin/mobile-radio-monitor | grep qmi
    libqmi-glib.so.1 => /usr/local/lib/libqmi-glib.so.1 (0xb7625000), also libqmi is version 1.7.0)

    Thanks for your great work,
    BR
    /Arjen

  2. “NAS Get Signal Info” is only available in QMI devices with NAS >= 1.8; your modems probably support an older NAS version. You can get the list of supported versions with qmicli --get-service-version-info. I could have developed it using “NAS Get Signal Strength”, which is available in all QMI modems, even if those with NAS 1.0, but at the end this was a proof-of-concept so I just used the newest commands. The Power info is only available in even newer NAS versions (1.9? IIRC).

    You could try to update the firmware of your devices, as that usually gets you newer NAS versions. Or if you’re into hacking, adding support for “NAS Get Signal Strength” shouldn’t be a big deal; I actually did that for ModemManager, which supports both.

  3. Dear Aleksander,

    I got the following error messages while building Mobile-Radio-Monitor

    ———————————————————————————————————–

    mrm-signal-tab.c:467:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:468:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:469:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:470:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:471:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:472:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:473:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:474:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:475:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:476:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:477:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:478:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:479:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:480:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:481:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:482:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:483:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:484:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:485:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:486:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:487:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:488:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:489:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:490:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:491:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:492:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:493:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:494:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:495:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:496:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:497:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:498:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:499:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:500:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:501:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:502:65: error: expected expression before γ€ŒMrmSignalTab」
    mrm-signal-tab.c:503:65: error: expected expression before γ€ŒMrmSignalTab」

    ————————————————————————————————————

    I didn’t modify anything in source code and the version of gtk+-3.0 is 3.9.8.

    Do you know what happened for this situation??

    Thanks.

    Regards,
    Jake

  4. Hum… maybe gtk_widget_class_bind_template_child() is not available yet in 3.9.8? I’m using 3.10 here; and actually the docs say “Since 3.10” for that version, although that’s normal as 3.9.x was the unstable version. Could you try with 3.10?

  5. Dear Aleksander,

    Thanks for your kindly help.
    Currently, the Mobile Radio Monitor could be compiled and installed.

    But I met another question that Mobile Radio Monitor couldn’t detect my device by itself.
    I’m sure that the device has been mounted by system and I could get some information via qmicli application.

    ——————————————————————————————————————-

    kernel log

    [ 831.927883] usbcore: registered new interface driver cdc_wdm
    [ 831.952340] qmi_wwan 1-1:1.5: cdc-wdm0: USB WDM device
    [ 831.952839] qmi_wwan 1-1:1.5 wwan0: register ‘qmi_wwan’ at usb-0000:02:03.0-1, WWAN/QMI device, aa:37:5d:af:fd:31
    [ 831.952947] usbcore: registered new interface driver qmi_wwan

    ********************************************************************************************************************

    qmicli version

    jake1223@jake1223-virtual-machine:/dev$ qmicli -V

    qmicli 1.8.0
    Copyright (2012) Aleksander Morgado

    ********************************************************************************************************************

    mobile-radio-monitor init log

    Gtk-Message: Failed to load module “overlay-scrollbar”
    Gtk-Message: Failed to load module “canberra-gtk-module”

    (mobile-radio-monitor:5888): Gtk-WARNING **: Child name ‘signal_box’ not found in GtkStack

    ** (mobile-radio-monitor:5888): WARNING **: Cannot create MRM device: Cannot open QMI device file: Couldn’t spawn the qmi-proxy

    ——————————————————————————————————————–

    Do I need to change anything according to the above information??

    Thanks.

    Regards,
    Jake

  6. Where did you install libqmi? Which –prefix did you use in configure? Try with –prefix=/usr. Problem seems to be that the qmi-proxy isn’t found where expected.

  7. Dear Aleksander,

    I’ve already installed libqmi and the version is 1.6.0.
    The symptom is the same although I added –prefix=/usr during libqmi installation.

    Do I need to add –prefix parameter during mobile-radio-monitor installation??

    Thanks.

    Regards,
    Jake

  8. Oh wait, 1.6.0 is not good enough, you need >= 1.7.0, which is the one coming with the qmi-proxy.

  9. Dear Aleksander,

    The symptom is the same although I upgraded libqmi from 1.6.0 to 1.8.0.
    Could you share you installation step to me??

    Thanks.

    Regards,
    Jake

  10. I usually just configure with “–prefix=/usr –sysconfdir=/etc –localstatedir=/var –libdir=/usr/lib64” and then make && make install

  11. Hi!

    Mobile Radio Monitor works with wvdial? I have Sierra Wireless AirCard 310U and 320U.
    Since kernel 3.9 I’m not able to connect with NM/MM (on any distro: Mint, Arch, Fedora etc.). You also have Sierra device, maybe You know this problem with “DHCP timeout” since kernel >3.9 (https://bbs.archlinux.org/viewtopic.php?pid=1351740)?

    I would be grateful for any advice.

  12. Mobile Radio Monitor works with libqmi, it has really nothing to do with wvdial.

    As for the ModemManager issues, always run MM/NM with debug logs on, so that we can know better what could be happening, see:
    http://www.freedesktop.org/wiki/Software/ModemManager/Debugging/

    You can then send your comments or issues to the ModemManager mailing list (please subscribe before posting):
    http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

  13. Hi Aleksander

    Will this work on kernel <3.4

    Regards
    Vipin

  14. You’ll need to port the qmi_wwan driver to that kernel first, otherwise no.

  15. Hi Alexander,
    This look very nice. Two questions:
    1) How did you obtain the TX power?
    2) Would it be possible to compile something like this for Android? (What would it take to do so?)

  16. aleksander

    1) Using the QMI protocol and libqmi
    2) Possible, yes. But no idea how long it would take, likely not much if the GobiAPI library can be used.

  17. Hi Aleksander

    It’s cool application. Could you give the cue what the IDE and wich OS do you use for that ?

  18. The toolkit I use is GTK+3, and this app runs on GNU/Linux systems.

  19. Hi Aleksander,
    In a recent upgrade to Ubuntu 14.04.2 LTS (‘trusty’) I could somehow not compile the source code anymore. See below an excerpt of the make output. Is wondered if this is related to incorrect libqmi version/package installed ? For completeness a listing of qmi packages installed is added below.
    Thanks
    /Arjen

    β€œmake[3]: Entering directory `/home/arsmit/MRM/MRM1.0/mobile-radio-monitor-1.0/src’
    CC mobile_radio_monitor-mrm-device.o
    mrm-device.c: In function β€˜qmi_client_nas_get_tx_rx_info_ready’:
    mrm-device.c:151:5: error: unknown type name β€˜QmiMessageNasGetTxRxInfoOutput’
    QmiMessageNasGetTxRxInfoOutput *output;
    ^
    mrm-device.c:154:12: warning: assignment makes pointer from integer without a cast [enabled by default]
    output = qmi_client_nas_get_tx_rx_info_finish (client, res, &error);
    ^
    mrm-device.c: In function β€˜reload_power_info_context_step’:
    mrm-device.c:224:13: error: unknown type name β€˜QmiMessageNasGetTxRxInfoInput’
    QmiMessageNasGetTxRxInfoInput *input;
    ^
    mrm-device.c:249:19: warning: assignment makes pointer from integer without a cast [enabled by default]
    input = qmi_message_nas_get_tx_rx_info_input_new ();
    ^
    mrm-device.c: In function β€˜qmi_device_new_ready’:
    mrm-device.c:1162:23: error: β€˜QMI_DEVICE_OPEN_FLAGS_PROXY’ undeclared (first use in this function)
    (QMI_DEVICE_OPEN_FLAGS_PROXY |
    ”

    dpkg -l | grep qmi
    ii libqmi-glib-dev:amd64 1.4.0-1 amd64 Header files for adding QMI support to applications that use glib
    ii libqmi-glib-doc 1.4.0-1 all API documentation for libqmi-glib
    ii libqmi-glib0:amd64 1.4.0-1 amd64 Support library to use the Qualcomm MSM Interface (QMI) protocol
    ii libqmi-glib0-dbg 1.4.0-1 amd64 Support library to use the Qualcomm MSM Interface (QMI) protocol
    ii libqmi-glib1:amd64 1.8.0-2~ubuntu14.04.1 amd64 Support library to use the Qualcomm MSM Interface (QMI) protocol
    ii libqmi-glib1-dbg 1.8.0-2~ubuntu14.04.1 amd64 Support library to use the Qualcomm MSM Interface (QMI) protocol
    ii libqmi-proxy 1.8.0-2~ubuntu14.04.1 amd64 Proxy to communicate with QMI ports
    ii libqmi-utils 1.4.0-1 amd64 Utilities to use the QMI protocol from the command line

  20. There’s something wrong, you have a mix of versions installed it seems. You need to use libqmi 1.8 for the monitor program to work, but your libqmi-glib-dev is 1.4.

  21. Guillaume BALLET

    Hello Aleksander,

    I’ve got a problem running: sudo mobile-radio-monitor
    it doesn’t detect my M.2 Sierra EM7455 with following error
    ** (mobile-radio-monitor:16200): WARNING **: Cannot create MRM device: Cannot reload modem status: couldn’t get PIN status: QMI protocol error (71): ‘InvalidQmiCommand’

    The sim pin code is disabled and the modem in working throw ModemManager (which I disabled of course)

    The modem is in QMI only mode (no MBIM)

    ~/mobile-radio-monitor$ git checkout
    Votre branche est Γ  jour avec ‘origin/master’.

    uname -a
    Linux gigi-Sky-X4E2G 4.8.0-41-generic #44-Ubuntu SMP Fri Mar 3 15:27:17 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

    lsmod |grep qmi
    qmi_wwan 24576 0
    cdc_wdm 20480 1 qmi_wwan
    usbnet 45056 1 qmi_wwan

    qmicli -V

    qmicli 1.17.900 (same for libqmi)

    sudo qmicli -d /dev/cdc-wdm1 –device-open-qmi –device-open-proxy –get-service-version-info
    [/dev/cdc-wdm1] Supported versions:
    ctl (1.5)
    wds (1.67)
    dms (1.14)
    nas (1.25)
    qos (1.6)
    wms (1.10)
    auth (1.3)
    at (1.2)
    voice (2.1)
    cat2 (2.24)
    uim (1.45)
    pbm (1.4)
    test (1.0)
    loc (2.0)
    sar (1.0)
    ts (1.0)
    tmd (1.0)
    wda (1.16)
    csvt (1.1)
    coex (1.0)
    pdc (1.0)
    rfrpe (1.0)
    dsd (1.0)
    ssctl (1.0)
    unknown [0x2e] (1.0)
    unknown [0x30] (1.0)
    unknown [0x31] (1.0)
    unknown [0x36] (1.0)
    rms (1.0)
    unknown [0xf0] (1.0)
    unknown [0xf3] (1.0)
    unknown [0xf5] (1.0)
    unknown [0xf6] (1.0)

    Thank you for your amazing work!
    Cheers,

    Guillaume

  22. Yep, known issue, the radio monitor program won’t work with EM74xx or MC74xx because these no longer support the “DMS UIM” commands and we need to default to use the “UIM” commands instead for PIN operations.

  23. Guillaume BALLET

    Hello Aleksander,

    Thank you for your reply.
    Is it something that you intend to do?
    Do you thing it’s something doable hacking your sources?

    Guillaume

  24. Intend to do yes, when no idea yet πŸ™‚ This program will be integrated in the libqmi sources soon, I already have a branch in libqmi git doing that; so whenever I do it I’ll do it directly there.

    It’s definitely doable if you’d like to try; I had to do the same kind of change a while back in ModemManager itself, see:
    https://cgit.freedesktop.org/ModemManager/ModemManager/commit/src/mm-broadband-modem-qmi.c?id=83868c61b10146795a7369a8db452143363a6edb

  25. Guillaume BALLET

    Thank you so much!
    I’ll give it a try!
    Guillaume

  26. Hello Alex! I have the issue in using qmi-proxy.
    qmicli -v 1.16.0
    Server Centos 7 4.12.8-1.el7.elrepo.x86_64
    4 (four) MC7304

    I have a simple c-program, that run command in cycle for 4 qmi-ports using qmi-proxy demon:
    sprintf(cmd_string, “qmicli -p -d /dev/cdc-wdm%d –nas-get-signal-strentgh”, number_device)
    After ~2 hours of good working I get err: error: couldn’t open the QmiDevice: Couldn’t spawn the qmi-proxy and Call Trace:

    [10322.769636] INFO: task qmi-proxy:4976 blocked for more than 120 seconds.
    [10322.772846] Not tainted 4.12.8-1.el7.elrepo.x86_64 #1
    [10322.776007] “echo 0 > /proc/sys/kernel/hung_task_timeout_secs” disables this message.
    [10322.779387] qmi-proxy D 0 4976 1 0x00000080
    [10322.782769] Call Trace:
    [10322.786164] __schedule+0x28a/0x880
    [10322.789508] schedule+0x36/0x80
    [10322.792840] wdm_flush+0x8f/0x110 [cdc_wdm]
    [10322.796144] ? remove_wait_queue+0x60/0x60
    [10322.799501] filp_close+0x2f/0x70
    [10322.802901] __close_fd+0x9a/0xc0
    [10322.806331] SyS_close+0x23/0x50
    [10322.809701] do_syscall_64+0x67/0x150
    [10322.813073] entry_SYSCALL64_slow_path+0x25/0x25
    [10322.816424] RIP: 0033:0x7f1d5e1d5bed
    [10322.819815] RSP: 002b:00007ffd2303f7d0 EFLAGS: 00000293 ORIG_RAX: 0000000000000003
    [10322.823396] RAX: ffffffffffffffda RBX: 0000000002475160 RCX: 00007f1d5e1d5bed
    [10322.827072] RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000007
    [10322.830727] RBP: 0000000000000000 R08: 0000000002468a00 R09: 000000000248ca90
    [10322.834375] R10: 0000000000000000 R11: 0000000000000293 R12: 0000000000000000
    [10322.837970] R13: 0000000000000000 R14: 00007f1d5f04ae90 R15: 0000000002477c80

    Could you help me?

  27. Try using libqmi 1.18.0 first. Then, if the problem persists, build libqmi yourself like this:

    // Or any other prefix/libdir/bindir… your system is using

    $ ./configure --prefix=/usr CFLAGS="-ggdb -O0"
    $ make && sudo make install

    And then run the qmi-proxy manually under gdb (before any of your apps):
    $ gdb --args /usr/libexec/qmi-proxy --verbose --no-exit

    And wait for it to crash, and when it does crash, run “bt” and send me the output.

Leave a comment