SES / AOSS / EZ-SETUP / WPS Button function/config

Suggest improvements and new features for Gargoyle.

Moderator: Moderators

Post Reply
Wurstsalat
Posts: 2
Joined: Wed Feb 20, 2013 4:06 pm

SES / AOSS / EZ-SETUP / WPS Button function/config

Post by Wurstsalat »

Hi,

would like to see that the SES / AOSS / EZ-SETUP / WPS Button on some Routers are able to disable/enable wifi like in ddwrt.

Thats it ;)

mtr
Posts: 29
Joined: Sun Oct 28, 2012 1:14 pm

Re: SES / AOSS / EZ-SETUP / WPS Button function/config

Post by mtr »

wifitoggle package can do that.

Wiki: http://wiki.openwrt.org/doc/uci/wifitoggle

zhmjwo
Posts: 3
Joined: Tue May 06, 2014 1:51 am

Re: SES / AOSS / EZ-SETUP / WPS Button function/config

Post by zhmjwo »

FireVortex wrote:wifitoggle package can do that.

Wiki: http://wiki.openwrt.org/doc/uci/wifitoggle
wifitoggle can not use.After pressed the botton for turning
wifi on once,it will automatically switch off every 15 minutes.

mtr
Posts: 29
Joined: Sun Oct 28, 2012 1:14 pm

Re: SES / AOSS / EZ-SETUP / WPS Button function/config

Post by mtr »

zhmjwo wrote:
FireVortex wrote:wifitoggle package can do that.

Wiki: http://wiki.openwrt.org/doc/uci/wifitoggle
wifitoggle can not use.After pressed the botton for turning
wifi on once,it will automatically switch off every 15 minutes.
Oh, right. Well, I use a custom made "wifionoff" shell script (wifionoff.sh.gz). I attached it to this message. Feel free to download and test.

To get it running you must:

1º) Unzip the file wifionoff.sh.gz
2º) Copy wifionoff.sh to /usr/bin/ on your router
3º) Give execute permission to the script with: chmod +x wifionoff.sh
4º) Copy the following code and paste it in your /etc/config/system file

Code: Select all

config button 'wifionoff'
	option button 'wps'
	option action 'released'
	option handler '/usr/bin/wifionoff.sh &'
	option min '0'
	option max '2'
5º) Restart your router
6º) Profit!!

NOTE: the script is running and working fine on my TP-LINK TL1043ND v1.8 so pay attention to the field option button 'wps' because the 'wps' string may change in another router models or brands.
Take a look to the documentation: http://wiki.openwrt.org/doc/howto/hardware.button
Attachments
wifionoff.sh.gz
WiFi On/Off Shell Script
(220 Bytes) Downloaded 581 times

zhmjwo
Posts: 3
Joined: Tue May 06, 2014 1:51 am

Re: SES / AOSS / EZ-SETUP / WPS Button function/config

Post by zhmjwo »

FireVortex wrote:
zhmjwo wrote:
FireVortex wrote:wifitoggle package can do that.

Wiki: http://wiki.openwrt.org/doc/uci/wifitoggle
wifitoggle can not use.After pressed the botton for turning
wifi on once,it will automatically switch off every 15 minutes.
Oh, right. Well, I use a custom made "wifionoff" shell script (wifionoff.sh.gz). I attached it to this message. Feel free to download and test.

To get it running you must:

1º) Unzip the file wifionoff.sh.gz
2º) Copy wifionoff.sh to /usr/bin/ on your router
3º) Give execute permission to the script with: chmod +x wifionoff.sh
4º) Copy the following code and paste it in your /etc/config/system file

Code: Select all

config button 'wifionoff'
	option button 'wps'
	option action 'released'
	option handler '/usr/bin/wifionoff.sh &'
	option min '0'
	option max '2'
5º) Restart your router
6º) Profit!!

NOTE: the script is running and working fine on my TP-LINK TL1043ND v1.8 so pay attention to the field option button 'wps' because the 'wps' string may change in another router models or brands.
Take a look to the documentation: http://wiki.openwrt.org/doc/howto/hardware.button
Thanks.the script is also running and working fine on my TP-LINK WR741N v1.6 :D

In my /etc/config/system file,I find that the "wps" button was used for rebooting in default config. So I delete the default config of "wps" button.

mtr
Posts: 29
Joined: Sun Oct 28, 2012 1:14 pm

Re: SES / AOSS / EZ-SETUP / WPS Button function/config

Post by mtr »

zhmjwo wrote: Thanks.the script is also running and working fine on my TP-LINK WR741N v1.6 :D

In my /etc/config/system file,I find that the "wps" button was used for rebooting in default config. So I delete the default config of "wps" button.
You're welcome!! :D

As a side note: you can have as many 'wps' entries as you want. For example, this is a chunk of my system config file:

Code: Select all

config button 'wifionoff'
	option button 'wps'
	option action 'released'
	option handler '/usr/bin/wifionoff.sh &'
	option min '0'
	option max '2'

config button 'restart_wan_connection'
	option button 'wps'
	option action 'released'
	option handler '/usr/bin/restartwan.sh &'
	option min '3'
	option max '5'

config button 'reboot_button'
	option button 'wps'
	option action 'released'
	option handler 'logger reboot ; /usr/lib/gargoyle/reboot.sh ;'
	option min '6'
	option max '90'
The "secret" is, basically, set the min and max options. So, following the example above:

If I press the WPS button:
  • Between 0 and 2 secs ---> Toggle WiFi
    Between 3 and 5 secs ---> Restart WAN
    Between 6 and 90 secs ---> Reboot router
Last edited by mtr on Sat May 10, 2014 10:45 am, edited 1 time in total.

zhmjwo
Posts: 3
Joined: Tue May 06, 2014 1:51 am

Re: SES / AOSS / EZ-SETUP / WPS Button function/config

Post by zhmjwo »

FireVortex wrote:
As a side note: you can have as many 'wps' entries as you want. For example, this is a chunk of my system config file:

Code: Select all

config button 'wifionoff'
	option button 'wps'
	option action 'released'
	option handler '/usr/bin/wifionoff.sh &'
	option min '0'
	option max '2'

config button 'restart_wan_connection'
	option button 'wps'
	option action 'released'
	option handler '/usr/bin/restartwan.sh &'
	option min '3'
	option max '5'

config button 'reboot_button'
	option button 'wps'
	option action 'released'
	option handler 'logger reboot ; /usr/lib/gargoyle/reboot.sh ;'
	option min '6'
	option max '90'
The "secret" is, basically, set the min and max options. So, following the example above:

If a press the WPS button:
  • Between 0 and 2 secs ---> Toggle WiFi
    Between 3 and 5 secs ---> Restart WAN
    Between 6 and 90 secs ---> Reboot router
Great!
I am learning more. 8-)

Post Reply