You are not logged in.

#1 2016-06-02 22:40:25

persio809
Member
Registered: 2016-05-29
Posts: 11

Enable/disable wifi temporarily to save battery

How can I temporarily disable wifi when I'm not using it to save battery?
Thank you in advance!

Offline

#2 2016-06-02 22:52:42

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: Enable/disable wifi temporarily to save battery

rfkill


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2016-06-02 23:24:11

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,570
Website

Re: Enable/disable wifi temporarily to save battery

or ... just don't put the interface up.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#4 2016-06-03 02:57:05

persio809
Member
Registered: 2016-05-29
Posts: 11

Re: Enable/disable wifi temporarily to save battery

jasonwryan wrote:

rfkill

I get this:

[x@r4 ~]$ rfkill list wifi
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
[x@r4 ~]$ rfkill block phy0
[b]Bogus block argument 'phy0'[/b].

What does it mean?

Trilby wrote:

or ... just don't put the interface up.

What do you mean? I don't have a hardware switch for it, if that's what you are referring to.

Last edited by persio809 (2016-06-03 02:57:36)

Offline

#5 2016-06-03 03:20:33

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: Enable/disable wifi temporarily to save battery

persio809 wrote:
jasonwryan wrote:

rfkill

I get this:

[x@r4 ~]$ rfkill list wifi
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
[x@r4 ~]$ rfkill block phy0
[b]Bogus block argument 'phy0'[/b].

What does it mean?

you get only phy0 in rfkill list?? Do you have working wifi in first place??

Offline

#6 2016-06-03 03:26:27

persio809
Member
Registered: 2016-05-29
Posts: 11

Re: Enable/disable wifi temporarily to save battery

Docbroke wrote:

you get only phy0 in rfkill list?? Do you have working wifi in first place??

Yes, that's the only thing I get, and yes, it's working.

[persio@r4 ~]$ rfkill list wifi
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no

Offline

#7 2016-06-03 03:53:31

TheChickenMan
Member
From: United States
Registered: 2015-07-25
Posts: 354

Re: Enable/disable wifi temporarily to save battery

persio809 wrote:
Trilby wrote:

or ... just don't put the interface up.

What do you mean? I don't have a hardware switch for it, if that's what you are referring to.

Nearly all of the power usage of the wifi radio is in transmission. If you're not connected then you're not transmitting. Yes, it would still use some power but very little. You probably wouldn't notice a difference between it being not connected and it being totally off.


If quantum mechanics hasn't profoundly shocked you, you haven't understood it yet.
Niels Bohr

Offline

#8 2016-06-03 07:09:49

dif
Member
From: Stalowa Wola, Poland
Registered: 2009-12-22
Posts: 137

Re: Enable/disable wifi temporarily to save battery

persio809 wrote:

I get this:

[x@r4 ~]$ rfkill list wifi
1: phy0: Wireless LAN
	Soft blocked: no
	Hard blocked: no
[x@r4 ~]$ rfkill block phy0
[b]Bogus block argument 'phy0'[/b].

Use the index, not the name:

[x@r4 ~]$ rfkill block 1

and see what happens.

Last edited by dif (2016-06-03 07:10:17)

Offline

#9 2016-06-03 10:41:38

persio809
Member
Registered: 2016-05-29
Posts: 11

Re: Enable/disable wifi temporarily to save battery

that worked! thank you @dif

Offline

#10 2016-06-03 11:09:36

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,570
Website

Re: Enable/disable wifi temporarily to save battery

I mean what I said.  Don't put the interface up.  When you turn your computer on in archlinux, all the network interfaces are down by default.  You must use the command `ip link set <interface> up` (e.g. `ip link set wlp3s0 up`) as the first step of getting a connection.

You may have also installed some network management tool that does this for you.  Just disable/stop that tool.  Rfkill is a massive overkill for this.  As an analogy, if you want to preserve the battery on your cell phone, just turn it off - there is no need to lock it in a Farraday cage to prevent it from getting any signals when it is off.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB