Topic: Wifi toggle by QSS button on TP-link TL-WR741ND

Hi, I succedeed in flashing the firmware of my TP-link TL-WR741ND with openwrt Backfire (r22689).
Now I really need to enable toggle on/off of wireless directly from the Frontal QSS button, but I don't know how to do it.

Following the Wiki I succedeed in reading the gpio 12 (qss button) value and I noticed that normally is 1 and when pressed it goes to zero.

I want to write  a script that checks the status of the button and when pressed enable the wifi is it was previously disabled and viceversa.

Now I need to know the command line command to get the wifi status (if it is ON or OFF) Is there any way to know if wifi is up or down by using a simple command?

and the command line to enable and disable it (wifi up and down works but I need to read the wifi status) or is there an alternative?

By using the procedure described in the wiki I need to unload the module gpio_buttons this can cause any problem?

I found a package called wifitoggle can't I use it? and how?

Thank you

Andrea

WRT54G v2 board HX - 32Mb SDRAM Mod OK - SD card mod 1Gb  OK - Serial MOD OK - OpenWRT whiterussian rc5
Tp-Link TL-WR741ND (v1.5) - OpenWRT Backfire (r22689) - USB mod ... work in progress

Re: Wifi toggle by QSS button on TP-link TL-WR741ND

#!/bin/sh

[ "$BUTTON" = "BTN_1" ] && [ "$ACTION" = "pressed" ] && {
 SW=$(uci get wireless.@wifi-device[0].disabled)
 [ $SW == '0' ] && uci set wireless.@wifi-device[0].disabled=1
 [ $SW == '0' ] || uci set wireless.@wifi-device[0].disabled=0
 wifi
}

these script in /etc/hotplug.d/button/01-onoff  (if button is called BTN_1)

Or just install wifitoggle package.

See also http://eko.one.pl/?p=openwrt-button (in Polish, sorry)

Re: Wifi toggle by QSS button on TP-link TL-WR741ND

Ok thank you very much it seems to work properly.
I follow the instruction on the polish site (traslated by google) and I found that QSS button is BTN_1 and reset is BTN_0.
So i copy and paste the simple script you gave me and it worked out of the box
thank you very much
Andrea

WRT54G v2 board HX - 32Mb SDRAM Mod OK - SD card mod 1Gb  OK - Serial MOD OK - OpenWRT whiterussian rc5
Tp-Link TL-WR741ND (v1.5) - OpenWRT Backfire (r22689) - USB mod ... work in progress

Re: Wifi toggle by QSS button on TP-link TL-WR741ND

Since that prove useful can this button be used for reboot?

Re: Wifi toggle by QSS button on TP-link TL-WR741ND

See also the wifitoogle package.

and the Wiki: wifitoogle Configuration

Re: Wifi toggle by QSS button on TP-link TL-WR741ND

Hey .
I got the WR1043ND and I was wondering if I could use the QSS button to start and stop the transmission daemon? And program the QSS led to Be on when the transmission daemon is on? And off when its off?