[huawei/option] NM 0.7: GSM connections won't work with PIN code protected modems - despite having supplied the correct PIN for the connection in nm-connection-editor

Bug #290177 reported by Motin
92
This bug affects 9 people
Affects Status Importance Assigned to Milestone
NetworkManager
Expired
High
Baltix
New
Undecided
Unassigned
network-manager (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

Binary package hint: network-manager

GSM connections won't work with PIN code protected modems - despite having supplied the correct PIN for the connection in nm-connection-editor.

The connection attempt fails almost immediately and reverts back to the disconnected state.

Workaround: Unlock the modem manually on boot by for instance (if your PIN code is 1234):
sudo sh -c 'echo "AT+CPIN=1234" > /dev/ttyUSB0'

Then the GSM modem can connect easily.

Revision history for this message
Oleksij Rempel (olerem) wrote :

i can confirm it. Same work around working for me too.

network-manager:
  Installiert: 0.7~~svn20081018t105859-0ubuntu1
  Kandidat: 0.7~~svn20081018t105859-0ubuntu1
  Versions-Tabelle:
 *** 0.7~~svn20081018t105859-0ubuntu1 0
        500 http://de.archive.ubuntu.com intrepid/main Packages
        100 /var/lib/dpkg/status

Revision history for this message
Eddi (eddi-depieri) wrote :

I've the same problem on https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/291333 bug.

But I had to edit /usr/share/hal/fdi/information/10freedesktop/10-modem.fdi to make NM see my dongle.

Revision history for this message
Eddi (eddi-depieri) wrote :

I confirm the problem too.

My device answer to ATZ E0 V1 X4 &C1 +FCLASS=0 with ok only after a entered a correct pin with AT+CPIN=1234

so i think the init sequence algorithm should be:
ATZ
if (modem answer ok, and defined(pin)) {
         AT+CPIN=$PIN
}

AT E0 V1 X4 &C1 +FCLASS=0

Revision history for this message
Alexander Sack (asac) wrote :

Rddi, could you please open a bug against hal-info so your changes against 10-modem.fdio can benefit everyone? Please give us that bug id too here so I can driver that from there.

Revision history for this message
Alexander Sack (asac) wrote :

Eddi, also please provide us with a serial log like described in: https://wiki.ubuntu.com/DebuggingNetworkManager#Serial Log (Mobile Broadband) .... two logs would be good: 1. connect failure; 2. connect success with your workaround.

Thanks!

Revision history for this message
Alexander Sack (asac) wrote :

need serial logs. and hal-info bug to get modem detected.

Changed in network-manager:
status: New → Incomplete
Revision history for this message
Martin Pitt (pitti) wrote :

Confirming the same issue with my Huawei E620. The first time I plug it in, it gives me the "new device detected blabla...", the wizard does not ask me for a PIN (just a tariff), and when I try to connect, n-m gets stuck in a loop with

Nov 3 09:52:34 tick NetworkManager: <debug> [1225702354.281839] nm_serial_device_open(): (ttyUSB1) opening de
vice...
Nov 3 09:52:34 tick NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) complete.
Nov 3 09:52:34 tick NetworkManager: <info> (ttyUSB1): GSM pin secret required
Nov 3 09:52:34 tick NetworkManager: <info> (ttyUSB1): device state change: 4 -> 6
Nov 3 09:52:34 tick NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) scheduled...
Nov 3 09:52:34 tick NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) started...
Nov 3 09:52:34 tick NetworkManager: <info> (ttyUSB1): device state change: 6 -> 4

When I manually add the PIN to the settings, I get

Nov 3 09:53:04 tick NetworkManager: <info> Activation (ttyUSB1) starting connection 'Vodafone (D2)'
Nov 3 09:53:04 tick NetworkManager: <info> (ttyUSB1): device state change: 3 -> 4
Nov 3 09:53:04 tick NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) scheduled...
Nov 3 09:53:04 tick NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) started...
Nov 3 09:53:04 tick NetworkManager: <debug> [1225702384.778216] nm_serial_device_open(): (ttyUSB1) opening device...
Nov 3 09:53:04 tick NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) complete.
Nov 3 09:53:04 tick NetworkManager: <WARN> check_pin_done(): PIN checking timed out
Nov 3 09:53:04 tick NetworkManager: <info> (ttyUSB1): device state change: 4 -> 9
Nov 3 09:53:04 tick NetworkManager: <debug> [1225702384.927114] nm_serial_device_close(): Closing device 'ttyUSB1'
Nov 3 09:53:04 tick NetworkManager: <info> Marking connection 'Vodafone (D2)' invalid.
Nov 3 09:53:04 tick NetworkManager: <info> Activation (ttyUSB1) failed.
Nov 3 09:53:04 tick NetworkManager: <info> (ttyUSB1): device state change: 9 -> 3
Nov 3 09:53:04 tick NetworkManager: <info> (ttyUSB1): deactivating device (reason: 0).

Revision history for this message
Martin Pitt (pitti) wrote :

This is the serial debug output. Note that I replaced my actual PIN number with "1234" in the log file.

Revision history for this message
Alexander Sack (asac) wrote :

for martin the patch from http://paste.ubuntu.com/66792/ helped. everyone else, could you please test whether this fixes the issue for you too?

Changed in network-manager:
importance: Undecided → High
status: Incomplete → Triaged
Revision history for this message
Alexander Sack (asac) wrote :

given that the patch worked for martin i tentatively start the SRU procedure on this bug.

Changed in network-manager:
importance: High → Undecided
importance: Undecided → High
importance: High → Medium
Revision history for this message
Motin (motin) wrote :
Download full text (6.8 KiB)

For me, network manager doesn't even seem to detect that a PIN secret is needed:

Nov 3 23:17:50 motin-xps NetworkManager: <info> Activation (ttyUSB1) starting connection '3'
Nov 3 23:17:50 motin-xps NetworkManager: <info> (ttyUSB1): device state change: 3 -> 4
Nov 3 23:17:50 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) scheduled...
Nov 3 23:17:50 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) started...
Nov 3 23:17:50 motin-xps NetworkManager: <debug> [1225750670.413341] nm_serial_device_open(): (ttyUSB1) opening device...
Nov 3 23:17:50 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) complete.
Nov 3 23:17:50 motin-xps NetworkManager: <WARN> init_done(): Modem initialization failed
Nov 3 23:17:50 motin-xps NetworkManager: <info> (ttyUSB1): device state change: 4 -> 9
Nov 3 23:17:50 motin-xps NetworkManager: <debug> [1225750670.568802] nm_serial_device_close(): Closing device 'ttyUSB1'
Nov 3 23:17:50 motin-xps NetworkManager: <info> Marking connection '3' invalid.
Nov 3 23:17:50 motin-xps NetworkManager: <info> Activation (ttyUSB1) failed.
Nov 3 23:17:50 motin-xps NetworkManager: <info> (ttyUSB1): device state change: 9 -> 3
Nov 3 23:17:50 motin-xps NetworkManager: <info> (ttyUSB1): deactivating device (reason: 0).
Nov 3 23:17:50 motin-xps NetworkManager: nm_system_device_flush_ip4_routes_with_iface: assertion `iface_idx >= 0' failed
Nov 3 23:17:50 motin-xps NetworkManager: nm_system_device_flush_ip4_addresses_with_iface: assertion `iface_idx >= 0' failed

After having started UMTSMon, which correctly asks and receives the PIN code, or running the AT+CPIN command against /dev/ttyUSB0, the following log is given after a success connection has been made:

Nov 3 23:20:33 motin-xps NetworkManager: <info> Activation (ttyUSB1) starting connection '3'
Nov 3 23:20:33 motin-xps NetworkManager: <info> (ttyUSB1): device state change: 3 -> 4
Nov 3 23:20:33 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) scheduled...
Nov 3 23:20:33 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) started...
Nov 3 23:20:33 motin-xps NetworkManager: <debug> [1225750833.637118] nm_serial_device_open(): (ttyUSB1) opening device...
Nov 3 23:20:33 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 1 of 5 (Device Prepare) complete.
Nov 3 23:20:33 motin-xps NetworkManager: <info> (ttyUSB1): powering up...
Nov 3 23:20:33 motin-xps NetworkManager: <info> Registered on Home network
Nov 3 23:20:34 motin-xps NetworkManager: <info> Associated with network: +COPS: 1,0,"3",2
Nov 3 23:20:34 motin-xps NetworkManager: <info> Connected, Woo!
Nov 3 23:20:34 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 2 of 5 (Device Configure) scheduled...
Nov 3 23:20:34 motin-xps NetworkManager: <info> Activation (ttyUSB1) Stage 2 of 5 (Device Configure) starting...
Nov 3 23:20:34 motin-xps NetworkManager: <info> (ttyUSB1): device state change: 4 -> 5
Nov 3 23:20:34 motin-xps NetworkManager: <info> Starting pppd connection
Nov...

Read more...

Revision history for this message
Motin (motin) wrote :

For me it bails out on the first ATZ command if no PIN has been supplied. Could we just switch the order at which ATZ and AT+CPIN is sent to the device?

Using 'option' driver with the following device btw: 413c:8138 Dell Computer Corp. Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard EAP-SIM Port

Here are the relevant log parts with serial debugging:

Before PIN has been entered by other means than nm:
NetworkManager: <debug> [1225751171.141391] nm_serial_device_open(): (ttyUSB0) opening device...
NetworkManager: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) complete.
NetworkManager: <debug> [1225751171.254873] nm_serial_debug(): Sending: 'ATZ E0 V1 X4 &C1 +FCLASS=0
'
NetworkManager: <debug> [1225751171.303039] nm_serial_debug(): Got: 'ATZ E0 V1 X4 &C1 +FCLASS=0

ERROR

'
NetworkManager: <WARN> init_done(): Modem initialization failed

After:
NetworkManager: <debug> [1225751314.430340] nm_serial_device_open(): (ttyUSB0) opening device...
NetworkManager: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) complete.
NetworkManager: <debug> [1225751314.544000] nm_serial_debug(): Sending: 'ATZ E0 V1 X4 &C1 +FCLASS=0
'
NetworkManager: <debug> [1225751314.583058] nm_serial_debug(): Got: 'ATZ E0 V1 X4 &C1 +FCLASS='
NetworkManager: <debug> [1225751314.583896] nm_serial_debug(): Got: 'ATZ E0 V1 X4 &C1 +FCLASS=0
'
NetworkManager: <debug> [1225751314.593872] nm_serial_debug(): Got: 'ATZ E0 V1 X4 &C1 +FCLASS=0

OK

'
NetworkManager: <debug> [1225751314.593968] nm_serial_debug(): Sending: 'AT+CPIN?
'
NetworkManager: <debug> [1225751314.603890] nm_serial_debug(): Got: '

+CPIN: READY

OK

'
NetworkManager: <info> (ttyUSB0): powering up...
NetworkManager: <debug> [1225751314.604016] nm_serial_debug(): Sending: 'AT+CFUN=1
'
NetworkManager: <debug> [1225751314.615876] nm_serial_debug(): Got: '

OK

'
NetworkManager: <debug> [1225751314.616030] nm_serial_debug(): Sending: 'AT+CREG?
'
NetworkManager: <debug> [1225751314.625881] nm_serial_debug(): Got: '

+CREG: 0,1

OK

'
NetworkManager: <info> Registered on Home network
NetworkManager: <debug> [1225751314.626162] nm_serial_debug(): Sending: 'AT+COPS?
'
NetworkManager: <debug> [1225751315.039947] nm_serial_debug(): Got: '

+COPS: 1,0,"3",2

OK

'
NetworkManager: <info> Associated with network: +COPS: 1,0,"3",2
NetworkManager: <debug> [1225751315.040504] nm_serial_debug(): Sending: 'AT+CGDCONT=1, "IP", "bredband.tre.se"
'
NetworkManager: <debug> [1225751315.120059] nm_serial_debug(): Got: '

OK

'
NetworkManager: <debug> [1225751315.120533] nm_serial_debug(): Sending: 'ATD*99***1#
'
NetworkManager: <debug> [1225751315.145053] nm_serial_debug(): Got: '

CONNECT HSDPA 3.6

'
NetworkManager: <info> Connected, Woo!

Revision history for this message
Alexander Sack (asac) wrote :

please dont post anything here without trying the patch. Thanks!!!!!

Revision history for this message
Motin (motin) wrote :

Sorry, Alexander, but as you can see from our serial debug logs, me and Martin are not experiencing the same problem, and I highly doubt that a patch to schedule_automatic_registration_again() would affect me, since I am not even coming that far.

Of course, I'll still try the patch - although I am a bit rusty at supplying patches to ubuntu packages. Is there a general Wiki page that describes this procedure?

I have btw upgraded to version 0.7~~svn20081018t105859-0ubuntu2~nm4 from the network manager intrepid ppa, and am still experiencing the same issue...

Revision history for this message
Eddi (eddi-depieri) wrote :
Revision history for this message
Eddi (eddi-depieri) wrote :

sorry for duble post... this is my log...

the success happened after:
gcom -d /dev/ttyUSB1

I haven't tested yet the supplied patch. But it shouldn't solve:

minicom

AT
OK
ATZ E0 V1 X4 &C1 +FCLASS=0
ERROR
ATZ E0
ERROR
AT V1
ERROR
AT X4
ERROR
AT &C1
ERROR
AT +FCLASS0
ERROR
ATZ
OK
AT+CPIN=1234
OK
+ZDONR: "TIM",222,1,"CS_ONLY","ROAM_OFF"

+ZPASR: "UMTS"

+ZUSIMR:2

+ZUSIMR:2

+ZDONR: "TIM",222,1,"CS_PS","ROAM_OFF"

+ZPASR: "UMTS"

+ZUSIMR:2

ATE0
OK
[ATE1]
OK
ATV1
OK
ATX4
OK
AT&C1
OK
AT+FCLASS=0
OK

Revision history for this message
Eddi (eddi-depieri) wrote :
Revision history for this message
Motin (motin) wrote :

@Eddi: I'd love to try your packages, but I'm running 32-bit... Mind to share how you built them after applying the patch (which I have done...)? Thanks!

@Martin: The bug you are experiencing seem not to be the same as the one that Eddi and I are experiencing. Could you please file a separate bug report on your issue?

Revision history for this message
Eddi (eddi-depieri) wrote :

I don't know how to build package for 32bit under 64 bit architecture... however you can build them yourself

terminal

# sudo apt-get build-dep network-manager
# mkdir src
# cd src
# apt-get source network-manager
# cd network-manager-0.7~~svn20081018t105859/
# cd src
# wget http://launchpadlibrarian.net/19430481/nm-gsm-device.c.patch
# patch <nm-gsm-device.c.patch
# cd ..
# sudo apt-get install fakeroot build-essential
# fakeroot debian/rules binary
#cd ..
# sudo su
# dpkg -i *.deb
# sudo /etc/init.d/NetworkManager restart

(this is one of the 1^n possibility to build package

Revision history for this message
Peter (piroco) wrote :

I'd really prefer not to build it myself, as I'm using NM on an Asus EEE with limited disk space. If this patch is solving the problem, when can it be incorporated in a new build/package that I can download through apt-get?

Revision history for this message
Eddi (eddi-depieri) wrote :

Alexander,

do you think my patch can be incorporated into your ppa tree?

Revision history for this message
HenrikAn (henrikan) wrote :

Eddi: The patch works fine on my 32 bit computer.

Revision history for this message
Eddi (eddi-depieri) wrote :

The problem now isn't with our dongle.
Other dongle that worked before, may stop working after my patch.

Revision history for this message
Motin (motin) wrote :

Can this patch be proposed to hardy-updates for testing? Or become available in a ppa so that more can test it out and see if it breaks other dongles?

Revision history for this message
Alexander Sack (asac) wrote :

ok. i moved martin's issue to bug 303142 "3G [Option] some modems take a while time to register on network (CREG) "

Revision history for this message
Alexander Sack (asac) wrote :

The patch is not good enough as it add tweaks for specific modems to code used for all modems. risk that other modems break is also there.

Unlikely we can fix that in intrepid, but once we have modemmanager in jaunty i can provide backports aka PPA builds for that. modemmanager allows to use modem specific tweaks, which is currently not easily possible with NM 0.7.

Revision history for this message
Eddi (eddi-depieri) wrote :

Alexander,

Please can you create a different PPA repository for people with this issue?

We will never know if this patch may stop working other modem if it won't be released.

Revision history for this message
gabriela (salvie) wrote :

I'm using an Asus EeePC 1000H and am trying to use my Option Icon 225 stick (got this by Orange Switzerland). I seem to encounter the same problems, but on a brand new installed and completely updated Jaunty Jackalope (9.04).

When I first connect the stick, some kind of wizard appears, which lets me choose my country (Switzerland) and my provider (Orange). After clicking "Apply" (I'm not sure about the English menus, buttons and dialogs) a message appears at the upper right corner. It tells me that I can start the connection by clicking on the network icon. I do this, select "Orange". After that I get a small dialog box asking for the PIN code, which I type in correctly. Everything looks great, but then it will not connect. There's a small black box at the upper right corner telling me: "GSM Network - you are now offline". It doesn't matter if I boot the EeePC with the stick connected or if I connect it afterwards.

I didn't try to apply the patch mentioned in this thread yet, because I'm using Jaunty and I'm not sure if things would be worse afterwards.

I attach a log file (syslog) of what's logged while connecting the stick and trying to get it work.

If you need other logs, just tell me how to get them. I'm not very experienced in this.

gabriela

Revision history for this message
Motin (motin) wrote :

Gabriela, Thank you for your comment, but according to your log, your modem uses the hso driver, while as this bug is for huawei/option based modems.

To get your issue reported, you will need to open a new bug report. For clarity's sake, please also include a serial log, as described in https://wiki.ubuntu.com/DebuggingNetworkManager#Serial%20Log%20(Mobile%20Broadband)

Thanks!

Revision history for this message
gabriela (salvie) wrote :

I just did so (see https://bugs.launchpad.net/bugs/368325).
Thank you for your advice.

gabriela

Revision history for this message
Jean-Louis Dupond (dupondje) wrote :
Download full text (6.8 KiB)

Hello.

I got a Huawei E620 and using Natty '11.04', and I still got this issue :(

modem-manager[5728]: <info> [1296952772.346647] [mm-serial-port.c:702] mm_serial_port_open(): (ttyUSB0) opening serial port...
modem-manager[5728]: <debug> [1296952772.349365] [mm-serial-port.c:764] mm_serial_port_open(): (ttyUSB0) device open count is 1 (open)
modem-manager[5728]: <debug> [1296952772.349644] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): --> 'AT+CPIN="1111"<CR>'
modem-manager[5728]: <debug> [1296952772.444560] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): <-- '<CR><LF>OK<CR><LF>'
modem-manager[5728]: <debug> [1296952772.444750] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): --> 'AT+CPIN?<CR>'
modem-manager[5728]: <debug> [1296952772.464425] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): <-- '<CR><LF>+CPIN: READY<CR><LF><CR><LF>OK<CR><LF>'
modem-manager[5728]: <info> [1296952772.464723] [mm-modem-base.c:299] mm_modem_base_set_unlock_required(): Modem /org/freedesktop/ModemManager/Modems/3: unlock no longer required
modem-manager[5728]: <info> [1296952772.464991] [mm-modem-base.c:338] mm_modem_base_set_unlock_retries(): Modem /org/freedesktop/ModemManager/Modems/3: # unlock retries is 0
modem-manager[5728]: <debug> [1296952772.465645] [mm-serial-port.c:798] mm_serial_port_close(): (ttyUSB0) device open count is 0 (close)
modem-manager[5728]: <info> [1296952772.465867] [mm-serial-port.c:811] mm_serial_port_close(): (ttyUSB0) closing serial port...
modem-manager[5728]: <info> [1296952772.467261] [mm-serial-port.c:834] mm_serial_port_close(): (ttyUSB0) serial port closed
modem-manager[5728]: <info> [1296952772.468592] [mm-serial-port.c:702] mm_serial_port_open(): (ttyUSB0) opening serial port...
modem-manager[5728]: <debug> [1296952772.471366] [mm-serial-port.c:764] mm_serial_port_open(): (ttyUSB0) device open count is 1 (open)
modem-manager[5728]: <info> [1296952772.471606] [mm-modem.c:761] mm_modem_set_state(): Modem /org/freedesktop/ModemManager/Modems/3: state changed (disabled -> enabling)
modem-manager[5728]: <debug> [1296952772.573247] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): --> 'ATZ E0 V1<CR>'
modem-manager[5728]: <debug> [1296952772.604424] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): <-- '<CR><LF>OK<CR><LF>'
modem-manager[5728]: <debug> [1296952772.604639] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): --> 'ATE0<CR>'
modem-manager[5728]: <debug> [1296952772.614445] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): <-- '<CR><LF>OK<CR><LF>'

As you can see it sends the PIN correctly, but it can't connect.

Feb 6 01:49:22 laptop-jl modem-manager[5728]: <debug> [1296953362.317720] [mm-generic-gsm.c:4250] simple_state_machine(): (ttyUSB0): simple connect state 0
Feb 6 01:49:22 laptop-jl modem-manager[5728]: <debug> [1296953362.317913] [mm-generic-gsm.c:4250] simple_state_machine(): (ttyUSB0): simple connect state 2
Feb 6 01:49:22 laptop-jl modem-manager[5728]: <debug> [1296953362.324422] [mm-at-serial-port.c:298] debug_log(): (ttyUSB0): <-- '<CR><LF>+CGREG: 2,2,00,0<CR><LF><CR><LF>OK<CR><LF>'
Feb 6 01:49:22 laptop-jl modem-manager[5728]: <debug> [1296953362.324669] [mm-generic-gsm.c:2352] mm_generic_gsm_set_...

Read more...

Changed in network-manager:
importance: Unknown → High
status: Unknown → New
tags: added: patch-needs-work
Revision history for this message
Jean-Louis Dupond (dupondje) wrote :

Seems like this affects all Sticks? Got the same issue with 2 3G usb sticks.

Revision history for this message
Mantas Kriaučiūnas (mantas) wrote :

ZTE MF628 3G modem doesn't connect from network-manager applet until I disable PIN code in SIM card.
Network manager applet doesn't ask PIN code at all :(

Revision history for this message
João Neves (jneves) wrote :

This only affect sticks where the stick won't respond to AT commands (identifying itself as a GSM modem) before a PIN has been supplied. In that case network-manager doesn't detect there is a GSM modem connected (modem-manager send AT commands to check if it is a GSM modem and doesn't get the answer it's expecting) and so, doesn't even try to set it up.

Changed in network-manager:
status: New → Incomplete
Changed in network-manager:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.