Turn off Wi-Fi at night

Hello,

I am running OpenWrt 21.02.0. I would like to turn off the two Wi-Fi interfaces at night. I think a crown job can be used to stop the interfaces and another one can be used to put them up again.

My questions thus are:

  1. Is it OK to use cron for this or there is a better mechanism?
  2. Which command to run in order to turn off a Wi-Fi?
  3. Would it be possible to diminish the TX power instead of turning off and on the interfaces?

Thanks!

ifconfig wlan0 down

ifconfig wlan1 down

Cron job is what you're looking for.

1 Like

Nr3. This is probably more of a hardware question if the possibility even exist.

My experience for wifi lights on wrt3200acm is that they are hard wired to the wifi module control and off limits even though they are selectable in led setup in luci. The router ether crash or I got a lot of kernel error for the wifi module if I touch its original setup.
But to begin with you could try turning the wifi led of in luci if they are selectable there.

My best recommendation for dimming is to put some opaque tape over the LED if you cant put something in front…

I may have missed something, but I didn't see anything about WiFi "lights".

The OP said "interfaces"...for whatever reason.

Intrepid this as the led light, maybe I am wrong?

Yes, it's OK.

0 23 * * * wifi down
0 08 * * * wifi up
0 23 * * * uci set wireless.radio0.txpower=3; uci set wireless.radio1.txpower=3; wifi reload
0 08 * * * uci set wireless.radio0.txpower=20; uci set wireless.radio1.txpower=20; wifi reload

Don't forget to restart the cron service.

3 Likes

"luci-app-wifischedule" does it for me every day. Off at nite and on in the AM.

1 Like