WLAN on/off during night

Will Turris Omnia support a software function to use a timetable to activate and deactivate WLAN (e.g. during the night when it is not needed)?
Best regards
Harald

It is supported in LuCI as a Scheduled Task.

30 22 * * * wifi down
30 6 * * * wifi up

will disable your wifi at 22:30 (10:30 pm) and enable it at 6:30. This will not keep wifi disabled if the router is rebooted while wifi is disabled.
Cron and crontab [Old OpenWrt Wiki] gives some hints how scheduled tasks are specified.

4 Likes

Thank You!!!

Hi, I’ve added these 2 lines via LuCI in System\Scheduled Tasks and Submit… but not working. WiFi is on entire day. Sorry for such beginner’s question, but any idea what I’m doing wrong?

Hi!
Go to System --> Startup and check if cron is enabled. If not, enable it and reboot.

Hi, cron was enabled before and still is. There must be some other problem why it is not working :frowning:

In messages I found this:

2016-10-31T01:28:55+01:00 info cron[4821]: (CRON) STARTUP (V5.0)
2016-10-31T01:28:55+01:00 info cron[4821]: (root) BAD FILE MODE (crontabs/root)

It’s should be also related to yours problem.

FIX: /etc/crontabs (folder needs permissions: 0644 ----> chmod 0644 /etc/crontab )

When I did this, it works :slight_smile:

Thanks for hints. Cron is up and running for me as well.
The process was listed as enabled is System --> Startup. I tried to disable and re-enable that again there.
Surprisingly, it works now.

Hi,
Im having same issue. Actually I have changed chmod of crontab/root file and it started to work (the wifi turned off by schedule), but in the mornig it did not turn on again …
Any advice?
Thank you
Lukas

Nobody?
I tryed to google some solution but got stucked.
My cron looks like
*/5 * * * * /sbin/fan_ctrl.sh
59 23 * * * wifi down
01 06 * * * wifi up

“wifi down” works well, but “wifi up” never works. I also tryed “reboot” byt it also doesnt work.
But when I run “wifi up” in putty console it works perfectly.
So for some reason CRON does not run “wifi up” but is able ro run “wifi down”

Do you see any strange things from cron in yours file called: messages (/tmp/log)?

these things
2016-11-06T12:00:01+01:00 info cron[28763]: (root) CMD ( /usr/bin/notifier)
2016-11-06T12:00:01+01:00 info cron[28764]: (root) CMD (nethist_stats.lua)
2016-11-06T12:00:01+01:00 info cron[28765]: (root) CMD (/usr/bin/watchdog.sh)
2016-11-06T12:00:01+01:00 info cron[28759]: (root) CMD (/usr/bin/get-api-crl)
2016-11-06T12:00:01+01:00 info cron[28768]: (root) CMD (/sbin/fan_ctrl.sh)
2016-11-06T12:00:01+01:00 info cron[28766]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2016-11-06T12:00:02+01:00 warning watchdog[]: Restarted nethist
2016-11-06T12:01:01+01:00 info cron[28887]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2016-11-06T12:02:01+01:00 info cron[28925]: (root) CMD (nethist_stats.lua)
2016-11-06T12:02:01+01:00 info cron[28926]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2016-11-06T12:03:01+01:00 info cron[28964]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2016-11-06T12:04:01+01:00 info cron[29003]: (root) CMD (nethist_stats.lua)
2016-11-06T12:04:01+01:00 info cron[29004]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2016-11-06T12:05:01+01:00 info cron[29044]: (root) CMD ( /usr/bin/notifier)
2016-11-06T12:05:01+01:00 info cron[29046]: (root) CMD (/usr/bin/watchdog.sh)
2016-11-06T12:05:01+01:00 info cron[29049]: (root) CMD (/usr/bin/rainbow_button_sync.sh)
2016-11-06T12:05:01+01:00 info cron[29050]: (root) CMD (/sbin/fan_ctrl.sh)
2016-11-06T12:06:01+01:00 info cron[29149]: (root) CMD (nethist_stats.lua)
2016-11-06T12:06:01+01:00 info cron[29150]: (root) CMD (/usr/bin/rainbow_button_sync.sh)

but I believe that ist part of the system

This is not related to WLAN or for what you need :confused:

As you said unfortunately it is related to system.

Hi,
for me is working “wifi on” instead of “wifi up”…

well there are not any messages realted to wlan

well I can try Wifi On, but the weird thing is that Wifi Up works in console, but does not work in cron

You could try this:

01 06 * * * wifi up >/tmp/errors 2>&1

After the time has passed you could try to see if there is file /tmp/errors and what it contains.

OK, let me try this and will reply

well, it didnt create any error file … :frowning:

Then it seems it didn’t even run the command. Check if there are any special invisible characters in the cron file.