How to configure WPS Button on a R7000

Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC based Hardware
Author Message
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Thu Mar 22, 2018 5:19    Post subject: How to configure WPS Button on a R7000 Reply with quote
I have a couple of Families with R7000s and I would would like to configure the the WPS Button as a REBOOT function when pressed for at least 5sec.

TIA!

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
Sponsor
Malachi
DD-WRT Guru


Joined: 17 Jul 2012
Posts: 7209
Location: Columbus, Ohio

PostPosted: Thu Mar 22, 2018 9:25    Post subject: Reply with quote
Why not use the power button? It's already configured for rebooting if pressed twice.
_________________
I am far from a guru, I'm barely a novice.


Last edited by Malachi on Thu Mar 22, 2018 15:21; edited 1 time in total
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Thu Mar 22, 2018 14:29    Post subject: Reply with quote
The Power Button on the R7000 is a push-switch and it will loose power when pressed which I don't want since I have Shut Down Scripts. I guess you mean the Reset Button? Well the Reset button is not easily accessible when mounted 6-7ft above the floor on a wall vertically. The WPS is very easily accessible.
_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
Malachi
DD-WRT Guru


Joined: 17 Jul 2012
Posts: 7209
Location: Columbus, Ohio

PostPosted: Thu Mar 22, 2018 15:20    Post subject: Reply with quote
No, I meant power button.
If you turn the wps button into a reboot button it will do the same thing. A reboot is a reboot regardless of what button you use.

Isn’t a reboot a shut down and powering up regardless of button?
Pull the plug at the wall.

_________________
I am far from a guru, I'm barely a novice.
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2670
Location: Indy

PostPosted: Thu Mar 22, 2018 17:01    Post subject: Reply with quote
Malachi wrote:
Isn’t a reboot a shut down and powering up regardless of button?
Except...
mac913 wrote:
which I don't want since I have Shut Down Scripts.
Why is the reboot needed exactly? Can you have a batch file script to run on the client side to trigger the shutdown?
_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
OPNsense x64 5050e ITX|DD: DIR-810L, 2*EA6900@1GHz, R6300v1, RT-N66U@663, WNDR4000@533, E1500@353,
WRT54G{Lv1.1,Sv6}@250
|FreshTomato: F7D8302@532|OpenWRT: F9K1119v1, RT-ACRH13, R6220, WNDR3700v4
Malachi
DD-WRT Guru


Joined: 17 Jul 2012
Posts: 7209
Location: Columbus, Ohio

PostPosted: Thu Mar 22, 2018 17:37    Post subject: Reply with quote
I guess I’m still confused. I don’t know anything about scripts. I’m just going by logic. Doesn’t the op want to basically turn the wps button into a power switch?
Isn’t a reboot the same as power down and power up?

_________________
I am far from a guru, I'm barely a novice.
BR07H3R
DD-WRT User


Joined: 24 Dec 2017
Posts: 135

PostPosted: Fri Mar 23, 2018 0:07    Post subject: Reply with quote
What you are talking about is like pulling the plug on a Windows machine. Hard shutdown it can't clean house etc when you pull the plug
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Fri Mar 23, 2018 1:45    Post subject: Reply with quote
OK found my answer on this post...

https://www.dd-wrt.com/phpBB2/viewtopic.php?p=1038306


Since I have a USB mounted with a /jffs/etc/config directory, I created an executable file named "button.sesbutton" (without quotes) with the following code in it...

#!/bin/sh
reboot

Hold the R7000's WPS button until the power LED changes from white orange and let go and the R7000 reboots.

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
jwh7
DD-WRT Guru


Joined: 25 Oct 2013
Posts: 2670
Location: Indy

PostPosted: Fri Mar 23, 2018 3:06    Post subject: Reply with quote
Malachi wrote:
Doesn’t the op want to basically turn the wps button into a power switch?
Isn’t a reboot the same as power down and power up?
He wants it to initiate the 'reboot' command; softare vs hardware reboot, as alluded by BR07H3R:
mac913 wrote:
I would would like to configure the the WPS Button as a REBOOT function when pressed for at least 5sec.
...so that shutdown scripts can run before the hardware reboot is triggered.

If you watch serial output after running the 'reboot' command, you'll see it cleaning up before the h/w reboot.

_________________
# NAT/SFE/CTF: limited speed w/ DD # Repeater issues # DD-WRT info: FAQ, Builds, Types, Modes, Changes, Demo #
OPNsense x64 5050e ITX|DD: DIR-810L, 2*EA6900@1GHz, R6300v1, RT-N66U@663, WNDR4000@533, E1500@353,
WRT54G{Lv1.1,Sv6}@250
|FreshTomato: F7D8302@532|OpenWRT: F9K1119v1, RT-ACRH13, R6220, WNDR3700v4
mac913
DD-WRT Guru


Joined: 02 May 2008
Posts: 1848
Location: Canada

PostPosted: Fri Mar 23, 2018 5:12    Post subject: Reply with quote
I don't have a serial connection setup. But I did add a "sleep 60" in the GUI Commands -> Shutdown and it took a minute longer to shutdown plus viewing "top" showed YAMon3.3.5 closing before reboot.

I changed the script to also check that the GUI "Use SES Button to remove drives" is disabled....

Code:

root@DD-WRT:~# cat /jffs/etc/config/button.sesbutton
#!/bin/sh

if [ "$(nvram get usb_ses_umount )" = "0" ]; then
        /sbin/reboot
fi
root@DD-WRT:~#

_________________
Home Network on Telus 1Gb PureFibre - 10GbE Copper Backbone
2x R7800 - Gateway & WiFi & 3xWireGuard - DDWRT r53562 Std k4.9

Off Site 1

R7000 - Gateway & WiFi & WireGuard - DDWRT r54517 Std
E3000 - Station Bridge - DDWRT r49626 Mega K4.4

Off Site 2

R7000 - Gateway & WiFi - DDWRT r54517 Std
E2000 - Wired ISP IPTV PVR Blocker - DDWRT r35531


YAMon 3.4.6 | DNSCrypt-Proxy V2
atomicamp
DD-WRT User


Joined: 16 Apr 2018
Posts: 107
Location: Milwaukee, WI

PostPosted: Sun Nov 18, 2018 14:16    Post subject: Reply with quote
mac913 wrote:
OK found my answer on this post...

https://www.dd-wrt.com/phpBB2/viewtopic.php?p=1038306


Since I have a USB mounted with a /jffs/etc/config directory, I created an executable file named "button.sesbutton" (without quotes) with the following code in it...

#!/bin/sh
reboot

Hold the R7000's WPS button until the power LED changes from white orange and let go and the R7000 reboots.

Do you have any idea if there is a way to make a reboot script that automatically reboots into a different dd-wrt configuration file upon reset? Like, would there be a way to make dd-wrt alternate config files by pressing a button, so, for example, by pressing the button once, it loads stored settings for VPN provider#1, and for pressing the button a second time, it loads config settings for vpn provider#2? This would be a great feature if it was built into the firmware somehow, but I imagine its not. So let me know if you can think of a way to make this possible. Thanks!
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Broadcom SoC 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 can attach files in this forum
You can download files in this forum