Comment 0 for bug 479343

Binary package hint: modemmanager

There are quite a few glitches with this modem (I am speaking about X060, which is the one I own, but I believe X200 behaves pretty much the same, since they both have the same PCI vendor/product IDs):

1. Sometimes the modem doesn't show up in the nm applet. Here is the log when it does NOT show up:

** Message: Loaded plugin Novatel
** Message: Loaded plugin Sierra
** Message: Loaded plugin Gobi
** Message: Loaded plugin MotoC
** Message: Loaded plugin Option High-Speed
** Message: Loaded plugin Option
** Message: Loaded plugin Huawei
** Message: Loaded plugin ZTE
** Message: Loaded plugin Ericsson MBM
** Message: Loaded plugin Nokia
** Message: Loaded plugin Generic
** Message: (ttyUSB1) opening serial device...
** (modem-manager:17218): DEBUG: (ttyUSB1): probe requested by plugin 'Generic'
** Message: (ttyUSB0) opening serial device...
** (modem-manager:17218): DEBUG: (ttyUSB0): probe requested by plugin 'Generic'
** Message: (ttyUSB2) opening serial device...
** (modem-manager:17218): DEBUG: (ttyUSB2): probe requested by plugin 'Generic'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB0): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB0): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB0): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'ATI<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'ATI<CR><CR><LF>Manufacturer: TCT Mobile International Limited<CR><LF>Model: HSPA Data Card<CR><LF>Revision: C1111000<CR><LF>IMEI: 352079030166324<CR><LF>+GCAP: +CGSM,+FCLASS,+DS<CR><LF><CR><LF>OK<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** Message: (ttyUSB1) closing serial device...
** Message: (Generic): GSM modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4 claimed port ttyUSB1
** (modem-manager:17218): DEBUG: Added modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4
** (modem-manager:17218): DEBUG: Exported modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4 as /org/freedesktop/ModemManager/Modems/0
** Message: (ttyUSB0) closing serial device...
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'ATI<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'ATI<CR><CR><LF>Manufacturer: TCT Mobile International Limited<CR><LF>Model: HSPA Data Card<CR><LF>Revision: C1111000<CR><LF>IMEI: 352079030166324<CR><LF>+GCAP: +CGSM,+FCLASS,+DS<CR><LF><CR><LF>OK<CR><LF>'
** Message: (ttyUSB2) closing serial device...
** Message: (Generic): GSM modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4 claimed port ttyUSB2

-----------------------------------------------------------------

2. Sometimes the modem DOES show up, but it takes quite a long time, which is mostly spent after every unsuccessful AT+GCAP, until the successful ATI is issued. Here is the log when the modem is detected correctly and appears in nm-applet:

** (modem-manager:17218): DEBUG: Removed modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4
** Message: (ttyUSB0) opening serial device...
** (modem-manager:17218): DEBUG: (ttyUSB0): probe requested by plugin 'Generic'
** Message: (ttyUSB1) opening serial device...
** (modem-manager:17218): DEBUG: (ttyUSB1): probe requested by plugin 'Generic'
** Message: (ttyUSB2) opening serial device...
** (modem-manager:17218): DEBUG: (ttyUSB2): probe requested by plugin 'Generic'
** (modem-manager:17218): DEBUG: (ttyUSB0): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB0): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB0): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'AT+GCAP<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'AT+GCAP<CR><CR><LF>+CME ERROR: SIM not inserted<CR><LF>'
** Message: (ttyUSB0) closing serial device...
** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'ATI<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB2): --> 'ATI<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'ATI<CR><CR><LF>Manufacturer: TCT Mobile International Limited<CR><LF>Model: HSPA Data Card<CR><LF>Revision: C1111000<CR><LF>IMEI: 352079030166324<CR><LF>+GCAP: +CGSM,+FCLASS,+DS<CR><LF><CR><LF>OK<CR><LF>'
** (modem-manager:17218): DEBUG: (ttyUSB2): <-- 'ATI<CR><CR><LF>Manufacturer: TCT Mobile International Limited<CR><LF>Model: HSPA Data Card<CR><LF>Revision: C1111000<CR><LF>IMEI: 352079030166324<CR><LF>+GCAP: +CGSM,+FCLASS,+DS<CR><LF><CR><LF>OK<CR><LF>'
** Message: (ttyUSB1) closing serial device...
** Message: (ttyUSB2) closing serial device...
** Message: (Generic): GSM modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4 claimed port ttyUSB1
** (modem-manager:17218): DEBUG: Added modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4
** (modem-manager:17218): DEBUG: Exported modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4 as /org/freedesktop/ModemManager/Modems/1
** Message: (Generic): GSM modem /sys/devices/pci0000:00/0000:00:1d.7/usb1/1-4 claimed port ttyUSB2

-----------------------------------------------------------------

3. Even though the modem appears in the nm-applet, the connection fails. Looking at the log below, it looks like ATZ E0 V1 X4 &C1 +CMEE=1 command returns an error. I've tried these commands separately from minicom and it appears like ATX4 and AT&C1 won't work unless an AT+CPIN="xxxx" is issued first. Here is the log.

** (modem-manager:17218): DEBUG: (ttyUSB1): --> 'ATZ E0 V1 X4 &C1 +CMEE=1<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- 'ATZ E0 V1 X4 &C1 +CMEE=1<CR>'
** (modem-manager:17218): DEBUG: (ttyUSB1): <-- '<CR><LF>ERROR<CR><LF>'
** (modem-manager:17218): DEBUG: Got failure code 100: Unknown error
** Message: (ttyUSB1) closing serial device...

-----------------------------------------------------------------

4. Ok, I issued AT+CPIN="xxxx" from minicom, the init AT command works and I'm moving on to the next problem. It appears that this modem exposes 3 usb interfaces through the option driver: 0, 1 and 3. 0 is usually mapped to ttyUSB0, and it does not respont to AT commands, so who knows what's good for. USBIF 1 and 3 are usually mapped to ttyUSB1 and ttyUSB2 respectively, but in my experience, only USBIF 3 works. I reported this a few months ago in #392869. I am submitting a patch along this report that applies cleanly on the current version of modemmanager (0.2.git.20091014t233208.16f3e00-0ubuntu1) and fixes the issue. Note that both ttyUSB1 and ttyUSB2 will take AT commands and try to connect and everything, but only ttyUSB2 will work correctly, so my patch consists of basically ignoring the useless interfaces when probing the device.

Phew, hope this helps.