openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
3.97k stars 3.46k forks source link

wifischedule - turns wifi off after power loss even if it is not time #25064

Open Mile-Lile opened 3 days ago

Mile-Lile commented 3 days ago

@rindeal

wifischedule - turns wifi off after power loss even if it is not time


Steps to reproduce:

  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)'

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

image

rindeal commented 3 days ago

Thanks for the report, will look into it.

systemcrash commented 3 days ago

@rindeal - wonder whether you could also tweak the scripts to ensure they run after NTP time syncs? To exclude the possibility that a device with skewed clock doesn't make changes until it's synched to a realistic time source.

On my system, sysntpd runs with prio 98. So this should run at at least 99.

rindeal commented 3 days ago

On my system, sysntpd runs with prio 98. So this should run at at least 99.

It currently has a value of 100, which is invalid, it should be 99 indeed. https://github.com/openwrt/packages/blob/6b57e44dc5b19a67d23003b3605a2aa9f0de1929/net/wifischedule/net/etc/init.d/wifi_schedule#L4