GNOME Bugzilla – Bug 652682
Cannot get prepaid-manager-applet to work with ZTE stick
Last modified: 2011-07-22 14:29:00 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):
+ Trace 227490
ret = modem.Initiate(arg)
return self._proxy_method(*args, **keywords)
**keywords)
message, timeout)
$ 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.
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
[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
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.
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):
+ Trace 227492
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.
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!!
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
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!
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
This has been fixed in git: http://cgit.freedesktop.org/ModemManager/ModemManager/commit/?id=a57618b091faec24d22bfce5f384248c52cd2511