ModemManager API review
Hi guys, so during PlumbersConf Dan asked me to take a look at the ModemManager API and finally I got around it and have some initial comments. I wasn't able to actually use it to make data connections from my testing script, but initial results were kinda nice. So the first thing that draw me off is that we are stupidly mapping the HAL devices 1:1 to our devices. That is wrong. We should not do this. So for example my Option card has three TTYs and one network device. This all is one device. Currently it shows up as three devices. The number of TTY (control, data or whatever) is an implementation and should not be exposed via the API. So we have to be smart with this. The second thing is that the Manager interface talks about devices, while the main interface to the hardware is called Modem. So that should be consistent. Either we call them devices or modems. The Modem interface has a Connect method call that takes a parameter number. This makes no sense whatsoever. Connect should not take any arguments it should connect with whatever has been configured or be smart and auto-configure it. Especially since you don't know if you are using a real number or actually an APN or something else. And then we have Enable with a parameter. Don't do that. Just add Enable and Disable methods. Otherwise the API looks weird. Also signals like Connected, Enabled etc. are missing. So the split between Modem interface and Gsm.Card make no real sense to me. I would just convert everything into properties or create a GetProperties method to retrieve one dictionary with all the information. All the GetImei, GetImsi calls only create round-trips to D-Bus that can be avoided. If one technology doesn't have IMSI, then this property is just missing. And for setting things like the APN etc, you can use writable properties or a SetProperty method. So you could just set all properties and then call Connect. To make this fully async, a signal PropertyChanged would be needed, too. And on that matter, please don't use enums since higher level languages don't really have the concept of includes from a C definition. So if you wanna give the band information you can just say "gsm900", "gsm1800" etc. Also for the mode having things like "connect", "connecting" etc. make it a lot easier to develop and debug. And when using dbus-monitor is shows up in clear text. Some things like GetRegistrationInfo are just better separated into properties or key/value pairs in a dictionary. That keeps the API small and also flexible for future changes. So the network details on GSM are not really that interesting at all. I would leave them out for now. However I do think that representing every network as object path would be a better approach here. Regards Marcel ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Cannot list wireless networks
Ok, so I got networkmanager up and running and I can't see any networks listed in the add new connection screen. I am using knetworkmanager as an interface, but I presume that it's a lower level issue, so I'll post the output to nm-tool here: FrewSchmidt2 [8158] % nm-tool NetworkManager Tool State: connected - Device: eth0 Type: Wired Driver:8139too State: unmanaged Default: no HW Address:00:00:00:00:00:00 Capabilities: Supported: yes Carrier Detect: yes Speed: 100 Mb/s Wired Settings - Device: eth1 Type: 802.11 WiFi Driver:ipw2200 State: unmanaged Default: no HW Address:00:00:00:00:00:00 Capabilities: Supported: yes Wireless Settings WEP Encryption: yes WPA Encryption: yes WPA2 Encryption: yes Wireless Access Points Any ideas? -- -fREW ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Network Manager Autologin
Hello all, I know I posted something about this awhile ago, but thinking about it a bit more, a couple of questions and ideas have arisen in my mind. For those who may not have read this before, the idea is to have something using NetworkManager to automatically log in to web-authenticated networks (ie: hotspots in a cafe) when it connects to specific networks. I have three ideas on how to implement this, but they all revolve around the idea of having a Firefox extension that would listen to dbus signals being sent by nm, and when told to, would go to a specific webpage to log in, using Firefox's password storage. 1) Have nm check to see if Firefox is open, if not, open it and send the signal 2) Make nm have nothing to do with the extension, but merely sending its regular signals and FF picking them up 3) Make nm send modified signals specifically for the autologin, letting any program pick them up (such as network name, URL to visit, etc) Judging by before, I doubt #1 would be the best idea (forcing FF to be installed is not good), #2 may or may not work, but I think #3 would be best. To get around whether FF is open or not, a small program could be written to start on login (separate from nm) that would listen for the signals, start FF, and pass it along. As for the technical side of this, it's primarily, what sort of information does nm send through dbus, and are multiple programs able to pick up on it? Opinions, ideas, information? --Slokunshialgo ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: PPTP VPN plugin
On Mon, 2008-11-03 at 17:47 +, Dave Barton wrote: > Hi, > > I'm having some issues with the PPTP VPN plugin and I'm not sure whether > it is a bug or a strangely configured VPN server... > > I connect to my VPN via a wireless connection and the problem is I cannot > connect to anything (web, email, etc) and after a few mins the connection > dies. I've worked out that I can solve this by adding a route (i.e., > "route add xx.xx.xx.xx gw xx.xx.xx.xx wlan0") to my VPN server that goes > via the original wireless connection (and associated gateway) but since I > don't know the gateway beforehand (it depends on the wireless hotspot) I > can't add it as a route that gets added when the VPN starts... NM should already be adding a host route to the external VPN gateway. Can you do '/sbin/route -n' right after the initial connection and see if that host route is present? Dan ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Asking for wireless password when on wired network
On Mon, 2008-11-03 at 10:14 -0800, Bill Moseley wrote: > I just upgraded to Ubuntu 8.10 and like the improvements in Network > Manager. I do have a few questions, though: > > I've noticed that sometimes the WPA password dialog pops up asking for > my password. I have my password stored in my keyring, and indeed the > password field is pre-filled out. > > So, I just hit enter and then it connects. The driver failed to connect, thus the password is assumed to be wrong. Drivers still suck, unfortunately. > Perhaps related, at one location in my house the wireless connection is > very weak, so I use a wired connection. Now, when I have the wired This weak signal strength is likely why the driver keeps failing to connect. > connection I still get the pop up asking for my wireless password. > > Does NM just assume that if it fails to connect that it's an invalid > password? Seems after a few attempts it quits asking for the password > any more. Yes; though this assumption is not as valid with AP because if association succeeds, you know the key is right. It's mostly an artifact of WEP that we should fix up for WPA. > Is that just something to live with? You can disable wireless when you don't need it via the right-click menu of the applet if you like. Or, you could make the connection to your wifi AP not autoconnect (in the connection editor) and then it won't keep trying, but you'll have to manually pick the connection each time you want to connect. Might be a fair trade-off. > Also, I see there's system settings now. Does that mean I can save my > wireless passwords system-wide and have Network Manager bring up my > wireless before I actually log in? Yes, via the keyfile plugin. You should be able to just move your user connection to a system connection by checking the "Available to all users" box in the connection editor. If you don't see it, wait for your distro to update NetworkManager to a newer version. > BTW -- one thing I've always wondered: I have an Apple laptop and the > wireless connects within seconds of waking the laptop up from sleep. > But, on my Ubuntu laptop it takes many times longer. Is that Network > Manager being slow or the is that just how the wireless stack works on > Linux? A few reasons: 1) Mac OS X's Airport status icon fills in the moment the card has a connection to the AP, but you don't necessarily have an IP address yet. Thus, even though Mac OS X says you're "connected", you can't actually do anything on the Internet until you get a DHCP lease. I've occasionally had Mac OS X say I'm "connected" but when I try to go somewhere immediately thereafter in safari, I can't, because the machine hasn't gotten a DHCP lease yet. 2) Apple only has a few different types of hardware, and they can concentrate all their effort on 5 or so different chips. Thus the drivers work pretty well. Linux supports ~50 or more different chips, thus the effort is divided and some drivers just don't work as well. Dan ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Asking for wireless password when on wired network
I just upgraded to Ubuntu 8.10 and like the improvements in Network Manager. I do have a few questions, though: I've noticed that sometimes the WPA password dialog pops up asking for my password. I have my password stored in my keyring, and indeed the password field is pre-filled out. So, I just hit enter and then it connects. Perhaps related, at one location in my house the wireless connection is very weak, so I use a wired connection. Now, when I have the wired connection I still get the pop up asking for my wireless password. Does NM just assume that if it fails to connect that it's an invalid password? Seems after a few attempts it quits asking for the password any more. Is that just something to live with? Also, I see there's system settings now. Does that mean I can save my wireless passwords system-wide and have Network Manager bring up my wireless before I actually log in? BTW -- one thing I've always wondered: I have an Apple laptop and the wireless connects within seconds of waking the laptop up from sleep. But, on my Ubuntu laptop it takes many times longer. Is that Network Manager being slow or the is that just how the wireless stack works on Linux? Thanks, -- Bill Moseley [EMAIL PROTECTED] Sent from my iMutt ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: PPTP VPN plugin
As this is not a SAP, i guess it's bug :) Dave Barton wrote: > Hi, > > I'm having some issues with the PPTP VPN plugin and I'm not sure > whether it is a bug or a strangely configured VPN server... > > I connect to my VPN via a wireless connection and the problem is I > cannot connect to anything (web, email, etc) and after a few mins the > connection dies. I've worked out that I can solve this by adding a > route (i.e., "route add xx.xx.xx.xx gw xx.xx.xx.xx wlan0") to my VPN > server that goes via the original wireless connection (and associated > gateway) but since I don't know the gateway beforehand (it depends on > the wireless hotspot) I can't add it as a route that gets added when > the VPN starts... > > Is this a bug or a feature? :-) > > Cheers > David ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
PPTP VPN plugin
Hi, I'm having some issues with the PPTP VPN plugin and I'm not sure whether it is a bug or a strangely configured VPN server... I connect to my VPN via a wireless connection and the problem is I cannot connect to anything (web, email, etc) and after a few mins the connection dies. I've worked out that I can solve this by adding a route (i.e., "route add xx.xx.xx.xx gw xx.xx.xx.xx wlan0") to my VPN server that goes via the original wireless connection (and associated gateway) but since I don't know the gateway beforehand (it depends on the wireless hotspot) I can't add it as a route that gets added when the VPN starts... Is this a bug or a feature? :-) Cheers David -- === David Barton Email: [EMAIL PROTECTED] Web:www.cityinthesky.co.uk === ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Can nm provide connection speed ?
On Mon, Nov 3, 2008 at 16:16, Jonas Koelker <[EMAIL PROTECTED]> wrote: > On Mon, Nov 03, 2008 at 10:22:44AM +0100, Patryk Zawadzki wrote: >> On Mon, Nov 3, 2008 at 2:58 AM, Dan Williams <[EMAIL PROTECTED]> wrote: >> > On Mon, 2008-11-03 at 00:06 +0100, thibaut bethune wrote: >> >> Some softwares requires to know what is the user connection speed to >> >> deliver the best experience. >> >> For instance, Totem has a YouTube plugin that allows the user to >> > You'd need other pieces of code that would test-download from the >> > content server to quickly determine the speed, and you'd also need to >> While this is true I think we should add a place somewhere to specify >> such information (ideally in NM as it varies between connections) so >> >> Please specify the speed: [ Try to detect automatically | ↓ ]. >> [x] I am charged for using this connection so try to minimize the >> background traffic." > > I vaguely recall a story about a consumer device (wifi AP or similar) that'd > phone home for an ntp update everytime it started. The result was that A LOT > of bandwidth was used, and someone got angry about it and wrote an article > with lots of keen insights and pretty traffic graphs [maybe he got the ip > address reallocated to him or something?]. Summary: don't do that. > > If anyone knows what I'm talking about, please link to that article, I wanna > read it again. And have all the arguments I can't give a reference to in mind > the next time someone wants n-m to detect whether it's on an internets! ;) http://en.wikipedia.org/wiki/NTP_vandalism Kay ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Cannot start NetworkManager
On Mon, Nov 3, 2008 at 5:09 AM, Alexander Sack <[EMAIL PROTECTED]> wrote: > On Sun, Nov 02, 2008 at 08:48:50PM -0500, Dan Williams wrote: > > On Sun, 2008-11-02 at 18:41 -0600, fREW Schmidt wrote: > > > Hello all! > > > > > > I am trying to set up my wireless to work with NetworkManager but I > > > cannot even get the background daemon to start up. I am not really > > > sure what's causing the issue. Here is the error message that I got > > > trying to start the daemon manually: > > > > > > localhost [8161] <1> % sudo NetworkManager --no-daemon > > > NetworkManager: starting... > > > NetworkManager: Found radio > > > killswitch /org/freedesktop/Hal/devices/ipw_wlan_switch > > > NetworkManager: eth0: driver is '8139too'. > > > NetworkManager: Found new Ethernet device 'eth0'. > > > NetworkManager: (eth0): exported > > > as /org/freedesktop/Hal/devices/net_00_11_d8_c9_0b_89 > > > NetworkManager: eth1: driver is 'ipw2200'. > > > NetworkManager: eth1: driver supports SSID scans (scan_capa > > > 0x21). > > > NetworkManager: Found new 802.11 WiFi device 'eth1'. > > > NetworkManager: (eth1): exported > > > as /org/freedesktop/Hal/devices/net_00_12_f0_21_e6_85 > > > NetworkManager: symbol lookup error: NetworkManager: undefined symbol: > > > nm_connection_new_from_hash > > > > Do you have the files /usr/lib/libnm-util.so.0 > > or /usr/lib64/libnm-util.so.0? It looks like libnm-util either wasn't > > installed correctly, or is old. Is the modification date on either of > > those files (if you have them) significantly different than what's > > on /usr/sbin/NetworkManager? > > Also check that you dont have old cruft in /usr/local/lib/ > ... (e.g. maybe you tried to build NM on your own once). > > - Alexander > > ___ > NetworkManager-list mailing list > NetworkManager-list@gnome.org > http://mail.gnome.org/mailman/listinfo/networkmanager-list > I think Dan got it right. Last night I told Ubuntu to delete all the nm files and then reinstall them and the issue dissapeared. I haven't tried to actually configure it for wireless, but that's pretty easy as I have a pretty standard card (ipw2200) and pretty normal network (WPA2). Thanks for your help, I'll let you know for sure when I get it working. -fREW ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Can nm provide connection speed ?
On Mon, Nov 03, 2008 at 10:22:44AM +0100, Patryk Zawadzki wrote: > On Mon, Nov 3, 2008 at 2:58 AM, Dan Williams <[EMAIL PROTECTED]> wrote: > > On Mon, 2008-11-03 at 00:06 +0100, thibaut bethune wrote: > >> Some softwares requires to know what is the user connection speed to > >> deliver the best experience. > >> For instance, Totem has a YouTube plugin that allows the user to > > You'd need other pieces of code that would test-download from the > > content server to quickly determine the speed, and you'd also need to > While this is true I think we should add a place somewhere to specify > such information (ideally in NM as it varies between connections) so > > Please specify the speed: [ Try to detect automatically | ↓ ]. > [x] I am charged for using this connection so try to minimize the > background traffic." I vaguely recall a story about a consumer device (wifi AP or similar) that'd phone home for an ntp update everytime it started. The result was that A LOT of bandwidth was used, and someone got angry about it and wrote an article with lots of keen insights and pretty traffic graphs [maybe he got the ip address reallocated to him or something?]. Summary: don't do that. If anyone knows what I'm talking about, please link to that article, I wanna read it again. And have all the arguments I can't give a reference to in mind the next time someone wants n-m to detect whether it's on an internets! ;) The point? What seems innocent can become a nightmare when enough people do it. "Yeah, but it's just a one-time download of a meg or two". What if people are very mobile and visit a lot of networks? Who are we going to dowload from to test the bandwidth? They'll have a bigger bandwidth bill to foot. Sustaining a download for enough time that your ISP starts dropping your traffic and you can confidently say something about your bandwidth is going to take more than a few packets. If a few packets for an ntp update can cause problems, I'd wouldn't _a_priori_ assume that this can't. It remains to be seen whether it's a problem, but I wouldn't want to find out by trying it. "hey, will fireworks blow my hand off? ..." ;) always-predicting-sky-falling-down'ly yours, -- Jonas Kölker <[EMAIL PROTECTED]> http://jonaskoelker.ignorelist.com> signature.asc Description: Digital signature ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Can nm provide connection speed ?
On Mon, Nov 3, 2008 at 11:22 AM, Patryk Zawadzki <[EMAIL PROTECTED]> wrote: > This way we could make both Totem and PackageKit happy (the former > needs bandwidth to optimize streaming, the latter doesn't want to pull > updates on GPRS and needs bandwidth to throttle the background > downloads). The active device type is already available on the NetworkManager DBus API. The broadband modem speed (at least network type, ie gprs/3g/...) will be available in the near future. But having every application know so much about different device types and their details, not to mention that active 1gig ethernet device usually doesn't mean you have that connection speed, I think there is room for some sort of library or service that is implemented on top of NM but below user applications. Tambet ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Cannot start NetworkManager
On Sun, Nov 02, 2008 at 08:48:50PM -0500, Dan Williams wrote: > On Sun, 2008-11-02 at 18:41 -0600, fREW Schmidt wrote: > > Hello all! > > > > I am trying to set up my wireless to work with NetworkManager but I > > cannot even get the background daemon to start up. I am not really > > sure what's causing the issue. Here is the error message that I got > > trying to start the daemon manually: > > > > localhost [8161] <1> % sudo NetworkManager --no-daemon > > NetworkManager: starting... > > NetworkManager: Found radio > > killswitch /org/freedesktop/Hal/devices/ipw_wlan_switch > > NetworkManager: eth0: driver is '8139too'. > > NetworkManager: Found new Ethernet device 'eth0'. > > NetworkManager: (eth0): exported > > as /org/freedesktop/Hal/devices/net_00_11_d8_c9_0b_89 > > NetworkManager: eth1: driver is 'ipw2200'. > > NetworkManager: eth1: driver supports SSID scans (scan_capa > > 0x21). > > NetworkManager: Found new 802.11 WiFi device 'eth1'. > > NetworkManager: (eth1): exported > > as /org/freedesktop/Hal/devices/net_00_12_f0_21_e6_85 > > NetworkManager: symbol lookup error: NetworkManager: undefined symbol: > > nm_connection_new_from_hash > > Do you have the files /usr/lib/libnm-util.so.0 > or /usr/lib64/libnm-util.so.0? It looks like libnm-util either wasn't > installed correctly, or is old. Is the modification date on either of > those files (if you have them) significantly different than what's > on /usr/sbin/NetworkManager? Also check that you dont have old cruft in /usr/local/lib/ ... (e.g. maybe you tried to build NM on your own once). - Alexander ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: Can nm provide connection speed ?
On Mon, Nov 3, 2008 at 2:58 AM, Dan Williams <[EMAIL PROTECTED]> wrote: > On Mon, 2008-11-03 at 00:06 +0100, thibaut bethune wrote: >> Some softwares requires to know what is the user connection speed to >> deliver the best experience. >> >> For instance, Totem has a YouTube plugin that allows the user to >> browse YouTube videos. YouTube website provides different resolutions. >> The choice of a larger or smallest resolution depends on user >> connection speed. At present time, Totem allow the user to set its >> connection speed to get the best resolution. It could be much smarter >> if the system could "guess" what is the current connection speed and >> automatically set the best resolution (see >> http://bugzilla.gnome.org/show_bug.cgi?id=521536#c13 ) >> >> Is there a way to know what is the current connection speed with nm ? > NM can tell you the connection speed of the local link, but that's > almost never what you want, because your local link is always going to > be faster than whatever pipes are between you and the provider. So > basically, no. > > You'd need other pieces of code that would test-download from the > content server to quickly determine the speed, and you'd also need to > dynamically adjust the speed during playback because the quick > speed-check at the start may well be either best-case or worst-case. While this is true I think we should add a place somewhere to specify such information (ideally in NM as it varies between connections) so the user is not forced to reconfigure half of his desktop when moving from office 802.11N to roaming GPRS. Maybe something like "This is the first time you connect to . Some applications need to know the speed of the connection to offer you the best experience. Please specify the speed: [ Try to detect automatically | ↓ ]. [x] I am charged for using this connection so try to minimize the background traffic." This way we could make both Totem and PackageKit happy (the former needs bandwidth to optimize streaming, the latter doesn't want to pull updates on GPRS and needs bandwidth to throttle the background downloads). -- Patryk Zawadzki ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list
Re: NetworkManager 99% use CPU
On Mon, Nov 3, 2008 at 3:47 AM, Dan Williams <[EMAIL PROTECTED]> wrote: > Tambet, maybe the system settings service is getting kicked off the bus > or hanging somewhere in the suse plugin getting unmanaged devices? Probably. To make it certain, please edit /etc/NetworkManager/nm-system-settings.conf file, remove the 'ifcfg-suse' (so that the plugins line will become 'plugins=keyfile') and kill the running system-settings daemon ('killall nm-system-settings' as root). After doing that, does the NetworkManager process still consume a lot of CPU? Tambet ___ NetworkManager-list mailing list NetworkManager-list@gnome.org http://mail.gnome.org/mailman/listinfo/networkmanager-list