Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
tp-1043nd_qss_button_on_off_wifi [2012/07/06 23:08]
ispyisail created
tp-1043nd_qss_button_on_off_wifi [2013/06/11 23:11]
sineex [TP-1043ND Qss button on/off wifi]
Line 3: Line 3:
  
  
-I use below code in TP-WR1043ND, ​It work.+I use below code in TP-WR1043ND ​and Gargoyle 1.5.10it works.
  
 <​shell>​ <​shell>​
Line 11: Line 11:
 <​shell>​ <​shell>​
 config '​button'​ '​wifionoff'​ config '​button'​ '​wifionoff'​
-option '​button'​ 'BTN_1'+option '​button'​ 'wps'
 option '​action'​ '​released'​ option '​action'​ '​released'​
 option '​handler'​ '/​sbin/​wifionoff'​ option '​handler'​ '/​sbin/​wifionoff'​
Line 19: Line 19:
  
 config '​led'​ '​led_onoff'​ config '​led'​ '​led_onoff'​
-option '​sysfs'​ 'tl-wr1043nd:​green:​qss'​+option '​sysfs'​ 'tp-link:​green:​qss'​
 option '​trigger'​ '​timer'​ option '​trigger'​ '​timer'​
 option '​mode'​ '​link'​ option '​mode'​ '​link'​
Line 33: Line 33:
 <​shell>​ <​shell>​
 #!/bin/sh #!/bin/sh
-SW=$(uci -q get wireless.@wifi-device[0].disabled)+SW=`ifconfig wlan0 | wc -l`
  
-if [ "​$SW"​ == "0" ] ; then +if [ "​$SW"​ == "7" ] ; then 
-echo 0 > /​sys/​class/​leds/​tl-wr1043nd\:​green\:​qss/​brightness+echo 0 > /​sys/​class/​leds/​tp-link\:​green\:​qss/​brightness
 else else
-echo 1 > /​sys/​class/​leds/​tl-wr1043nd\:​green\:​qss/​brightness +echo 1 > /​sys/​class/​leds/​tp-link\:​green\:​qss/​brightness 
-echo timer > /​sys/​class/​leds/​tl-wr1043nd\:​green\:​qss/​trigger +echo timer > /​sys/​class/​leds/​tp-link\:​green\:​qss/​trigger 
-echo 3000 > /​sys/​class/​leds/​tl-wr1043nd\:​green\:​qss/​delay_off +echo 3000 > /​sys/​class/​leds/​tp-link\:​green\:​qss/​delay_off 
-echo 2000 > /​sys/​class/​leds/​tl-wr1043nd\:​green\:​qss/​delay_on+echo 2000 > /​sys/​class/​leds/​tp-link\:​green\:​qss/​delay_on
 fi fi
  
-[ "​$SW"​ == "1" ] && uci set wireless.@wifi-device[0].disabled=0 +if [ "​$SW"​ == "7" ] ; then wifi down; fi 
-[ "​$SW"​ == "1" ] || uci set wireless.@wifi-device[0].disabled=1 +if [ "​$SW"​ == "0" ] ; then wifi up; fi
-wifi +
-</​shell>​ +
-executable the wifionoff +
- +
 <​shell>​ <​shell>​
-chomd + x /sbin/wifioff+chmod + x /sbin/wifionoff
 </​shell>​ </​shell>​
  
 When wifi in on : qss led blink "​slowly"​ When wifi in on : qss led blink "​slowly"​
  
tp-1043nd_qss_button_on_off_wifi.txt · Last modified: 2013/06/11 23:11 by sineex
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki