Page 2 of 4

Re: WiFi button not supported

Posted: Wed Jun 10, 2015 10:20 pm
by Lantis
I have an exam in 6 hours, I'll work on something for you over the next few days.
It will require minimal intervention from you but still some. 2-3 commands at most.
If you can handle that I'll get started.

Re: WiFi button not supported

Posted: Wed Jun 10, 2015 11:06 pm
by wazahuis
Sounds good thanks. Happy to donate towards the project or whatever you like...

Re: WiFi button not supported

Posted: Thu Jun 11, 2015 11:46 pm
by Lantis
no payment necessary. :) thank you for the offer though.

as promised, two commands to run.
Please note: if you are running 1.7.0 or higher, please use http://103.4.16.211/gargoyle_scripts/in ... oggleBB.sh instead. 1.6.2 or less, use installwifitoggleAA.sh

Code: Select all

wget -O /tmp/install.sh http://103.4.16.211/gargoyle_scripts/installwifitoggleAA.sh
sh /tmp/install.sh
once you have run both of those, the changes should be applied.
go and press the wifi button on your router (left button of the two on the front). visibly the 2 wifi LEDs should turn off, but also just confirm by checking the wifi actually goes down.

if it doesn't work, please let me know and i will see if we can fix it. i tested it about a dozen times on my own router however.

Disclaimer to anyone else reading this thread.
this script ONLY WORKS on a WNDR3800.

Re: WiFi button not supported

Posted: Fri Jun 12, 2015 2:10 am
by marrco
i hope you don't mind if i post your script (downloaded on 20150611) here, should you remove it from your website in future. What do you think about opening a github for user contributions to gargoyle?

Code: Select all

#!/bin/sh

#This script enables wifi toggle functionality on the Wifi button (BTN_2)
#of the WNDR3800

(
cat << 'EOF'
#!/bin/sh

STATUS=`wifi status | grep -m 1 up | sed -e 's/^[ \t]*//' -e 's/"up": //'`

if [ "$STATUS" == "true," ]; then
   wifi down
   logger Wifi button pressed, wifi going down
else
   wifi up
   logger Wifi button pressed, wifi going up
fi
EOF
) > /etc/wifitoggle.sh

chmod +x /etc/wifitoggle.sh

uci set system.wifi_toggle=button
uci set system.wifi_toggle.button=BTN_2
uci set system.wifi_toggle.action=pressed
uci set system.wifi_toggle.handler=/etc/wifitoggle.sh
uci commit system

Re: WiFi button not supported

Posted: Sun Jun 14, 2015 1:04 am
by wazahuis
Thanks so much I will give it a try!

Re: WiFi button not supported

Posted: Sun Jun 14, 2015 9:49 pm
by wazahuis
Hi,

I tried it and the commands you gave me seemed to work okay but doesn't seem to fully work. Here is output from SSH commands...
------------------------------------------------------------------
| _____ _ |
| | __ \ | | |
| | | \/ __ _ _ __ __ _ ___ _ _| | ___ |
| | | __ / _` | '__/ _` |/ _ \| | | | |/ _ \ |
| | |_\ \ (_| | | | (_| | (_) | |_| | | __/ |
| \____/\__,_|_| \__, |\___/ \__, |_|\___| |
| __/ | __/ | |
| |___/ |___/ |
| |
|----------------------------------------------------------------|
| Gargoyle version 1.6.2 | OpenWrt Attitude Adjustment branch |
| Gargoyle revision b70bfc1 | OpenWrt revision r42171 |
| Built August 26, 2014 | Target ar71xx/usb_large |
------------------------------------------------------------------
root@Gargoyle:~# wget -O /tmp/install.sh http://103.4.16.130/install.sh
Connecting to 103.4.16.130 (103.4.16.130:80)
install.sh 100% |*******************************| 607 0:00:00 ETA
root@Gargoyle:~# sh /tmp/install.sh
root@Gargoyle:~#
I press the Wifi button and both lights go off. but they flash again and come back on?

Re: WiFi button not supported

Posted: Sun Jun 14, 2015 10:00 pm
by Lantis
Interesting! I didn't realise you're running 1.6.2
I'll downgrade and retest.

Re: WiFi button not supported

Posted: Sun Jun 14, 2015 10:05 pm
by wazahuis
I thought I better install the stable version

Re: WiFi button not supported

Posted: Sun Jun 14, 2015 10:08 pm
by Lantis
of course, that's perfectly fine :)

give me about 30 minutes to do some testing.

Re: WiFi button not supported

Posted: Sun Jun 14, 2015 11:06 pm
by Lantis
try this instead please.

Code: Select all

wget -O /tmp/install.sh http://103.4.16.211/gargoyle_scripts/installwifitoggleAA.sh
sh /tmp/install.sh
i have now uploaded two files, one for installing onto an Attitude Adjustment verison and one for installing onto Barrier Breaker.