openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.29k stars 2.51k forks source link

luci-app-wifischedule - turns wifi off after power loss even if it is not time #7299

Open Mile-Lile opened 3 hours ago

Mile-Lile commented 3 hours ago

Steps to reproduce:

Example: Replace the following lines and remove this

  1. go to: Services→ WiFI Schedule → Enable Wifi Schedule → Enable logging → Enable BUSINESSHOURS
  2. Enable all days → Start wifi 04:00 → Stop wifi 00:00 → Enable Force disabling wifi even if stations associated
  3. Save & Apply
  4. reboot router (simulate power off) in e.g. 17:00

Actual behavior:

Router starts with wifi off even if it is BUSINESSHOURS when wifi should be on

Expected behavior:

Wifi should be on (regardless of rebooting), and should be off at the midhinght, script should check clock somehow

Additional Information:

OpenWrt version information from system /etc/openwrt_release

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='SNAPSHOT'
DISTRIB_REVISION='r27598-603a3c6955'
DISTRIB_TARGET='mediatek/filogic'
DISTRIB_ARCH='ARMv8 Processor rev 4'
DISTRIB_DESCRIPTION='OpenWrt SNAPSHOT r27598-603a3c6955 / LuCI Master 24.264.56398~8449716'
ROUTER_MODEL='Xiaomi Mi Router AX3000T (OpenWrt U-Boot layout)'
Mile-Lile commented 3 hours ago

and these are errors from my logs, look at 19:19:44

image

systemcrash commented 1 hour ago

The problem abstractly is that on/off is not a process, but a result. And if the time for this result has already passed, it won't be triggered. The actual problem with processing is not in this repo, but in the wifischedule app.

You might try to set the stop time to 23:59 to see whether this is an edge case problem.

It's also possible that your router has no good concept of what time it actually is after a reboot - set also NTP.