Scheduled Tasks WiFi 5G turn off

Hello all,
Since I installed Openwrt on my Archer C7 I've bean trying in every way to make my cron jobs work properly.
I have 3 SSIDs - 2.4 Ghz / 5Ghz / Guests(2.4) . I only user the one with 5Ghz, the other 2 are always off.
So my Scheduled Tasks look like this :

30 23 * * * echo "$(date): WiFi down" >> /root/cron_log.txt && /sbin/wifi down radio0 >> /root/cron_log.txt 2>&1
0 5 * * * echo "$(date): Reboot" >> /root/cron_log.txt && /sbin/reboot >> /root/cron_log.txt 2>&1
0 7 * * * echo "$(date): WiFi up" >> /root/cron_log.txt && /sbin/wifi up radio0 >> /root/cron_log.txt 2>&1 && iw dev | grep radio0 >> /root/cron_log.txt

The first cron job works, the second(reboot) also works, BUT the 3'd one not always. Sometimes at 6:50AM my wifi is UP. Sometimes at 7:30AM my wifi is still DOWN...and I have no ideea why.
Does something happens to the cron jobs after rebooting the router ?

In what timezone?

this is an excellent way to slowly kill your flash.

1 Like

Daily (or anything more often than for full upgrade) reboot is unnecessary, you should identify underlying problem if there is any.
There is wifischedule package for your purpose.

Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
grafik
Remember to redact passwords, MAC addresses and any public IP addresses you may have:

ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall

Thank you for the response. Rebooting it's for me more like muscle memory. I work with a lot of routers, and they all misbehave if I don't reboot them once a month...I guess linux is way more reliable.
I will post the result as soon as I have access to the router. Are you looking for something in particular ?

model+build just to backtrack on bugs etc

This all I can give, the others have A LOT of sensitive info, so no.

 root@OpenWrt:~# ubus call system board
{
        "kernel": "5.15.162",
        "hostname": "OpenWrt",
        "system": "Qualcomm Atheros QCA9558 ver 1 rev 0",
        "model": "TP-Link Archer C7 v2",
        "board_name": "tplink,archer-c7-v2",
        "rootfs_type": "squashfs",
        "release": {
                "distribution": "OpenWrt",
                "version": "23.05.4",
                "revision": "r24012-d8dd03c46f",
                "target": "ath79/generic",
                "description": "OpenWrt 23.05.4 r24012-d8dd03c46f"
        }
}

I found on some sites, command like also using "uci commit wireless" and chatgpt did give me this option to temporarly turn radio0 off(in my case), what do you think ?

uci set wireless.radio0.disabled=0 && uci commit wireless && /etc/init.d/
network restart

It feels like overkill to do this 2 times a day

Stop reinventing the wheel.

Since you cannot provide wireless+network+firewall you are on your own as nobody can guess what is in them.

Really ? Have you ever seen "killed flash" because of one write/day ? I have a lot of different devices, doing something similar, (also) to help time sync after boot, and never had a problem with it. Devices are up to 10 yrs old.

cron uses its own, special "environment" when doing its job. Which might be an issue here, as "wifi up/down" creates quite some activity. Using the approach with uci set wireless.radio0.disabled=0/1 looks simpler. You might even consider sed -i 's/wireless.radio.disabled=./wireless.radio.disabled=0/' /etc/config/wireless && uci commit (not shure, whether required) && network restart

Thanks. I'm thinking to first change the reboot time to once per month. And to monitor what happens...what do you think ?

I'd suggest to adapt wifischedule and reboot every 2-6 months as upgrades come out and carefully observe if there is any resource leak to fix.

The upgrade is a bit strange and new for me.
I don't yet know how updated are done in Openwrt. Does the OS notify me when there is a new upgrade ?
Do I have to seek manually ?
Is there a global os upgrade, or individually by router's model ?
Do I have to monitor this site ?

no

update is manual ...

it's global, per device.

you should be able to subscribe to new threads in https://forum.openwrt.org/c/announcements/14, where the announcements are made.

1 Like

thank you so much for the detailed info !!

Still I noticed a difference of versions
If I search for "TP-Link Archer C7 v2" here, I get the latest version : 23.05.3
and
If I search for "TP-Link Archer C7 v2" here, I get : 23.05.4
so why is that ?

If device support is somehow omitted in minor patch release it always lands in release notes , and obviously firmware selector has no image available.

ToH haven't been updated, it's manual work.

1 Like