If you use a SIM card with a prepaid (pay as you go) plan, you might have to send USSD codes like *100# to check your balance, or send codes to load the money from a voucher, or to change the data plan you’re using.
In the past, I’ve been able to use the prepaid-manager-applet utility to send USSD codes and view the response.
Recently I tried to do so again, but failed. The prepaid-manager-applet utility failed with an error:
“GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.ModemManager was not provided by any .service files”
(see also the bug report at https://bugzilla.redhat.com/show_bug.cgi?id=984969 )
I learned that current NetworkManager versions no longer support the old D-Bus interface named org.freedesktop.ModemManager, but have introduced an incompatible interface named org.freedesktop.ModemManager1.
Unfortunately, prepaid-manager-applet doesn’t support the new interface yet, so I searched for a replacement. I found the modem-manager-gui software, and tried to use it.
Unfortunately, it didn’t work either, but for a different reason. The NetworkManager and ModemManager software attempted to access the Gobi 2000 modem using the newer QMI protocol. However, the implementation of the QMI protocol in NetworkManager and in libqmi doesn’t yet support handling USSD commands.
(see also https://bugs.freedesktop.org/show_bug.cgi?id=84982 )
The QMI protocol is used by some modems as a replacement for the classic AT modem commands. Luckily the Gobi 2000 modem still supports those classic commands, too.
Thanks to advice from Dan Williams (dcbw), I learned that it is possible to force ModemManager and NetworkManager to use the classic interface, by disabling the use of the qmi_wwan kernel module. This can be achieved by creating a new file named e.g. /etc/modprobe.d/blacklist-qmi.conf and edit it to contain the text “blacklist qmi_wwan” (without quotes).
After you reboot, and perform the usual steps to activate the modem (which is a different story), I tried again to use the modem-manager-gui utility, and it was successfully able to send USSD commands!
Dan advised that some functionality might be missing when blacklisting the modern qmi_wwan module, but at least in my case, it’s working fine (I can connect to the Internet using the broadband modem).
Finally, I’d like to mention another workaround for sending USSD commands, which doesn’t require to blacklist the qmi_wwan module.
It’s possible to use the minicom terminal software to interactively send USSD commands to the modem.
The Gobi 2000 modem creates three ttyUSB devices, I had to experiment which one can be used. In my case it was /dev/ttyUSB1.
I used the following commands:
minicom –device /dev/ttyUSB1
Turn on echos:
Enter a command to check that interaction with the modem is working, some device information should be printed:
Now send the USSD command that you wish, in the following replace the text USSD with the command you would like to send (such as *100#), and KEEP the quotes:
After a few seconds, it printed the balance on my SIM card. You should be able to use the same mechanism to send charge codes, such as *101*CASHCODE#