Search This Blog

Monday, July 4, 2011

Plasma NM: bugs fixed after 4.6.4


Following my last post about bugs fixed in Plasma NM, here is the list of bugs fixed between 4.6.4 release date (June 10th) and 4.6.5 release date (July 5th):


269951: Save username from VPN configuration instead of defaulting to system's user name.
. Correctly initialize the Wireless80211WidgetBand spinbox.
. Use correct method to enable mobile broadband modems, this one works with non-root users.
273762: Fill in Wireless80211Widget and WirelessSecuritySettingWidget with access point info when selecting one in ScanWidget.
269250: Makes kded module starts to emit notifications only after the plasmoid has been created.


And for nm09 branch:

. Send an error DBus reply to NM if secrets retrieval fails.
226028: Add OpenConnect VPN plugin.
276631: Fix crash while configuring wifi.
. Do not insert empty usernames in VPN settings, which would invalidate the connection.
269951: Change Nm08 connection importer to read the "UserName" setting. The VPN connection's configuration must be set to use this setting or NM will refuse the connection.
276189: Fix crash.
. Add Plasma NM version in kcm window.
. Use correct method to enable mobile broadband modems, this one works with non-root users.
. Update strongswan plugin for strongswan 1.2, add key direction to openvpn.
. Add missing hashing algorithms to openVPN.
. Add missing openVPN options.
. Allow band and channel selection for infrastructure networks, add automatic options for band and channel.
. Fix/update VPN NAT mode traversal.
273762: Fill in Wireless80211Widget and WirelessSecuritySettingWidget with access point info when selecting one in ScanWidget.
149030: move secrets from one storage to another if the storage type is changed and delete secrets in old storage.
269250: Makes kded module starts to emit notifications only after the plasmoid has been created.
. Let user decide if he/she wants to store GSM PIN or type it in every time. The default is not save the PIN.
. Fix reparsing configuration when secretstorage is called.
. Make VPN connections work.

Some observations about nm09 branch: 

Friday, June 3, 2011

Plasma NM: NM-0.9 (status)

After answering a comment in bugs.kde.org I thought it would be usefull to make the text below more visible to everybody. Plasma NM version numbers are confusing users in this transition between NM-0.8.x and NM-0.9 so let me try to explain some things:

Today there are four Plasma NM versions:

1. Plasma NM for NM-0.8: this one have been in version 0.9 for several years now (even before NM-0.9 was announced), it is supported by us (Plasma NM developers) and is the Plasma NM version shipped by almost all distributions, usually with version 0.9 in its package version although it does *not* work with NM-0.9.

Plasma NM uses Solid's NetworkManager backend to talk to NetworkManager. The directory /usr/src/debug/kdebase-workspace-4.6.3/x86_64-redhat-linux-gnu/solid/networkmanager-0.7/ mentioned in the crash log in the bug entry is the Solid's backend, which is *not* part of Plasma NM source code. In despite of the 0.7 version number the Solid's backend works with both NM-0.7 and NM-0.8. I know, that is confusing already, but there is more...

2. Fedora's own solution to make Plasma NM (for *NM-0.8*) work with *NM-0.9*: this is an in house solution developed by Fedora to make #1 work with NM-0.9. This is the package the bug's reporter uses and it is not supported by us. Fedora guys created that solution because their release schedule did not allow them to wait for us (Plasma NM developers) to create an official solution and they had to ship NM-0.9 because gnome-shell's network management applet requires it. This version is a temporary solution and is going to be phased out when our official solution is ready.

So basicaly the bug's reporter's Plasma NM version 0.9, created to work with NetworkManager 0.8 and Solid's 0.7 backend, has been modified by Fedora guys to talk to NetworkManager 0.9 :-) That is confusing.

3. Plasma NM/branch nm09: this is our intermediate implementation for NM-0.9. Of course it is supported by us. As far as I know Fedora and Arch Linux are the only distributions that ship this version. Fedora 15 includes this one in kde-unstable repository and is the version they ship in Rawhide, the development branch of the next Fedora release.

Solid's 0.9 backend is included in Plasma NM/nm09 branch, so everything here is 0.9: Plasma NM version 0.9, created to work with NetworkManager 0.9 and Solid's 0.9 backend, talks to NetworkManager 0.9 :-) When everybody stops using NM-0.8 things are going to go back to normal, I hope.

4. Plasma NM/branch libnm-qt: this is going to be our official implemenation for NM-0.9. Of course this one is also supported by us, it is not ready yet, I have never tested it myself, and probably no distribution ships it. libnm-qt (version 0.9 I hope) is the replacement for Solid's NM backed 0.9 and simplifies the source code for us developers. There is no user visible differences between #3 and #4 since only the backend is different, the user interface is the same.

The last two are in development stage. I use #3 in my notebook with almost no problems. I just need to clean up the source code and fix one problem with system VPN connections (user VPN connections work). There is also some TODO's in #3 but most people probably do not need them yet and they can be implemented without disturbing users like we have been doing in master branch.

Some people asked me what version they should use. Well, #1 is the only one that works with NM-0.8 so there is no choice here. For NM-0.9 use #3, like me, since #4 is not ready yet. But there is a catch: #3 does not migrate NM-0.8 configuration to NM-0.9 format yet, so you will have to recreate all your connections, that is also the reason Fedora makes it available in kde-unstable instead of kde-testing repository. Since only Fedora ships #2, I think Fedora users should use #2 because there is no settings migration to be done like in #3 and #4. There is no migration between #3 to #4, they use the same configuration files.

I hope this explains the version number mess in Plasma NM. So basically NM-0.9 is our opportunity to make everything use the same version number.

Update: I have implemented in #3 the code to import the Plasma NM's configuration files used in #1 (NM-0.8), just do:

qdbus org.kde.networkmanagement /org/kde/networkmanagement org.kde.networkmanagement.ImportNm08Connections

The qdbus call above is one shot, you will have to restart kded4 to be able to trigger it again. The old configuration files are not deleted so that you can import the connections again, but if you delete the connection using Plasma NM's connection editor the secrets in kwallet will be deleted forever.

When the importer is well tested I am going to change the code to delete the old configuration files.

Update: importer is enabled by default now but old configuration files will not be deleted because of those two nasty bugs. NetworkManager calls our secret agent to save the wrong password, I do not know why that is happening. Last weekd I send an e-mail to NM mailing list asking for help but nobody has answered it yet.

Tuesday, May 31, 2011

Plasma NM: bugs fixed after 4.6.3

Well, the number of crashes is decreasing, that is a good signal :-)

Following my last post about bugs fixed in Plasma NM, here is the list of bugs fixed between 4.6.3 release date (May 6th) and 4.6.4 release date (June 10th):

. Fix NM version number check.
. Always shows the "Create connection" button in the interface added notification for modem interfaces. Until now it was only shown when there was no modem connection.
275163: Fix changing adapter display type disables networking system
275159: Disables "Show More" button instead of hidding it if there is no wireless interface available.
275160: Defaults to wired tab in ManageConnectionWidgets if wireless is disabled.
274702 275161:  Try to prevent opening kwallet when there is no secret to retrieve.
274797: Set right widget's width to fixed size to prevent unneeded graphical layout resizes.
146159 182984: Import VPN connections from configuration files. Only VPNC is implemented so far, but the hooks for other VPN types are in place now.
. Fix initial default route icon's state when starting kded module and a connection is already active.
274860: Change networkmanagement_shell into a singleton to prevent calling the edit connection dialog multiple times.
274859: Disable "Low signal strength" notification by default and increase the interval between "Low signal strenght" notifications to 5 minutes.
274846:  Backport fix for disconnecting auto-connect connections when compiled against Solid < 4.7.0.
. Fix some issues when entering wireless channel manually instead of using the spinbox buttons.
. Add text in main window to warn when using Plasma NM with wrong NM version.
274161: Prevents crash when configuring 3G modem.
273894: Prevent crashes when closing kcmshell too fast after closing the connection editor.
. Fix two crashes when editing IPv4 config.
273955: Prevents dangling pointer crash.
266268: Try to adjust plasmoid size automatically.
273265: Fix crash on editing connections in KCM module.
. Update main CMakeLists.txt file to indicate that now we need at least NetworkManager-0.8.1. That is because of the IPv6 implementation, which first appeared in 0.8.1.
. Fix UUID check for DUN and NAP services in networkmanagement_configshell which prevented adding new Bluetooth connections.
272942: Change the automatic launching of Mobile Connection Wizard into a notification.
157384: Allow automatically set connection's BSSID to the BSSID of the AP selected in scanwidget.
272841: Fix crash when clicking on the VPN interface.
254155: Prevent graphical artifact during tab transition in m_interfaceDetailsWidget.
228298: Show correct WEP key type (Passphrase/Hex) when editing/showing connection secrets.
272774: Wrap interface label in InterfaceItem class, now only the first line is displayed.
. Several memory leak fixes.

Sunday, May 15, 2011

Plasma NM: NM-0.9 (WORKING)

Hi all, as I said in another post I have spent last Saturday (May 14th) and Sunday (May 15th) trying to improve NetworkManager-0.9 support in Plasma NM. The situation before May 14th was a follow: networkmanagement/master compiles/works with NM-0.8.1 and above. Branch networkmanagement/nm09 compiles against NM-0.8.x but needs several hacks to work with NM-0.9. Plasma NM uses Solid's NetworkManager and ModemManager backends from kde-workspace repository. Since 4.6.0 the NetworkManager backend uses the ModemManager backend for Bluetooth/Gsm network interfaces.

I have heard of two other attempts to bring/improve NM-0.9 support to Plasma NM. The first one is from Fedora guys and even them admit that it is not ideal. The other is from Will Stephenson, the Plasma NM maintainer and who most people here already know, including me, hi Will :-). Well, I do not know how much time Will's libnm-qt is going to take to be ready to be used in Plasma NM so I am doing what I proposed last month:

  1. Create the new Solid's NM-0.9 backend outside kde-workspace repository so that we could change it freely without KDE's freature freeze/ABI restrictions. (DONE)
  2. Make it compile against NM-0.8.999. (DONE)
  3. Remove #ifdef COMPILE_MODEM_MANAGER_SUPPORT and #ifdef NM_0_8 from the source code. (DONE)
  4. Make everything compile/work when the old NM-0.7 backend from KDE SC 4.{6,7} is installed. (DONE)
  5. Create code to import existing NM-0.8 connections to NM-0.9. (DONE)
  6. Make it really work with NM0-0.8.999. (DONE)
  7. Convert code to use libnm-qt instead of Solid::Control::*Nm09. (DONE)
  8. Improve support for Pppoe (Pots in NM-0.9 terminology), Cdma and IPv6. (TO BE DONE)
  9. Implement the new interface types: LTE, Wimax and OlpcMesh. (TO BE DONE)
Item #3 means Plasma NM requires at least KDE SC 4.6.0 to compile now. Item #4 means I can connect to my VPNC, ethernet, WPA wifi and 3G/Gsm connections, probably bluetooth is also working since it is very similar to 3G/Gsm, but I have not tested it. Item #6 depends on NetworkManager guys since Pppoe support is still in progress there. Item #7 may take a long time since I do not have any of those equipaments to do tests, the same is true for Cdma and IPv6.

Update: VPN works now after Ilia Kats implemented the secrets agent from NM-0.9 specification, Lukáš Tinkl changed the DBus types used to (de)marshall objects in QtDBus, and I created the SecretsObject needed to get the secrets from kwallet/kconfig and fixed another bug that prevented the secret types ("always ask", "saved", "not required") to work properly.

Secrets (passwords, Gsm PIN, wifi/vpn encryption keys) can now be saved in KDE session using kwallet (encrypted) or in (plain text) Plasma NM's configuration file. When creating or editing a connection check the checkbox "System connection" to make them be saved in (plain text) NM configuration files. The default is to save them in KDE session, which means a connection with secrets requires Plasma NM running to work. Connections without secrets work without Plasma NM running reggardless if the "System connection" checkbox is checked or not. Maybe we can improve the user interface to make that clearer.

The new backend is going to support only NM-0.9 and it keeps the old Solid::Control namespace. I have just duplicated the classes used in NM-0.7 backend with a Nm09 suffix to distinguish them, so Solid::Control namespace is more inflated now, sorry hehe. The new headers for Solid::Control::*Nm09 classes are installed in $KDEDIR/include/solid/controlnm09 to do not clash with the old ones in KDE SC. When Will finishes his libnm-qt we are going to remove the Solid::Control namespace (at last), which probably is going to happen before KDE SC 4.7.0 release.

I commited the code to nm09 branch in May 16th. If you are a programmer and want to help fix the remaining bugs please test it. If you are a user that wants a rock solid network connection just wait until we fix the most obvious bugs, this code is not for you yet. Expect crashes, instability and missing features when using this code. Update: thanks to whoever fixed the connection editing problem :-)

    Sunday, April 24, 2011

    Plasma NM: Bluetooth tethering

    Two weeks ago Alex Fiestas contacted me for us to fix one of the often requested features in Bluedevil: tethering (use of a bluetooth device, usually a cell phone, to access the Internet wirelessly). Last year during Solid Sprint in Madrid he and Will Stephenson worked on that (I also helped) but we still did not figure out how to make it work as easily as possible. Well, we are getting close...

    Tethering needs support from both Bluedevil and Plasma NM, and they must cooperate to a certain degree to register the connection in NetworkManager. After some research and some answers from the NetworkManager's guys we finally got the information we needed. Most of the needed code went to Plasma NM and Solid, the Bluedevil part was already almost done.

    To keep the story short here is the screenshot of a tethering connection in Plasma NM:



    Things to notice:

    1. I am using a bluetooth icon for the network interface, which is logical since NetworkManager identifies it as bluetooth. The only problem is that it can get mixed up with the Bluedevil icon in systray. Maybe someone can create a different icon, volunteers? ;-)
    2. The "Unknown" word in connection name refers to the unknown access technology used. It seems ModemManager is not able to get that information, I will try to figure out if there is another way to get that. Update: ModemManager works with bluetooth devices, the problem is that Plasma NM assumed that ModemManager's objects always existed when there was a NetworkManager object associated to it, which is not true for bluetooth devices. Bluetooth devices always have a NetworkManager object associated to them but the ModemManager object only exists if the org.bluez.Serial.Connect method has been called. The consequence is that Plasma NM is not notified (via Qt's signals) when there is a change in the bluetooth's ModemManager object properties. I will try to fix that in the future. Update2: problem fixed :-)




    Here some other things to notice:
    1. System Name works for a serial (ppp) connection! :-) This was an old bug in Plasma NM, the usual NM method to get the interface name returns the serial device (/dev/ttyACM0, /dev/ttyUSB0, etc). The traffic graph also did not work for the same reason. I added a hack to force Plasma NM to always use ppp0 as interface name for all serial devices (Dial-up modem, Gsm/Cdma phones, Bluetooth). Well, now I do not need the hack because NM-0.8.2 can give me that information. Unfortunately the support for that is going to be available only in KDE SC 4.7.0.
    2. For the same reason access technology is not reported, neither are the operator's name and the signal quality. The "Enable" status also comes from ModemManager, if there is no way to get those information I will remove them from interface details in the future. Update: problem source detected, just need some time to fix it.  Update2: problem fixed :-)
    3. Yes, mobile broadband in Brazil can be very slow in some places, actually in most cities, even in some neighborhoods in big cities. There are places where it is indeed fast, usually in big cities and some fortunate cities, that is not my case :-/ Here where I live I can get a little above 260 kbps in 3G (220 kbps in 2G) at best for a 300 kbps plan. I do not even bother to get get a faster plan because most operator's networks cannot keep up to the speed and the ones which do are expensive enough to make them not viable :-/

    What is still missing:

    1. Cdma phones's bluetooth support (in both Solid and Plasma NM).
    2. PAN (bluetooth's Personal Area Network) support for both Gsm and Cdma phones. Those two is going to take time since my phone is not compatible with Cdma nor PAN. Update: PAN implemented for Gsm phones :-) Actually the service that the phone must support is NAP (Network Access Point) and not PAN. Or PAN always comes with NAP, I am not sure.
    3. Without the bluetooth patch to Solid's NetworkManager backend that is going to be in 4.7.0 Plasma NM will recognise bluetooth interfaces as gsm. The consequence is that Plasma NM mixes Gsm and Bluetooth connections but NM refuses to use pure Gsm connections with Bluetooth interfaces. With the patch in place Plasma NM can distinguish between Gsm and Bluetooth connections. For instance, I have registered one Bluetooth and one Gsm connection in Plasma NM, but only the Bluetooth one is shown in the screenshots above.
    4. Update: Another consequence is that no gsm connection detail (operator's name, signal quality, access technology) is available without the Solid's patch.
    5. No, for now there is no way to use the same registered connection with the same phone connected through USB and Bluetooth. You have to create one connection to be used when the phone is connected through USB and another connection when the phone is connected through Bluetooth.
    6. When the bluetooth controller is active and there is a bluetooth connection registered the bluetooth interface is always shown, even when phone's bluetooth is disabled. That is the way NM works.
    7. Some lines of code in Bluedevil to call Plasma NM to register a bluetooth connection when a bluetooth device has just been paired.
    8. More testing.

    For the braves who wants to try the Solid patch:
    1. Get the patch against 4.6.2 here: http://git.reviewboard.kde.org/r/101172
    2. Recompile kdelibs and kde-workspace. Recompiling kdelibs is needed because of the ABI changes in Solid. I had some crashes in kded4 until I recompile kdelibs.
    3. Recompile Plasma NM:
    4. git clone git://anongit.kde.org/netwokmanagement
    5. mkdir networkmanagement/build
    6. cd networkmanagement/build
    7. cmake -DCMAKE_INSTALL_PREFIX=/usr ..
    8. make
    9. make install
    Update: Bluedevil 1.2 is going to support launching networkmanagement_configshell to create the bluetooth connection, so you will not need to use any command line. All Plasma NM released since 0.9.0 support bluetooth tethering:



    If you still wants to lauch it yourself follow these instructions:
    1. Execute: $(kde4-config --path exe --locate networkmanagement_configshell) create --type bluetooth --specific-args "00:11:22:33:44:55 dun" . Pay attention to the quotes (") in "00:11:22:33:44:55 dun", they are required.
    2. Change 00:11:22:33:44:55 to your phone's bluetooth hardware address. You can get it in Bluedevil. Update: Change dun for nap if you want that service.
    3. In a few seconds Plasma NM's Mobile Connection Wizard window should appear and you can finish registering the connection.
    4. After that you can go the Plasma NM window and the connection should be there. Just click on it to connect to the Internet.
    You can edit/delete the bluetooth connection in Plasma NM even without the Solid's patch.

    Thursday, April 14, 2011

    Plasma NM: bugs fixed after 4.6.2

    Update: I am going to work more on nm09 branch from now on. The number of people complaining about poor NM-0.9 support is increasing. Unfortunately I am also very busy on other things now so I will have to slow down on Plasma NM bugfixing.

    Following my last post about bugs fixed in Plasma NM, here is the list of bugs fixed after 4.6.2 release date (April 6th) and before 4.6.3 release date (May 6th):

    209673: Improve 802.1x certificate handling for WPA PEAP connections.
    253362: Try to limit the auto-expanding width code used to accomodate the traffic plotter in interface details widget.
    258246: dont't show hiddenWirelessNetworItem by default, show it only if showMore is checked or wireless interface details are activated.
    257920: Enable setting of custom routes.
    270827: Add IPv6 support.
    272140: Set timestamp for system connections.
    272135: Hover all connections associated to a network interface instead of just the first one found.
    272138: Fix problems when changing connection's scope from user to system and vice-versa. Be warned that changing connection's scope is not well tested yet.
    272174: Disables connection's hover state when entering interface details tab.
    209624: Add Bluetooth Network Access Point (NAP) tethering support for Gsm phones. Thanks Rajeesh K. Nambiar for implementing the patch and testing it with his iPhone 3GS.
    264083: Try to unlock (PIN/PUK) and enable modem before connecting to Gsm connections. Also PIN is now one-time only.
    194899: Add button in wireless connection editor to copy the current access point's MAC address to BSSID field.
    268021: Add notifications for VPN connections.
    . Uses KAuth (KDE's Policy Kit wrapper) to authorize users to create/delete/modify system connections.
    . Load networkmanagement kded's module on plasmoid startup to make sure it is loaded.
    271768: Show notification to warn user if he/she tries to connect when networking or wireless is disabled.
    271767: Automatically show other connections in main window if there is no preferred network available.
    271765: Add button to configure notifications directly from networkmanager settings.
    259351: Avoid dangling pointer when setting signal strength for an access point C++ object that has just been destroyed
    253584: Avoid dangling pointer when deleting RemoteInterfaceConnection.
    203584. Bluetooth tethering support for Dial-up Network (DUN), tested with my phone (Samsung i8910). CDMA will take more time since I do not have a compatible cell phone to do tests.
    . Show essid and MAC address of the active accesspoint in wireless interface details.
    249016: Enable additional addresses even on DHCP.
    271353: Try harder not to resize the "show more" button. Also all connection widgets do not change its height when toggling "show more" button.
    . Fix crash when stopping NetworkManager-0.8.2.
    . Various fixes for adhoc support.
    204340: Add systemwide connection support for NM 0.8. Many thanks to Gökçen Eraslan and Andrey Borzenkov for working in this patch. There are still some glitches to fix but it mostly works. One problem I noticed happens if NetworkManager is using the ifnet plugin, then one system connection is changed to user connection and back to system connection. The final connection will not be listed until NetworkManager is restarted. This problem does not happen with the keyfile plugin.
    270901: Do not show notification for appearing/disappearing access points if already connected to one.
    . Monolithic knetworkmanager is unmaintained. Its code is not compiled by default. Please use the plasmoid instead.
    . Fix autoconnect sometimes being disabled without user request when connection is explicitly disconnected by the user.
    . Fix autoconnect setting not saved after editing connection settings.


    We also have a proposal patch for adding IPv6 support to Plasma NM, which would close bug 270827. Well, not everybody have a real IPv6 network (no IPv4 tunneling, IPv6 DHCP server) available to test this patch, so if anybody with such network could test it the patch's author (Ilia Kats) and me would appreciate. Update: patch commited, now we need more real world testing.

    Update: last week I confirmed Ilia Kats' KDE developer account and now he is a Plasma NM developer, congratulations :-)  That is the least I could do after all the important work he is doing for Plasma NM, such as the ad-hoc fix and IPv6 support among others.

    Tuesday, April 5, 2011

    Plasma NM: connection sharing

    Now that the ad-hoc wireless bug has been fixed it is possible to share wired or 3G connection through wireless. To create a shared connection:

    1. Create an ad-hoc connection:
    2. Click on the connection in Plasma NM window and wait.
    3. This dialog will appear, just fill in the passphrase and click Ok:
    4. Wait some seconds and the ad-hoc AP will be started:

    I was able to browse the web using my cell phone. The WirelessSharing connection did not appear when I scanned the neighborhood, I had to write the essid manually. Using my current notebook as gateway I was able to connect my old notebook to the Internet too.