Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iw/iwconfig wireless-power bugs #95

Closed
wants to merge 2 commits into from

Conversation

andpol
Copy link

@andpol andpol commented Mar 12, 2017

One bug only causes a harmless error log. The other bug prevents iwconfig from using it's power-saving txpower mode.

'txpower fixed' is an invalid iw command resulting in the error message
"Missing TX power level argument". Unlike iwconfig, it seems the best
way to save power with iw is to just use the power_save option alone.
@rickysarraf
Copy link
Owner

Thank you for reporting the bug @andpol

I have made the changes, with some minor differences. Could you please test the same ?
Mainly, for iw, instead of "auto" it'd now explicitly set "on" or "off".

@rickysarraf
Copy link
Owner

My test results look good. Would be nice to have your confirmation too.

Mar 12 17:27:54 learner laptop_mode[19450]: Not enabling auto suspend mode for device /sys/bus/acpi/devices/INT33C7:00
Mar 12 17:27:54 learner laptop_mode[19450]: Enabling auto power level for device /sys/bus/acpi/devices/INT33C7:00.
Mar 12 17:27:54 learner laptop_mode[19450]: + LINK_TARGET=../../../../bus/pci/drivers/rtl8723be
Mar 12 17:27:54 learner laptop_mode[19450]: + DRIVER=rtl8723be
Mar 12 17:27:54 learner laptop_mode[19450]: + EXCLUDED=0
Mar 12 17:27:54 learner laptop_mode[19450]: + [ iwl3945 = rtl8723be ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ iwl4965 = rtl8723be ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ iwlagn = rtl8723be ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ ipw3945 = rtl8723be ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ ipw2200 = rtl8723be ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ ipw2100 = rtl8723be ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ 0 = 0 ]
Mar 12 17:27:54 learner laptop_mode[19450]: + WIFI_IFNAMES= wlan0
Mar 12 17:27:54 learner laptop_mode[19450]: + [ 0 -eq 1 ]
Mar 12 17:27:54 learner laptop_mode[19450]: + log VERBOSE On battery: setting power saving mode for wlan0 to on.
Mar 12 17:27:54 learner laptop_mode[19450]: + [ x0 = x1 ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ VERBOSE = VERBOSE ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ 1 = 1 ]
Mar 12 17:27:54 learner laptop_mode[19450]: + echo On battery: setting power saving mode for wlan0 to on.
Mar 12 17:27:54 learner laptop_mode[19450]: On battery: setting power saving mode for wlan0 to on.
Mar 12 17:27:54 learner laptop_mode[19450]: + setPowerSave wlan0 on
Mar 12 17:27:54 learner laptop_mode[19450]: + local IF=wlan0
Mar 12 17:27:54 learner laptop_mode[19450]: + local ONOFF=on
Mar 12 17:27:54 learner laptop_mode[19450]: + [ -n /sbin/iw ]
Mar 12 17:27:54 learner laptop_mode[19450]: + /sbin/iw dev wlan0 set power_save on
Mar 12 17:27:54 learner laptop_mode[19450]: + log VERBOSE On battery: Successfully set power saving mode for wlan0 to on.
Mar 12 17:27:54 learner laptop_mode[19450]:  /usr/share/laptop-mode-tools/modules/wireless-power
Mar 12 17:27:54 learner laptop_mode[19450]: + [ x0 = x1 ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ VERBOSE = VERBOSE ]
Mar 12 17:27:54 learner laptop_mode[19450]: + [ 1 = 1 ]
Mar 12 17:27:54 learner laptop_mode[19450]: + echo On battery: Successfully set power saving mode for wlan0 to on.
Mar 12 17:27:54 learner laptop_mode[19450]: On battery: Successfully set power saving mode for wlan0 to on.
Mar 12 17:27:54 learner laptop_mode[19450]: Not enabling auto suspend mode for device /sys/bus/acpi/devices/INT33C8:00
Mar 12 17:27:54 learner laptop_mode[19450]: Enabling auto power level for device /sys/bus/acpi/devices/INT33C8:00.

@andpol
Copy link
Author

andpol commented Mar 12, 2017

Confirmed working on my end too 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants