TP-link archer c7 ver 4 cron

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page 1, 2  Next
Author Message
Eber
DD-WRT Novice


Joined: 19 Mar 2020
Posts: 12

PostPosted: Sat Mar 28, 2020 20:20    Post subject: TP-link archer c7 ver 4 cron Reply with quote
I am using build r42803.
In Administration cron I put

15 11 * * 6 root iw dev ath0 startservice radio_off
30 12 * * 6 root iw dev ath0 startservice radio_on

and after apply settings, rebooted the router (unplugged).

I was attempting to turn off ath0 at 11:15 am
and turn it back on at 12:30 .
All I have tried does not work. I think it was kong that suggested something similar to this. Might I get some easy to follow help on this?
I just want to kill that radio for the time I specified on Saturday.
Thanks much
Sponsor
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Sun Mar 29, 2020 0:42    Post subject: Hourly ON/OFF Reply with quote
You can do this hourly, via the webGUI, Wireless - Basic Settings - Radio Scheduling section.

I am not sure what command it is running to do it though.

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Eber
DD-WRT Novice


Joined: 19 Mar 2020
Posts: 12

PostPosted: Sun Mar 29, 2020 11:18    Post subject: Reply with quote
I have not seen in Radio Scheduling where I could just shut off the Radio at 11:15 to 12:30.
Or that it would be just on Saturday.
And I did already look into Radio Scheduling.
Thank you for your input, but I need help with the
Administration Cron entry.
Thanks
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Sun Mar 29, 2020 12:43    Post subject: Found the solution Reply with quote
It took some digging but I found the solution: https://forum.dd-wrt.com/phpBB2/viewtopic.php?p=1083400#1083400

That script should work.

I can see you said you already tried it. Do you know how where to paste the scripts in the webGUI?

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Eber
DD-WRT Novice


Joined: 19 Mar 2020
Posts: 12

PostPosted: Sun Mar 29, 2020 15:09    Post subject: Reply with quote
I believe-
Service commands but not sure if it should be Startup or what.
Are you saying I need to use that entire script for ath0 on or off?
I downloaded plazmas txt attachment.
I did not try that specific one as I was not sure of it.Yet.
The second user variable set confused me totally.
thanks
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Sun Mar 29, 2020 16:41    Post subject: User Variables Reply with quote
In your case the user variables should be, ath0 is 2.4GHz only, add ath1 for 5GHz:

IFNAME=ath0

START="0030"
STOP="2315"

Make sure they are in 24 hour time.

The NTP server at the top can be changed to whatever pool.ntp server you use. I use one of the Canadian ones, 0.ca.pool.ntp.org

From my understanding it all must be saved as a Startup script. Note this comment in the script as well:
# DONT FORGET TO ADD THE CRONTAB JOB IN THE GUI (SANS QUOTES)
# "* * * * * root /bin/sh /tmp/wifi_cron_switch_run.sh"

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
msoengineer
DD-WRT Guru


Joined: 21 Jan 2017
Posts: 1783
Location: Illinois Moderator

PostPosted: Sun Mar 29, 2020 16:49    Post subject: Reply with quote
FWIW, I seem to recall that putting in your own NTP yielded issues with the router and it not using them...best to just use the dropdown and choose your region/territory and let dd-wrt use the built-in servers it uses. AFAIK, I never saw/read that the manual ntp address got corrected.
_________________
FORUM RULES

TIPS/TRICKS: Best QCA Wifi Settings | Latency tricks | QoS Port priority | NEVER USE MU-MIMO |
Why to NOT use MU-MIMO | Max Wifi Pwr by Country | Linux Wifi Pwr | AC MCS & AX MCS | QCA 5Ghz chnls to use | WIFI Freq WIKI | TFTP R7800 | Don't buy AX | IPERF3 How-To

[R9000]52396 nightly (Main Router)
[EA8500]43192 & 45493 (2xOffsite)
[R7800] resting
[WDR3600]BS 44715 (Offsite)
[A7v5]BS 43038 (Offsite+spare napping)
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Sun Mar 29, 2020 16:55    Post subject: NTP server Reply with quote
Yes, but this NTP server is part of the script ran as dd-wrt is booting up. Separate from the NTP server on the bottom of the Setup page.
_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Eber
DD-WRT Novice


Joined: 19 Mar 2020
Posts: 12

PostPosted: Mon Mar 30, 2020 11:51    Post subject: Reply with quote
Thank you for your information so far.
I need a bit of help understanding the on off time.
1. I am guessing 0030 is 12:30 am?
2. It looks like the way this is written, if i did not put a start time in the router would never enable ath0 It would always be off.
So for Saturday morning 11:15 am to 12:30 pm
start 1115
stop 0130
Wouldnt that only turn the radio on for that short period of time?
If so, I would need 2 entries
start 0030 0130
stop 1115 2330

Allow me to give a brief explanation why i dont just go try this. It is my church router, i would have to go back and forth in my car to test these things each time i learned something new. We livestream at 11:15am and the church members wont get their butts off the net and we have limited upload.
The goal is to force them off for that period of time.
It would seem like there would be a simpler way to keep em off for that period of time. I even tried setting my tablet to static ip (cause i do need net access) and set the restriction range of ips to all given by the router (100-150)with all static beginning at 2.
I thought that should have worked but it did not kick off anybody already on.
I just need to wrap my head around that start and stop
and the admin cron entry- because it does not show stopservice startservice or something like ath0 off, ath0 on ect ect.
Thanks
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Mon Mar 30, 2020 13:40    Post subject: DD-WRT at home Reply with quote
Do you have a DD-WRT router at home to test it on? If not, I will try and test it today. I have way to many routers to test it on.
_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Eber
DD-WRT Novice


Joined: 19 Mar 2020
Posts: 12

PostPosted: Mon Mar 30, 2020 17:42    Post subject: Reply with quote
unbelievable since i never throw any out, but not one atheros at home to try it on.
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Mon Mar 30, 2020 23:25    Post subject: Script Works Reply with quote
Set the START time to when you want to Turn wifi on.
Set the STOP time to when you want it to turn off.

Not, START must be before STOP time. Each START must have a corresponding STOP time.

So, you want to turn off wifi between, 11:15 am to 12:30 pm.

Then use:

START="0000 1230"
STOP="1115 2359"

If you have a dual band router, use:
IFNAME ath0 ath1

I left the NTP server as it was and it worked fine.

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Eber
DD-WRT Novice


Joined: 19 Mar 2020
Posts: 12

PostPosted: Tue Mar 31, 2020 13:25    Post subject: Reply with quote
I tried it and I put in the admin crontab

15 11 * * 6 root /bin/sh /tmp/wifi_cron_switch_run.sh

I tried with quotes and without , but it did not work.
the crontab job is written wrong?
11:15 saturday to run?
I also only used ath0 as I wished ath1 to stay on.
Did that mess it up?

thanks
yoyoma2
DD-WRT User


Joined: 24 Sep 2016
Posts: 372

PostPosted: Sun Apr 05, 2020 6:12    Post subject: Reply with quote
Are you setting using the GUI in "Administration->Management->Additional Cron Jobs" and have the radio button "Cron" set to "Enable"? Make sure your build is r41189 or bigger since cron was unreliable before that.
Code:
15 11 * * 6 root nvram set ath0_net_mode="disabled" && kill -1 1
30 12 * * 6 root nvram set ath0_net_mode="enabled" && kill -1 1

If that doesn't work, you could try rebooting after changing the setting so by the up time in the top right corner, you'll know if your cron job ran or not.
Code:
15 11 * * 6 root nvram set ath0_net_mode="disabled" && reboot
30 12 * * 6 root nvram set ath0_net_mode="enabled" && reboot
God bless you for helping a church.
ian5142
DD-WRT Guru


Joined: 23 Oct 2013
Posts: 2319
Location: Canada

PostPosted: Sun Apr 05, 2020 12:21    Post subject: Cron script Reply with quote
You put the time you want in the initial script, on and off time (the part that is saved a startup script). Then you set the cron script to all stars, so it runs every minute.

You only have the script start running at 11:15am, by the time it gets to turning off the wifi section, it is probably not 11:15am anymore.

_________________
Before asking a question on the forums, update dd-wrt: Where do I download firmware? I suggest reading it all.
QCA Best WiFi Settings


Some dd-wrt wiki pages are up to date, others are not. PM me if you find an old one.

Atheros:
Netgear R7800 x3 - WDS AP / station, gateway, QoS
TP-Link Archer C7 v2 x2 - WDS Station
TP-Link TL-WDR3600 v1 - WDS Station
TP-Link 841nd v8 - NU
D-Link 615 C1/E3/I1 x 7 - 1 WDS station
D-Link 825 B1 - NU
D-Link 862L A1 x2 - WDS Station
Netgear WNDR3700v2 - NU
UBNT loco M2 x2 - airOS

Broadcom
Linksys EA6400 - Gateway, QoS
Asus N66U - AP
Netgear WNDR3700v3 - not used
MediaTek
UBNT EdgeRouter X - switch
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware 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