Currently translated at 2.0% (1 of 49 strings) Translated using Weblate (Swedish) Currently translated at 100.0% (3 of 3 strings) Translated using Weblate (Swedish) Currently translated at 48.0% (24 of 50 strings) Translation: OpenWrt/LuCI/applications/acme Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsacme/sv/ Translated using Weblate (Swedish) Currently translated at 71.4% (5 of 7 strings) Translation: OpenWrt/LuCI/applications/squid Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssquid/sv/ Translated using Weblate (Swedish) Currently translated at 5.3% (3 of 56 strings) Translation: OpenWrt/LuCI/applications/dump1090 Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsdump1090/sv/ Translated using Weblate (Swedish) Currently translated at 70.7% (29 of 41 strings) Translation: OpenWrt/LuCI/applications/attendedsysupgrade Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsattendedsysupgrade/sv/ Translated using Weblate (Swedish) Currently translated at 94.1% (32 of 34 strings) Translation: OpenWrt/LuCI/applications/wifischedule Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationswifischedule/sv/ Translated using Weblate (Swedish) Currently translated at 83.7% (31 of 37 strings) Translation: OpenWrt/LuCI/applications/advanced-reboot Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadvanced-reboot/sv/ Translated using Weblate (Swedish) Currently translated at 83.7% (31 of 37 strings) Translation: OpenWrt/LuCI/applications/advanced-reboot Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadvanced-reboot/sv/ Translated using Weblate (Swedish) Currently translated at 41.6% (5 of 12 strings) Translation: OpenWrt/LuCI/applications/bcp38 Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsbcp38/sv/ Translated using Weblate (Swedish) Currently translated at 64.6% (75 of 116 strings) Translation: OpenWrt/LuCI/applications/radicale Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsradicale/sv/ Translated using Weblate (Swedish) Currently translated at 14.1% (16 of 113 strings) Translated using Weblate (Swedish) Currently translated at 6.0% (8 of 133 strings) Translated using Weblate (Swedish) Currently translated at 75.0% (12 of 16 strings) Translated using Weblate (Swedish) Currently translated at 94.4% (68 of 72 strings) Translated using Weblate (Swedish) Currently translated at 90.9% (10 of 11 strings) Translated using Weblate (Swedish) Currently translated at 33.4% (114 of 341 strings) Translated using Weblate (Swedish) Currently translated at 41.3% (700 of 1693 strings) Translation: OpenWrt/LuCI/modules/luci-base Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/sv/ Translated using Weblate (Ukrainian) Currently translated at 4.0% (2 of 49 strings) Translated using Weblate (Ukrainian) Currently translated at 100.0% (3 of 3 strings) Translated using Weblate (Ukrainian) Currently translated at 4.7% (3 of 63 strings) Translation: OpenWrt/LuCI/applications/frps Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfrps/uk/ Translated using Weblate (Ukrainian) Currently translated at 21.3% (16 of 75 strings) Translation: OpenWrt/LuCI/applications/frpc Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfrpc/uk/ Translated using Weblate (Ukrainian) Currently translated at 100.0% (48 of 48 strings) Translated using Weblate (Italian) Currently translated at 3.6% (7 of 191 strings) Translation: OpenWrt/LuCI/applications/banip Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsbanip/it/ Translated using Weblate (Italian) Currently translated at 30.7% (51 of 166 strings) Translation: OpenWrt/LuCI/applications/adblock Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsadblock/it/ Translated using Weblate (Italian) Currently translated at 91.8% (45 of 49 strings) Translated using Weblate (Italian) Currently translated at 42.9% (91 of 212 strings) Translated using Weblate (Italian) Currently translated at 42.2% (715 of 1693 strings) Translation: OpenWrt/LuCI/modules/luci-base Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/it/ Co-authored-by: Giovanni Giacobbi <giovanni@giacobbi.net> Co-authored-by: Hosted Weblate <hosted@weblate.org> Co-authored-by: Kristoffer Grundström <swedishsailfishosuser@tutanota.com> Co-authored-by: Luna Jernberg <droidbittin@gmail.com> Co-authored-by: Simon <swedafone@hotmail.com> Co-authored-by: Tymofij Lytvynenko <till.svit@gmail.com> Co-authored-by: V.K <turbovk@gmail.com> Co-authored-by: Viktor Griph <viktor@griph.se> Signed-off-by: Giovanni Giacobbi <giovanni@giacobbi.net> Signed-off-by: Kristoffer Grundström <swedishsailfishosuser@tutanota.com> Signed-off-by: Luna Jernberg <droidbittin@gmail.com> Signed-off-by: Simon <swedafone@hotmail.com> Signed-off-by: V.K. <turbovk@gmail.com> Signed-off-by: Viktor Griph <viktor@griph.se> Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfirewall/it/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsminidlna/uk/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsnut/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsopkg/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsp910nd/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsradicale2/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsstatistics/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsupnp/it/ Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationswol/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/lucimodulesluci-mod-battstatus/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/lucimodulesluci-mod-battstatus/uk/ Translate-URL: https://hosted.weblate.org/projects/openwrt/lucimodulesluci-mod-dashboard/sv/ Translate-URL: https://hosted.weblate.org/projects/openwrt/lucimodulesluci-mod-dashboard/uk/ Translation: OpenWrt/LuCI/applications/firewall Translation: OpenWrt/LuCI/applications/minidlna Translation: OpenWrt/LuCI/applications/nut Translation: OpenWrt/LuCI/applications/opkg Translation: OpenWrt/LuCI/applications/p910nd Translation: OpenWrt/LuCI/applications/radicale2 Translation: OpenWrt/LuCI/applications/statistics Translation: OpenWrt/LuCI/applications/upnp Translation: OpenWrt/LuCI/applications/wol Translation: OpenWrt/LuCI/modules/luci-mod-battstatus Translation: OpenWrt/LuCI/modules/luci-mod-dashboard |
||
---|---|---|
.. | ||
luasrc | ||
po | ||
root/usr/share/rpcd/acl.d | ||
Makefile | ||
README.md |
wifischedule
Turns WiFi on and off according to a schedule on an openwrt router
Components
- wifischedule: Shell script that creates cron jobs based on configuration provided in UCI and does all the other logic of enabling and disabling wifi with the use of
/sbin/wifi
and/usr/bin/iwinfo
. Can be used standalone. - luci-app-wifischedule: LUCI frontend for creating the UCI configuration and triggering the actions. Depends on wifischedule.
Use cases
You can create user-defined events when to enable or disable WiFi. There are various use cases why you would like to do so:
- Reduce power consumption and therefore reduce CO2 emissions.
- Reduce emitted electromagnatic radiation.
- Force busincess hours when WiFi is available.
Regarding 1: Please note, that you need to unload the wireless driver modules in order to get the most effect of saving power. In my test scenario only disabling WiFi saves about ~0.4 Watt, unloading the modules removes another ~0.4 Watt.
Regarding 2: Think of a wireless accesspoint e.g. in your bedrom, kids room where you want to remove the amount of radiation emitted.
Regarding 3: E.g. in a company, why would wireless need to be enabled weekends if no one is there working? Or think of an accesspoint in your kids room when you want the youngsters to sleep after 10 pm instead of facebooking...
Configuration
You can create an arbitrary number of schedule events. Please note that there is on sanity check done whether the start / stop times overlap or make sense. If start and stop time are equal, this leads to disabling the WiFi at the given time.
Logging if enabled is done to the file /var/log/wifi_schedule.log
and can be reviewed through the "View Logfile" tab.
The cron jobs created can be reviewed through the "View Cron Jobs" tab.
Please note that the "Unload Modules" function is currently considered as experimental. You can manually add / remove modules in the text field.
The button "Determine Modules Automatically" tries to make a best guess determining regarding the driver module and its dependencies.
When un-/loading the modules, there is a certain number of retries (module_load
) performed.
The option "Force disabling wifi even if stations associated" does what it says - when activated it simply shuts down WiFi.
When unchecked, its checked every recheck_interval
minutes if there are still stations associated. Once the stations disconnect, WiFi is disabled.
Please note, that the parameters module_load
and recheck_interval
are only accessible through uci.
UCI Configuration wifi_schedule
UCI configuration file: /etc/config/wifi_schedule
:
config global
option logging '0'
option enabled '0'
option recheck_interval '10'
option modules_retries '10'
config entry 'Businesshours'
option enabled '0'
option daysofweek 'Monday Tuesday Wednesday Thursday Friday'
option starttime '06:00'
option stoptime '22:00'
option forcewifidown '0'
config entry 'Weekend'
option enabled '0'
option daysofweek 'Saturday Sunday'
option starttime '00:00'
option stoptime '00:00'
option forcewifidown '1'
Script: wifi_schedule.sh
This is the script that does the work. Make your changes to the UCI config file: /etc/config/wifi_schedule
Then call the script as follows in order to get the necessary cron jobs created:
wifi_schedule.sh cron
All commands:
wifi_schedule.sh cron|start|stop|forcestop|recheck|getmodules|savemodules|help
cron: Create cronjob entries.
start: Start wifi.
stop: Stop wifi gracefully, i.e. check if there are stations associated and if so keep retrying.
forcestop: Stop wifi immediately.
recheck: Recheck if wifi can be disabled now.
getmodules: Returns a list of modules used by the wireless driver(s)
savemodules: Saves a list of automatic determined modules to UCI
help: This description.