Precise Radio Scheduling with DD WRT

As many people know, the DD WRT firmware can turn your standard Linksys/Buffalo router into a powerful networking device. One of the advantages of running a Linux based firmware on your device is the ability to take advantage of the many programs that are provided in a Linux environment. The cron service will allow you to schedule the operation of the wireless radio with more options than the effective yet limited GUI system. The GUI system only allows you to turn the radio on and off on the hour, rather than 15 minutes to, or 10 minutes after. We can use the cron service to make up for this lack of granularity:

Step 1: Disable the web GUI’s radio scheduling (Wireless -> Advanced Settings -> Radio Time Restrictions)


Step 2: Next, move over to the Administration -> Commands tab, and paste your cron schedule into the text box. This configuration creates a schedule that turns the radio on and off at different times depending on the day of the week. From Monday to Thursday, the radio is active from 9:30AM to 8:45PM. On Fridays, it is active from 9:30AM to 5:45PM, on Saturdays it is active from 9:30AM to 4:45PM; it remains off on Sundays. This is useful for a public hotspot that you would like to restrict access to off hours. Note, this command ‘echoes’ the actual cron table into the cron directory. You must click the “Save Startup” button so these commands run everytime your router boots, otherwise the /tmp/ directory will be cleared out on every reboot and no crontab will exist.

echo '30 09 * * 1-4 root /usr/sbin/wl radio on' > /tmp/cron.d/wlanonoff
echo '45 20 * * 1-4 root /usr/sbin/wl radio off' >> /tmp/cron.d/wlanonoff
echo '30 09 * * 5 root /usr/sbin/wl radio on' >> /tmp/cron.d/wlanonoff
echo '45 17 * * 5 root /usr/sbin/wl radio off' >> /tmp/cron.d/wlanonoff
echo '30 09 * * 6 root /usr/sbin/wl radio on' >> /tmp/cron.d/wlanonoff
echo '45 16 * * 6 root /usr/sbin/wl radio off' >> /tmp/cron.d/wlanonoff

It seems necessary to power off the router for about 30 seconds and then reboot it, otherwise unexpected results may occur.

For more information on Cron and the DDWRT firmware, check out the DDWRT wiki’s cron article. For a list of available wireless radio commands, look here.

2 thoughts on “Precise Radio Scheduling with DD WRT”

  1. Hi Mark
    I have a question regarding the precise scheduler on dd wrt on your site.
    Which command do i need to use if i want the scheduler on wl0 (because i have two radios on my router)
    Can u translate whats on your site for wl0?
    Thanks in advance!

    Best regards

  2. Hi Kurt,

    I would think that changing the script to something like the following should do it, unfortunately I don’t have a multiple-radio device to test this out with:

    echo '30 09 * * 6 root /usr/sbin/wl -i wl0 radio on' >> /tmp/cron.d/wlanonoff
    echo '45 16 * * 6 root /usr/sbin/wl -i wl0 radio off' >> /tmp/cron.d/wlanonoff

    Notice the addition of ‘-i wl0’ to the wl command above. If you use the ‘ifconfig’ command you can find out the exact names of the different wireless adapters on your device and pass these to the ‘wl’ command using the -i or -a switches. Please see this page for more info: WL Command

    Let me know how it goes!

Comments are closed.