luci/applications/luci-app-wifischedule
Hosted Weblate e97f1b6086
Translated using Weblate (Greek)
Currently translated at 96.6% (29 of 30 strings)

Translation: OpenWrt/LuCI/applications/acl
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsacl/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 2.7% (1 of 36 strings)

Translation: OpenWrt/LuCI/applications/sqm
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssqm/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 1.6% (1 of 60 strings)

Translation: OpenWrt/LuCI/applications/frps
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsfrps/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 3.0% (2 of 65 strings)

Translation: OpenWrt/LuCI/applications/yggdrasil
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsyggdrasil/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 4.2% (4 of 95 strings)

Translation: OpenWrt/LuCI/applications/vpn-policy-routing
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsvpn-policy-routing/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 3.0% (1 of 33 strings)

Translation: OpenWrt/LuCI/applications/wifischedule
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationswifischedule/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 1.6% (3 of 177 strings)

Translation: OpenWrt/LuCI/applications/unbound
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsunbound/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 18.7% (3 of 16 strings)

Translation: OpenWrt/LuCI/applications/udpxy
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsudpxy/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 33.3% (2 of 6 strings)

Translation: OpenWrt/LuCI/applications/squid
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssquid/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 59.4% (60 of 101 strings)

Translation: OpenWrt/LuCI/applications/simple-adblock
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationssimple-adblock/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 8.3% (1 of 12 strings)

Translation: OpenWrt/LuCI/applications/shairplay
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsshairplay/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 2.6% (3 of 115 strings)

Translation: OpenWrt/LuCI/applications/radicale
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsradicale/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 6.5% (4 of 61 strings)

Translation: OpenWrt/LuCI/applications/ocserv
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsocserv/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 4.2% (2 of 47 strings)

Translation: OpenWrt/LuCI/applications/mjpg-streamer
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsmjpg-streamer/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 4.6% (3 of 64 strings)

Translation: OpenWrt/LuCI/applications/dnscrypt-proxy
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsdnscrypt-proxy/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 4.0% (1 of 25 strings)

Translation: OpenWrt/LuCI/applications/dcwapd
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsdcwapd/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 90.9% (10 of 11 strings)

Translation: OpenWrt/LuCI/applications/bcp38
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsbcp38/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 100.0% (1 of 1 strings)

Translation: OpenWrt/LuCI/applications/attendedsysupgrade
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsattendedsysupgrade/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 2.9% (5 of 172 strings)

Translation: OpenWrt/LuCI/applications/aria2
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsaria2/el/

Signed-off-by: george k <norhorn@gmail.com>

Translated using Weblate (Greek)

Currently translated at 1.7% (1 of 58 strings)

Translation: OpenWrt/LuCI/applications/uhttpd
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsuhttpd/el/

Translated using Weblate (Greek)

Currently translated at 0.8% (1 of 112 strings)

Translation: OpenWrt/LuCI/applications/radicale2
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsradicale2/el/

Translated using Weblate (Greek)

Currently translated at 1.5% (2 of 132 strings)

Translation: OpenWrt/LuCI/applications/nut
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsnut/el/

Translated using Weblate (Greek)

Currently translated at 23.4% (11 of 47 strings)

Translation: OpenWrt/LuCI/applications/minidlna
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsminidlna/el/

Translated using Weblate (Greek)

Currently translated at 100.0% (4 of 4 strings)

Translation: OpenWrt/LuCI/applications/coovachilli
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationscoovachilli/el/

Translated using Weblate (Greek)

Currently translated at 15.9% (31 of 194 strings)

Translation: OpenWrt/LuCI/applications/olsr
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsolsr/el/

Translated using Weblate (Greek)

Currently translated at 36.9% (27 of 73 strings)

Translation: OpenWrt/LuCI/applications/tinyproxy
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationstinyproxy/el/

Translated using Weblate (Greek)

Currently translated at 100.0% (32 of 32 strings)

Translation: OpenWrt/LuCI/applications/ahcp
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsahcp/el/

Translated using Weblate (Greek)

Currently translated at 12.8% (39 of 304 strings)

Translation: OpenWrt/LuCI/applications/statistics
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationsstatistics/el/

Translated using Weblate (Greek)

Currently translated at 10.5% (6 of 57 strings)

Translation: OpenWrt/LuCI/applications/polipo
Translate-URL: https://hosted.weblate.org/projects/openwrt/luciapplicationspolipo/el/

Translated using Weblate (Greek)

Currently translated at 95.2% (1285 of 1349 strings)

Translation: OpenWrt/LuCI/modules/luci-base
Translate-URL: https://hosted.weblate.org/projects/openwrt/luci/el/

Signed-off-by: george k <norhorn@gmail.com>
2020-04-25 18:37:11 +02:00
..
luasrc applications: add ACL dependency annotations to legacy controllers 2020-04-19 17:17:26 +02:00
po Translated using Weblate (Greek) 2020-04-25 18:37:11 +02:00
root/usr/share/rpcd/acl.d treewide: stage ACL rules for legacy applications 2020-04-10 23:21:35 +02:00
Makefile treewide: move server side CBI support to luci-compat 2019-11-03 20:49:31 +01:00
README.md treewide: Fix typos in comments 2018-10-10 15:00:07 +08:00

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:

  1. Reduce power consumption and therefore reduce CO2 emissions.
  2. Reduce emitted electromagnatic radiation.
  3. 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.