WiFi button not supported

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: WiFi button not supported

Post 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.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

wazahuis
Posts: 9
Joined: Tue Jun 09, 2015 6:18 pm

Re: WiFi button not supported

Post by wazahuis »

Sounds good thanks. Happy to donate towards the project or whatever you like...

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: WiFi button not supported

Post 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.
Last edited by Lantis on Sun Jun 14, 2015 11:19 pm, edited 1 time in total.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

marrco
Posts: 47
Joined: Fri Dec 26, 2014 1:00 pm

Re: WiFi button not supported

Post 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

wazahuis
Posts: 9
Joined: Tue Jun 09, 2015 6:18 pm

Re: WiFi button not supported

Post by wazahuis »

Thanks so much I will give it a try!

wazahuis
Posts: 9
Joined: Tue Jun 09, 2015 6:18 pm

Re: WiFi button not supported

Post 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?

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: WiFi button not supported

Post by Lantis »

Interesting! I didn't realise you're running 1.6.2
I'll downgrade and retest.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

wazahuis
Posts: 9
Joined: Tue Jun 09, 2015 6:18 pm

Re: WiFi button not supported

Post by wazahuis »

I thought I better install the stable version

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: WiFi button not supported

Post by Lantis »

of course, that's perfectly fine :)

give me about 30 minutes to do some testing.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Lantis
Moderator
Posts: 6735
Joined: Mon Jan 05, 2015 5:33 am
Location: Australia

Re: WiFi button not supported

Post 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.
http://lantisproject.com/downloads/gargoyle_ispyisail.php for the latest releases
Please be respectful when posting. I do this in my free time on a volunteer basis.

Post Reply