Scheduled radio on off with cron jobs

Post new topic   Reply to topic    DD-WRT Forum Index -> Ubiquiti Devices
Author Message
mdeixt
DD-WRT Novice


Joined: 29 Jun 2011
Posts: 6

PostPosted: Mon Jul 16, 2012 10:41    Post subject: Scheduled radio on off with cron jobs Reply with quote
Hello,
I'm struggling to make cron jobs to set the antenna to turn wifi off everyday between 22:00 and 09:00. This is what I'm putting in Additional Cron Jobs:
Quote:
0 22 * * 0,1,2,3,4,5,6 root wl radio off
0 9 * * 0,1,2,3,4,5,6 root wl radio on

The device is a NanoStation M2 with firmware v24-sp2.
I must be doing something wrong but I don't know what.
Can anyone help me?
Sponsor
jimford
DD-WRT User


Joined: 20 May 2012
Posts: 71

PostPosted: Tue Jul 17, 2012 11:02    Post subject: Reply with quote
On my DD-WRT v24-sp2 (06/08/12) mini - build 19342, I can do it from the web interface:

Wireless -> Advanced Settings 'Radio Time Restrictions'

Works OK.

Jim
mdeixt
DD-WRT Novice


Joined: 29 Jun 2011
Posts: 6

PostPosted: Tue Jul 17, 2012 11:13    Post subject: Reply with quote
Ok thanks,
I'll have to upgrade my firmware then because I don't have that tab.
jimford
DD-WRT User


Joined: 20 May 2012
Posts: 71

PostPosted: Tue Jul 17, 2012 11:19    Post subject: Reply with quote
I'm surprised - you have V24-SP2 the same as me! I would have thought access restriction was supported. Does this page help?

http://www.dd-wrt.com/wiki/index.php/What_is_DD-WRT%3F#File_Versions

Jim
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Tue Jul 17, 2012 11:43    Post subject: Reply with quote
atheros units downt have

'Radio Time Restrictions'

and NO wl command

_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
mdeixt
DD-WRT Novice


Joined: 29 Jun 2011
Posts: 6

PostPosted: Tue Jul 17, 2012 11:54    Post subject: Reply with quote
So I'd have to reflash the Nanostation to build 19342?

I am currently on 17201.

Thanks
jimford
DD-WRT User


Joined: 20 May 2012
Posts: 71

PostPosted: Tue Jul 17, 2012 12:21    Post subject: Reply with quote
I'm sorry I can't help any further 'fmdeixt' - I'm at the limit of my knowledge with DD-WRT!

Jim
mdeixt
DD-WRT Novice


Joined: 29 Jun 2011
Posts: 6

PostPosted: Tue Jul 17, 2012 12:23    Post subject: Reply with quote
Sorry for being so stupid.

I see now the advanced settings tab, and there is no radio time restrictions option,
so as Sash hinted, it must be impossible.

I'll get a timer switch and be done with it.

Thank you.
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Tue Jul 17, 2012 18:22    Post subject: Reply with quote
so use the iw command
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
mdeixt
DD-WRT Novice


Joined: 29 Jun 2011
Posts: 6

PostPosted: Fri Jul 20, 2012 8:15    Post subject: Reply with quote
Ok thank you,
I'll give it another try.
So the first thing I'm thinking after a bit of reading is settig tx power to 0.
This would be the notation in terminal

Quote:
iw dev <devname> set txpower <auto|fixed|limit> [<tx power in mBm>]


And to adapt it to my particular case in cron jobs I'd replace wl radio off so the result would be like this

Code:
0 22 * * 0,1,2,3,4,5,6 root iw dev wlan0 set txpower fixed 0
0 9 * * 0,1,2,3,4,5,6 root  iw dev wlan0 set txpower fixed 2000


Would this work?

Well, I'll go and try it, even though not with much hope.

m
mdeixt
DD-WRT Novice


Joined: 29 Jun 2011
Posts: 6

PostPosted: Fri Jul 20, 2012 10:08    Post subject: Reply with quote
Well,

In telnet iw dev wlan0 info returns no such device, only phy0 exists and does not accept the set txpower command.

I just don't know what creating a dev interface would do, so I found the limits of my knowledge again.

There's not much documentation for this so I'll have to give up again.

Nice try, thanks.

m
Steve192
DD-WRT Novice


Joined: 22 Apr 2014
Posts: 3

PostPosted: Wed Apr 23, 2014 21:09    Post subject: Reply with quote
i know this is a little late, but maybe for other who don't know the answer.

You can use

Code:
ifconfig ath0 up/down


to turn off and on your wifi module.

Be sure ath0 is the right module ( list all network modules by entering 'ifconfig' )
Also restart lan service to make wifi work again
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Ubiquiti Devices All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum