I just received my GL-AR150 and I’m trying to switch off the wifi at certain times of the day (and if possible certain days of the week).
I already asked my question by email before buying it, and I got the answer that it was not possible with the standard GLiNET firmware but I could be done under open wrt, using “Cron”.
I opened the default web interface and saw an tab with “Cron” and some empty space where I could enter some text.
My first question is : is the AR150 using open wrt by default or should I install it myself (and how) ?
My second question is : how can I use the cron tab to set the wifi off at certain times ? (I saw somewhere on the internet that it was possible by adding command lines to certain files on the router… but I cannot figure out how)
Thank you very much, and all the best for this new year !
# Reboot at 4:30am every day
# Note: To avoid infinite reboot loop, wait 70 seconds
# and touch a file in /etc so clock will be set
# properly to 4:31 on reboot before cron starts.
30 4 * * * sleep 70 && touch /etc/banner && reboot
So to disable your wifi at say 11pm every day and enable it again at 6am every day, you would insert this into crontab:
# Disable wifi at 11pm and enable at 6am every day
0 23 * * * uci set wireless.@wifi-device[0].disabled=1; uci commit wireless; wifi
0 6 * * * uci set wireless.@wifi-device[0].disabled=0; uci commit wireless; wifi
then save (Ctrl+x followed by ‘y’ in nano // esc followed by :wq and enter in vi) and reboot the device. Done!
You access the crontab file via ssh using a console / terminal.
vi and nano or simply editor applications with which you can edit files in a terminal environment. Sort of like MS word, but solely with rudimentary functionality and just the resemblance of a minimal graphical interface.
I’m guessing you could just paste the lines I’ve posted on the webinterface; it’s just that I don’t really know it since I haven’t used it thus far.
Yea, you can set any time and date you want. Instead of “0 23 * * *” you would insert “30 23 * * *” for 11.30pm as the first number are minutes, the second number hours, the third number the day and so on.
I find the free tool WinSCP invaluable for editing Linux files from Windows. Just like editing in Notepad.
vi is for masochists.
Set it up like this
File protocol: SCP
Hostname: 192.168.x.1 (use your gateway or router GUI IPaddress) port: 22
username: (same as Luci/GUI) password: (same as Luci/GUI)
Use drop-down box next to the “SAVE” button and save the ID/password if you always have exclusive access to your Windows machine. I normally save the profile with the same name as the IP address. For example for the router gateway I have in one family household which is 192.168.7.1 for the gateway address, I save the profile names as 192.168.7.1 SCP, and that’s just to set it apart from something that could be running on the router that used another protocol like FTP, etc.