Bug 264083 - 3G connections not working at all when using knetworkmanager
Summary: 3G connections not working at all when using knetworkmanager
Status: RESOLVED FIXED
Alias: None
Product: Network Management
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Will Stephenson
URL:
Keywords:
: 209777 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-01-23 15:13 UTC by Marc Schiffbauer
Modified: 2011-05-01 03:50 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
nm-applet dialog (german) (38.95 KB, image/png)
2011-03-13 22:59 UTC, Marc Schiffbauer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Schiffbauer 2011-01-23 15:13:18 UTC
Version:           unspecified (using Devel) 
OS:                Linux

I have a 3G/UMTS USB-Stick (ID 12d1:1003 Huawei Technologies Co., Ltd. E220 HSDPA Modem / E230/E270 HSDPA/HSUPA Modem) which is working perfectly when using nm-applet as Network Manager client.

With knetworkmanager its not working at all.

knetworkmanager discovers the device and shows my configured T-Mobile connection. But when clicking it to start connection the entry just disaappears after some seconds and reappears after another few seconds but with no connections attempts made instead of asking for the PIN.

With nm-applet I click the connection, then it asks me for the PIN, the dials the connection successfully.

(A bit strange is that I entered the PIN in both configured connections, nm-applet and knetworkmanager, but it seems that it will not get used, but nm-applet then asks for it while knetworkmanager does not and just fails.)


Reproducible: Always
Comment 1 Lamarque V. Souza 2011-01-24 20:27:39 UTC
PIN unlock is not implemented in Plasma NM yet.
Comment 2 Marc Schiffbauer 2011-02-14 02:14:10 UTC
It used to work months ago. So it is a regression.
Comment 3 Lamarque V. Souza 2011-02-24 02:41:00 UTC
What I meant is that Plasma NM will not ask for the PIN on demand, though after running Mobile Connection Wizard you can add the PIN number in the connection's configuration. This is the old way of configuring mobile connections, so it should also work with all knetworkmanager/Plasma NM versions.

The information will be sent to NetworkManager which will re-route it to ModemManager and everything should work. In fact, it works with my modem (a Sony MD300), except for one detail: my modem is too slow to startup and the NetworkManager timeout (10 seconds) is too short. I had to increase it to 30s to make it really work here. The timeout is hardcoded in NM source code, so to change it you will have to recompile NetworkManager.

NM needs to "enable" the modem before dialing, which includes starting the modem up and asking for the PIN. nm-applet can continues the startup process while the user is typing the PIN, which gives it more time to startup before sending the PIN to the modem. Unfortunately, Plasma NM send the pin right after initiating the startup process, which makes NM's 10 second timeout to... time out.

The best solution to this problem is increasing the NM timeout, which in my opinion  is a good thing since 10s is really short for most modems I have tested to startup.
Comment 4 Marc Schiffbauer 2011-02-25 13:53:09 UTC
(In reply to comment #3)

Thanks for your comment.

What is the problem with asking for a PIN? Is this a planned feature?

What is a bit strange here in my setup is: I have a PIN in the connection setting, but it does not seem to be used by either nm-applet nor knm.

But nm-applet then asks for the PIN while knm does not. So my only option right now is to always disable/stop NM handling in kde systemsettings and then start nm-applet whenever I need to use my 3G connection.

What about the plans to merge nm-applet and knm connection setting store?
Comment 5 Lamarque V. Souza 2011-02-25 18:13:08 UTC
Yesterday I noticed that Plasma NM already ask for the PIN when needed and records it in a kwallet. So you should not have this problem as long as you increase the NetworkManager timeout as I said.

I am not aware of any plan to merge nm-applet and Plasma NM configuration settings.

Please send the /var/log/messages file, that file contains the NetworkManager logs. That file tends to be very big (mine is 41 MB large), so please remove the lines before your connection attempt to make it smaller. By the way, are you using the latest Plasma NM git version (knetworkmanager-9999 in Gentoo)?
Comment 6 Marc Schiffbauer 2011-03-13 22:56:07 UTC
(In reply to comment #5)
> Yesterday I noticed that Plasma NM already ask for the PIN when needed and
> records it in a kwallet. So you should not have this problem as long as you
> increase the NetworkManager timeout as I said.

I am not convinced that this is a NM timeout issue because if it was nm-applet must not work too, but it does perfectly!

I just tried with the current knetworkmanager (git pulled few minutes ago)

If I delete the PIN and PUK from the connection it indeed asks me for the PIN with the same dialog from the settings where I can enter PIN and PUK and so on. But it just tells me "Connection failed" withi some knotify message after I entered the corerct PIN.

This is the log:
2011-03-13T22:26:42.015041+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): new GSM device (driver: 'option1' ifindex: -1)
2011-03-13T22:26:42.015078+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): exported as /org/freedesktop/NetworkManager/Devices/10
2011-03-13T22:26:42.015089+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): now managed
2011-03-13T22:26:42.015109+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 1 -> 2 (reason 2)
2011-03-13T22:26:42.017281+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): deactivating device (reason: 2).
2011-03-13T22:26:42.019707+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 2 -> 3 (reason 0)
2011-03-13T22:26:48.408577+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) starting connection 'T-Mobile (D1)'
2011-03-13T22:26:48.408597+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 3 -> 4 (reason 0)
2011-03-13T22:26:48.408604+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) scheduled...
2011-03-13T22:26:48.408611+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) started...
2011-03-13T22:26:48.408618+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 4 -> 6 (reason 0)
2011-03-13T22:26:48.408624+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) complete.
2011-03-13T22:26:48.539002+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) scheduled...
2011-03-13T22:26:48.539022+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) started...
2011-03-13T22:26:48.539029+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 6 -> 4 (reason 0)
2011-03-13T22:26:48.539035+01:00 bart NetworkManager[7046]: <info> Activation (ttyUSB0) Stage 1 of 5 (Device Prepare) complete.
2011-03-13T22:26:48.540354+01:00 bart NetworkManager[7046]: <warn> GSM modem enable failed: (32) SIM PIN required
2011-03-13T22:26:51.766854+01:00 bart NetworkManager[7046]: <info> WWAN now enabled by radio killswitch
2011-03-13T22:26:53.552553+01:00 bart kernel: option: option_instat_callback: error -84
2011-03-13T22:26:53.936585+01:00 bart kernel: option: option_instat_callback: error -84
2011-03-13T22:26:54.030234+01:00 bart NetworkManager[7046]: <warn> GSM connection failed: (32) Serial port is now closed
2011-03-13T22:26:54.030264+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 4 -> 9 (reason 1)
2011-03-13T22:26:54.030274+01:00 bart NetworkManager[7046]: <info> Marking connection 'T-Mobile (D1)' invalid.
2011-03-13T22:26:54.030278+01:00 bart kernel: option: option_instat_callback: error -108
2011-03-13T22:26:54.030284+01:00 bart NetworkManager[7046]: <warn> Activation (ttyUSB0) failed.
2011-03-13T22:26:54.030294+01:00 bart kernel: option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
2011-03-13T22:26:54.030297+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 9 -> 3 (reason 0)
2011-03-13T22:26:54.030301+01:00 bart kernel: option 5-2:1.0: device disconnected
2011-03-13T22:26:54.030307+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): deactivating device (reason: 0).
2011-03-13T22:26:54.030308+01:00 bart kernel: option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
2011-03-13T22:26:54.030313+01:00 bart kernel: option 5-2:1.1: device disconnected
2011-03-13T22:26:54.039001+01:00 bart NetworkManager[7046]: <info> Policy set 'Ostel' (wlan0) as default for IPv4 routing and DNS.
2011-03-13T22:26:54.039018+01:00 bart NetworkManager[7046]: <info> Policy set 'Ostel' (wlan0) as default for IPv4 routing and DNS.
2011-03-13T22:26:54.039024+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): now unmanaged


So currect status: Still not working but still working when using nm-applet.

Now the interesting part:

I noticed some really different behavior when using nm-applet: Although it has the PIN configured in its settings it will always ask me for the PIN to unlock the *device* and only after that it will start blinking blue (which means it can reach a 3G network).

Then when I start the connection, it needs access to the gnome-keyring to get the PIN from there to which is required to initiate the connection.

So it seems nm-applet is doing an important and required step that knetworkmanager does not do: Unlocking the device somehow.

This is the log when I use nm-applet to unlock the device and successfully connect to the 3G network.

2011-03-13T22:44:41.014403+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): new GSM device (driver: 'option1' ifindex: -1)
2011-03-13T22:44:41.014750+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): exported as /org/freedesktop/NetworkManager/Devices/16
2011-03-13T22:44:41.014771+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): now managed
2011-03-13T22:44:41.014823+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 1 -> 2 (reason 2)
2011-03-13T22:44:41.018024+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): deactivating device (reason: 2).
2011-03-13T22:44:41.024779+01:00 bart NetworkManager[7046]: <info> (ttyUSB0): device state change: 2 -> 3 (reason 0)

--> NOW the dialog as shown in the attached screenshot appears asking for the PIN to unlock the device. I enter the correct pin. Before hitting enter I write this text, so its longer than the 10 seconds timeout...

Enter!

2011-03-13T22:46:21.700393+01:00 bart modem-manager[7085]: <info> (ttyUSB0) opening serial port...
2011-03-13T22:46:21.797813+01:00 bart modem-manager[7085]: <info> Modem /org/freedesktop/ModemManager/Modems/14: unlock no longer required
2011-03-13T22:46:21.797836+01:00 bart modem-manager[7085]: <info> Modem /org/freedesktop/ModemManager/Modems/14: # unlock retries is 0
2011-03-13T22:46:21.797843+01:00 bart modem-manager[7085]: <info> (ttyUSB0) closing serial port...
2011-03-13T22:46:21.802511+01:00 bart modem-manager[7085]: <info> (ttyUSB0) serial port closed

Now the device in unlocked and starts blinking blue (green before).
Now its possible to connect using nm-applet.

I did another test now: Before actualliy starting the connection I killed nm-applet again and started the connection using knetworkmanager which now also workes fine!

So its definitly that knetworkmanager is missing something with correct device handling here: It does NOT do the device unlocking.

-Marc
Comment 7 Marc Schiffbauer 2011-03-13 22:59:43 UTC
Created attachment 57940 [details]
nm-applet dialog (german)

Please tell me if you need this translated...
Comment 8 Lamarque V. Souza 2011-05-01 03:07:16 UTC
Git commit 835c65da3ac5ee01fa2b5cf2387e2650440a4b89 by Lamarque V. Souza.
Committed on 01/05/2011 at 03:01.
Pushed by lvsouza into branch 'master'.

Try to unlock (PIN/PUK) and enable modem before connecting to Gsm
connections.

BUG: 264083

M  +20   -0    backends/NetworkManager/nmdbussettingsservice.cpp     
M  +2    -0    libs/internals/CMakeLists.txt     
M  +7    -0    libs/service/CMakeLists.txt     
M  +97   -1    libs/service/networkinterfacemonitor.cpp     
M  +11   -0    libs/service/networkinterfacemonitor.h     
A  +110  -0    libs/service/pindialog.cpp         [License: GPL]
A  +58   -0    libs/service/pindialog.h         [License: GPL]
A  +201  -0    libs/service/pinwidget.ui         [License: UNKNOWN]  *

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/networkmanagement/835c65da3ac5ee01fa2b5cf2387e2650440a4b89
Comment 9 Lamarque V. Souza 2011-05-01 03:07:17 UTC
Git commit c4da8232cb2b635b6b08e88e4a4092d490322cbc by Lamarque V. Souza.
Committed on 01/05/2011 at 02:47.
Pushed by lvsouza into branch 'nm09'.

Do not save PIN in wallet or configuration file. PIN is now one-time
only.

CCBUG: 264083

M  +4    -0    libs/internals/connectionpersistence.cpp     
M  +6    -4    libs/internals/settings/gsmpersistence.cpp     

http://commits.kde.org/networkmanagement/c4da8232cb2b635b6b08e88e4a4092d490322cbc
Comment 10 Lamarque V. Souza 2011-05-01 03:07:17 UTC
Git commit aabca85cce31ce40114c62a783fd7480383ae03e by Lamarque V. Souza.
Committed on 01/05/2011 at 02:47.
Pushed by lvsouza into branch 'master'.

Do not save PIN in wallet or configuration file. PIN is now one-time
only.

CCBUG: 264083

M  +4    -0    libs/internals/connectionpersistence.cpp     
M  +4    -2    libs/internals/settings/gsmpersistence.cpp     

http://commits.kde.org/networkmanagement/aabca85cce31ce40114c62a783fd7480383ae03e
Comment 11 Lamarque V. Souza 2011-05-01 03:07:17 UTC
Git commit 20034f7c11808c99aeab3c6c48a886f833b0d930 by Lamarque V. Souza.
Committed on 01/05/2011 at 03:01.
Pushed by lvsouza into branch 'nm09'.

Try to unlock (PIN/PUK) and enable modem before connecting to Gsm
connections. Also fix compilation against NM-0.9.

BUG: 264083

M  +2    -3    applet/interfacedetailswidget.cpp     
M  +3    -1    applet/interfacedetailswidget.h     
M  +20   -0    backends/NetworkManager/nmdbussettingsservice.cpp     
M  +2    -0    libs/internals/CMakeLists.txt     
M  +7    -0    libs/service/CMakeLists.txt     
M  +97   -1    libs/service/networkinterfacemonitor.cpp     
M  +11   -0    libs/service/networkinterfacemonitor.h     
A  +110  -0    libs/service/pindialog.cpp         [License: GPL]
A  +58   -0    libs/service/pindialog.h         [License: GPL]
A  +201  -0    libs/service/pinwidget.ui         [License: UNKNOWN]  *

The files marked with a * at the end have a non valid license. Please read: http://techbase.kde.org/Policies/Licensing_Policy and use the headers which are listed at that page.


http://commits.kde.org/networkmanagement/20034f7c11808c99aeab3c6c48a886f833b0d930
Comment 12 Lamarque V. Souza 2011-05-01 03:23:38 UTC
*** Bug 209777 has been marked as a duplicate of this bug. ***
Comment 13 Lamarque V. Souza 2011-05-01 03:50:44 UTC
Git commit 2e4aa92e4ae9b6c505c375e520b3fce20a01613a by Lamarque V. Souza.
Committed on 01/05/2011 at 03:48.
Pushed by lvsouza into branch 'nm09'.

Fix typo.

CCBUG: 264083
(cherry picked from commit 069db464fddd1e7b1d0187e5a8e03b2d216cc318)

M  +2    -2    libs/service/networkinterfacemonitor.cpp     

http://commits.kde.org/networkmanagement/2e4aa92e4ae9b6c505c375e520b3fce20a01613a
Comment 14 Lamarque V. Souza 2011-05-01 03:50:44 UTC
Git commit 069db464fddd1e7b1d0187e5a8e03b2d216cc318 by Lamarque V. Souza.
Committed on 01/05/2011 at 03:48.
Pushed by lvsouza into branch 'master'.

Fix typo.

CCBUG: 264083

M  +2    -2    libs/service/networkinterfacemonitor.cpp     

http://commits.kde.org/networkmanagement/069db464fddd1e7b1d0187e5a8e03b2d216cc318