After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 652682 - Cannot get prepaid-manager-applet to work with ZTE stick
Cannot get prepaid-manager-applet to work with ZTE stick
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: ModemManager
git master
Other Linux
: Normal normal
: ---
Assigned To: Dan Williams
Depends on:
Blocks:
 
 
Reported: 2011-06-15 21:31 UTC by Felix Möller
Modified: 2011-07-22 14:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modem-manager --debug output (36.33 KB, text/plain)
2011-06-16 07:09 UTC, Felix Möller
  Details
Test to check if skipping the encoding fixes the bug. (515 bytes, patch)
2011-06-21 20:55 UTC, Guido Günther
none Details | Review
output with new patches (40.39 KB, text/plain)
2011-06-21 22:04 UTC, Felix Möller
  Details
Skip hex encoding in ZTE (2.20 KB, patch)
2011-06-22 18:49 UTC, Guido Günther
none Details | Review

Description Felix Möller 2011-06-15 21:31:23 UTC
I have the following stick:
$ python test/info.py /org/freedesktop/ModemManager/Modems/2
Type: GSM
Driver: option1
Modem device: /sys/devices/pci0000:00/0000:00:1a.7/usb1/1-1
Data device: ttyUSB2
Device ID: 42xxxxxxxxxxxxe06370e14ce

Vendor:  ZTE CORPORATION
Model:   MF190
Version: BD_MF190F3V1.0.0B02

SIM ID: 8cxxxxxxxxxxxxxxx5ac191
IMEI: xxxxxxxxxxxxxxx
IMSI: xxxxxxxxxxxxxxx
Operator ID: 26207
Signal quality: 80
Reg status: home (26207, 'o2 - de')
Allowed mode: any
Access Tech: UMTS

Starting the prepaid-manager-applet I get:
$ prepaid-manager-applet -d
Gtk-Message: Failed to load module "pk-gtk-module"
ppm: DEBUG: Using locale: ('de_DE', 'UTF8')
ppm: DEBUG: Setting up
ppm: DEBUG: Using modem /org/freedesktop/ModemManager/Modems/2
ppm: DEBUG: Fetching account information from '/apps/prepaid-manager/accounts/imsi:262074995519979/'
ppm: DEBUG: Provider 'O2' in 'de'
ppm: DEBUG: New provider: de, O2
ppm: DEBUG: Adding balance check {'ussd': '*101#'}
ppm: DEBUG: Provider changed to 'O2'
ppm: DEBUG: Started modem request: ussd_initiate
ppm: DEBUG: Finished modem request


However then I get:
ppm: ERROR: ussd_initiate failed: org.freedesktop.ModemManager.Modem.General:
Failed to encode USSD command '*101#'

I did not yet succeed in running the test program:
$ python test/ussd.py  /org/freedesktop/ModemManager/Modems/2 '*101#'

Traceback (most recent call last):
  • File "test/ussd.py", line 38 in <module>
    ret = modem.Initiate(arg)
  • File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 68 in __call__
    return self._proxy_method(*args, **keywords)
  • File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 140 in __call__
    **keywords)
  • File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 630 in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

$ python test/ussd.py /org/freedesktop/ModemManager/Modems/2 cancel
Traceback (most recent call last):
  File "test/ussd.py", line 40, in <module>
    ret = modem.Cancel()
  File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 68, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 140, in __call__
    **keywords)
  File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 630, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.ModemManager.Modem.Gsm.Unknown: Unknown error


In /var/log/messages I have the following:
Jun 15 23:20:25 thinkpad modem-manager[25423]: (mm-generic-gsm.c:4881):ussd_send: runtime check failed: (priv->pending_ussd_info == NULL)
Jun 15 23:20:50 thinkpad ussd.py: abrt: detected unhandled Python exception in test/ussd.py

Thanks alot for your work. This tool seems really great.
Comment 1 Felix Möller 2011-06-15 21:35:09 UTC
I think everything works as expected with gsm-ussd btw.

$ gsm-ussd 
USSD session open, to cancel use "gsm-ussd -c".
Prepaid-Menü
1 Guthabenkonto
2 Guthaben-Verfügbarkeit
3 Aufladung Guthaben/Pack-to-Go
4 Pack Manager
7 Tarifinfo
8 Hilfe
Comment 2 Felix Möller 2011-06-15 21:37:06 UTC
[DEBUG] Start, Version 0.3.3, Args:  -d
[DEBUG] Setting output to UTF-8
[DEBUG] Lock /var/lock/LCK..ttyUSB1 set
[DEBUG] Opening modem
[DEBUG] Saving serial state
[DEBUG] Setting serial state
[DEBUG] Initialising Expect
[DEBUG] Starting modem check (AT)
[DEBUG] Sending command: AT
[DEBUG] AT found, ->  AT
[DEBUG] OK/ERROR found:  OK
[DEBUG] Modem found (AT->OK)
[DEBUG] Enabling modem echo (ATE1)
[DEBUG] Sending command: ATE1
[DEBUG] AT found, ->  ATE1
[DEBUG] OK/ERROR found:  OK
[DEBUG] ATE1 successful
[DEBUG] Querying modem type
[DEBUG] Sending command: AT+CGMM
[DEBUG] AT found, ->  AT+CGMM
[DEBUG] OK/ERROR found:  OK
[DEBUG] Modem type found:  MF190
[DEBUG] Modem type "MF190" needs cleartext for USSD query.
[DEBUG] Starting SIM state query (AT+CPIN?)
[DEBUG] Sending command: AT+CPIN?
[DEBUG] AT found, ->  AT+CPIN?
[DEBUG] OK/ERROR found:  OK
[DEBUG] Got answer for SIM state query
[DEBUG] SIM card is unlocked
[DEBUG] Waiting for net registration, max 10 tries
[DEBUG] Try: 1
[DEBUG] Sending command: AT+CREG?
[DEBUG] AT found, ->  AT+CREG?
[DEBUG] OK/ERROR found:  OK
[DEBUG] Net registration query result received, parsing
[DEBUG] Registered, home network
[DEBUG] Starting USSD query "*100#"
[DEBUG] Sending command: AT+CUSD=1,"*100#",15
[DEBUG] AT found, ->  AT+CUSD=1,"*100#",15
[DEBUG] OK found, continue waiting for result
[DEBUG] Expected answer:  +CUSD: 1,"0050007200650070006100690064002D004D0065006E00FC000A003100200047007500740068006100620065006E006B006F006E0074006F000A003200200047007500740068006100620065006E002D005600650072006600FC0067006200610072006B006500690074000A00330020004100750066006C006100640075006E006700200047007500740068006100620065006E002F005000610063006B002D0074006F002D0047006F000A00340020005000610063006B0020004D0061006E0061006700650072000A00370020005400610072006900660069006E0066006F000A0038002000480069006C00660065",72
[DEBUG] USSD query successful, answer received
[DEBUG] USSD response type: Further action required (1)
USSD session open, to cancel use "gsm-ussd -c".
[DEBUG] Encoding "72" says response is in UCS2-BE
Prepaid-Menü
1 Guthabenkonto
2 Guthaben-Verfügbarkeit
3 Aufladung Guthaben/Pack-to-Go
4 Pack Manager
7 Tarifinfo
8 Hilfe
[DEBUG] Shutting down
[DEBUG] END: Cleaning up
[DEBUG] END: Resetting serial interface
[DEBUG] Restore serial state
[DEBUG] END: Closing modem interface
[DEBUG] Removing lock file /var/lock/LCK..ttyUSB1
Comment 3 Guido Günther 2011-06-16 06:56:34 UTC
Hi Felix,

we can leave ppm aside until you test-ussd.py work. Could you try:

python test/ussd.py /org/freedesktop/ModemManager/Modems/2 '*101#'

and post the result? Could you also run modem-manager with --debug while doing that and attach that too? 

Judging from what ppm says we're using the wrong encoding.
Comment 4 Felix Möller 2011-06-16 07:09:09 UTC
Created attachment 190015 [details]
modem-manager --debug output

Hi, thanks for the fast response attached you find the debug output.

I executed the following:
$ python test/enable.py /org/freedesktop/ModemManager/Modems/0
$ python test/ussd.py /org/freedesktop/ModemManager/Modems/0 '*101#'
Traceback (most recent call last):
  • File "test/ussd.py", line 38 in <module>
    ret = modem.Initiate(arg)
  • File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 68 in __call__
    return self._proxy_method(*args, **keywords)
  • File "/usr/lib/python2.7/site-packages/dbus/proxies.py", line 140 in __call__
    **keywords)
  • File "/usr/lib/python2.7/site-packages/dbus/connection.py", line 630 in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

Comment 5 Guido Günther 2011-06-21 20:55:30 UTC
Created attachment 190391 [details] [review]
Test to check if skipping the encoding fixes the bug.

(In reply to comment #4)
> Created an attachment (id=190015) [details]
> modem-manager --debug output
> 
> Hi, thanks for the fast response attached you find the debug output.

Thanks, this seems to be the problem:

68323] [mm-at-serial-port.c:298] debug_log(): (ttyUSB2): --> 'AT+CUSD=1,"002A0031003000310023",15<CR>'
modem-manager[28778]: <debug> [1308207923.719596] [mm-at-serial-port.c:298] debug_log(): (ttyUSB2): <-- '<CR><LF>OK<CR><LF>'
modem-manager[28778]: <debug> [1308207924.866650] [mm-at-serial-port.c:298] debug_log(): (ttyUSB2): <-- '<CR><LF>+CME ERROR: 100<CR><LF>'
modem-manager[28778]: <debug> [1308207924.866825] [mm-serial-parsers.c:412] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error
modem-manager[28778]: <debug> [1308207924.866909] [mm-at-serial-port.c:298] debug_log(): (ttyUSB1): <-- '<CR><LF>+CME ERROR: 100<CR><LF>'
modem-manager[28778]: <debug> [1308207924.867010] [mm-serial-parsers.c:412] mm_serial_parser_v1_parse(): Got failure code 100: Unknown error

Could you try the hack attached to this bug on top of:

http://anonscm.debian.org/gitweb/?p=users/agx/ModemManager.git

and report back? If it works I think I know what's wrong.
Comment 6 Felix Möller 2011-06-21 22:04:13 UTC
Created attachment 190393 [details]
output with new patches

Hi,

thanks alot!! after applying:
Patch2: mm-HEAD20110621.patch (MM HEAD from upstream)
Patch3: mm-agx20110621.patch (Your modifications since last sync)
Patch4: mm-hack.patch (attached to last comment)

I get the attached output when running with --debug.

Furthermore, I have:
fm@thinkpad:~/software/ModemManager $ python test/ussd.py /org/freedesktop/ModemManager/Modems/0 '*101#'
Ihr Prepaid-Guthaben beträgt 0.00 EUR. Jetzt auch Ihr Guthaben aufladen: einfach *103*Aufladenummer# und die Hörertaste eingeben.

I can now check the balance with prepaid-manager-applet. Thanks you!!
Comment 7 Guido Günther 2011-06-22 18:49:07 UTC
Created attachment 190464 [details] [review]
Skip hex encoding in ZTE

Thanks a lot for testing. The attached patch should fix this without breaking other modems. It's also at:

    http://anonscm.debian.org/gitweb/?p=users/agx/ModemManager.git
Comment 8 Felix Möller 2011-06-23 21:30:39 UTC
I have tested the newest git tree and it seems to work fine. Thanks alot for all your work.

Hopefully this gets upstream soon.

Thank you!
Comment 9 Guido Günther 2011-06-26 13:05:28 UTC
Thanks a lot for retesting! Dan, any chance this and #638039 can be applied? You can pull from:

 git://anonscm.debian.org/users/agx/ModemManager.git