openwrt / luci

LuCI - OpenWrt Configuration Interface
Apache License 2.0
6.38k stars 2.53k forks source link

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

Closed Mile-Lile closed 1 month ago

Mile-Lile commented 1 month 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 1 month ago

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

image

systemcrash commented 1 month 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.

Mile-Lile commented 1 month ago

@systemcrash @openwrt@newk.it thx Paul... I reported here because link here points to github luci, although it makes no sense that problem is in GUI... it is just simpe script that changes cron... how can I find the author of the script?

I have ntp enabled... so probably script should wait execution after time sync....

hnyman commented 1 month ago

because link here points to github luci, although it makes no sense that problem is in GUI

Well, you should look into the actual underlying functional package "wifischedule" instead of the GUI for it.

@newkit seems to be the original author of the package, and @rindeal seems to have modified the startup functionality latest... https://github.com/openwrt/packages/commits/3724047164218a58948933bf61eb089d36b67074/net/wifischedule

Mile-Lile commented 1 month ago

@hnyman Hannu thx, will try to reach them..

newkit commented 1 month ago

@Mile-Lile May I kindly ask you to open an issue here?

Mile-Lile commented 1 month ago

@newkit I opened new ticked as suggested, in #25064 so I will close this one...