Skip to content

Conversation

KwadFan
Copy link
Contributor

@KwadFan KwadFan commented Jun 25, 2022

This changes allow to customize behavior of network modules power save
for wifi.

The used method spits out an error if the device has no wifi built in,
which confuses the user.

To prevent that I implemented a simple solution that the user only get a
warning if no wifi device present.

Also added functionality to disable the whole mechanism.
You can choose a standard rc.local entry or
a systemd service to manipulate behavior on reboots
(Enable/Disable the service)

Signed-off-by: Stephan Wendel me@stephanwe.de

This changes allow to customize behavior of network modules power save
for wifi.

The used method spits out an error if the device has no wifi built in,
which confuses the user.

To prevent that I implemented a simple solution that the user only get a
warning if no wifi device present.

Also added functionality to disable the whole mechanism.
You can choose a standard rc.local entry or
a systemd service to manipulate behavior on reboots
(Enable/Disable the service)

Signed-off-by: Stephan Wendel <me@stephanwe.de>
@KwadFan
Copy link
Contributor Author

KwadFan commented Jun 25, 2022

Prove of concept:

https://github.com/KwadFan/MainsailOS/actions/runs/2560281839 -> with rc.local option
https://github.com/KwadFan/MainsailOS/actions/runs/2560248574 -> with service option

Test runs will be removed after merge, for future visitors, it works :)

@meteyou
Copy link
Contributor

meteyou commented Jun 25, 2022

this is a "screenshot" from a PI 2 with this service:
PXL_20220625_143852846

  • second line > start service
  • [ WARN ] line > result because this pi have no wifi

@guysoft
Copy link
Owner

guysoft commented Jun 26, 2022

Looks good, though just a thought - perhaps its a better idea to make it go in the udev rules setting - that way it would also act better on the rpi2 output @meteyou gave.
Something along the lines of: https://superuser.com/a/629263/268425

Its better than the rclocal we have now.

@KwadFan
Copy link
Contributor Author

KwadFan commented Jun 26, 2022

How about adding a third option to use udev rule? My intention was to provide something simple, useable for the "enduser" but not to go far away from a existing solution to not break something that uses rc.local style. Personally I like the udev method, that should also provide something simple like an systemctl disable wifi.....

@guysoft
Copy link
Owner

guysoft commented Jun 27, 2022

@KwadFan Sure, if you are up for it that would be great!

@KwadFan
Copy link
Contributor Author

KwadFan commented Jun 27, 2022

@KwadFan Sure, if you are up for it that would be great!

Could be take a few days, because I am o Vacation but will do.

This sets a udev rule to disable powermanagement.
Also set udev as default.

To be configured by users, I added also a script called 'pwrsave-udev'
This allows to create or modify (on/off) behavior off udev rule.
The create option is to recreate in case of deleting the rule.

Signed-off-by: Stephan Wendel <me@stephanwe.de>
@KwadFan
Copy link
Contributor Author

KwadFan commented Jul 15, 2022

@guysoft I think I did what you thought about as a better solution. The rule and the script itself works fine. Didnt test a build yet.

@guysoft guysoft merged commit 040c95f into guysoft:devel Jul 15, 2022
@guysoft
Copy link
Owner

guysoft commented Jul 15, 2022

Thanks for doing that. Merged :)
Lets see how it works out

@KwadFan
Copy link
Contributor Author

KwadFan commented Jul 15, 2022

Mentioning #169 and #170

@KwadFan KwadFan deleted the feat/wifipwrsave branch July 15, 2022 13:15
guysoft added a commit that referenced this pull request Jul 15, 2022
fix: fixes error not parsed variables #168
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.

3 participants