LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
Search this Thread
Old 09-02-2013, 06:18 AM   #1
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian, Arch, Xubuntu
Posts: 186

Rep: Reputation: 13
WiCD: How to toggle WiFi on and off?


I'm setting up a headless device (has console access only) that has ethernet and wireless connectivity. I'm using wicd to manage the connections. The ethernet port is configured via Wicd to use DHCP. The WiFi can also be managed by wicd to connect to (an) access point(s).

However the wireless device will sometimes be used for other things (i.e. hostap), and during this time I'd like wicd to leave the wlan0 device alone, but still handle the ethernet dhcp. It shouldn't even scan or probe any networks. In fact it should leave the wifi completely alone - as if the device doesn't exist.

I've googled for wicd, but I couldn't come up with a proper answer. Is there a way to toggle wicd WiFi management on and off while leaving ethernet enabled? The only idea I got was to edit the wicd management config file and remove out the line where the wifi device is specified, and restart wicd.

Is there an easier way? Some gui backends offer a checkbox to enable/disable wifi.


Best regards!
~dis
 
Old 09-02-2013, 08:40 PM   #2
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 8,221

Rep: Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552
Wicd does have a switch-off wifi button in the GUI version of wicd-client.

Since this is headless, I suspect you will be using the ncurses wicd interface, wicd-curses. I looked about, but was unable to find a turn WiFi on/off toggle there, but I might have just overlooked it.

The Arch wiki article might help: https://wiki.archlinux.org/index.php/Wicd There might be a way to do it with scripts.
 
Old 09-03-2013, 01:46 AM   #3
displace
Member
 
Registered: Jan 2013
Location: EU
Distribution: Debian, Arch, Xubuntu
Posts: 186

Original Poster
Rep: Reputation: 13
I have managed to source-dive the wicd-daemon, python-wicd and wicd-gtk python scripts, and I've tracked down what the Enable/Disable WiFi button does. It simply invokes the following commands for wifi:

# rfkill block wifi
# rfkill unblock wifi

This does not tell the wicd not to use the wifi card, it simply sets the rfkill block. Should this rfkill block be removed manually, (just tested it) wicd will start using the device once more.

Any ideas?

Code:
@dbus.service.method('org.wicd.daemon')
def SetWirelessInterface(self, interface):
    """ Sets the wireless interface the daemon will use. """
    print "setting wireless interface %s" % (str(interface))
    self.wifi.wireless_interface = noneToBlankString(interface)
    self.config.set("Settings", "wireless_interface", interface, write=True)
I've noticed that one can set the wireless interface via dbus. Maybe if I set this to none I can disable it? I'll need to test this some more.

Last edited by displace; 09-03-2013 at 01:47 AM.
 
Old 09-03-2013, 07:47 PM   #4
frankbell
Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Mageia, Mint
Posts: 8,221

Rep: Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552Reputation: 1552
Cool, thanks for the update.

There is an rfkill item on the wicd-curses menu bar at the bottom of the terminal window. I didn't catch it because I haven't had occasion to learn that command before.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
No WPA encrypted wifi connection with kernel 3.2.2 via Wicd brobr Slackware 3 03-31-2012 06:34 PM
wicd keeps dropping my wifi connedtion rob.rice Slackware 16 07-22-2011 06:58 AM
[SOLVED] Anyone have trouble using Wicd to connect to Airport Wifi? BoydRice Slackware 5 03-20-2010 08:06 PM


All times are GMT -5. The time now is 12:43 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration