Modify

Opened 5 years ago

Last modified 2 years ago

#12388 reopened defect

TP-LINK TL-WDR4300 - hardware switch not working (Wifi ON/OFF)

Reported by: openwrt@… Owned by: developers
Priority: low Milestone: Barrier Breaker 14.07
Component: other Version: Attitude Adjustment 12.09 Beta
Keywords: Cc:

Description

I see support of this button in source code https://dev.openwrt.org/browser/trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wdr4300.c as WDR4300_GPIO_BTN_RFKILL but I can't see any events in hotplug. I was expecting event in the same way like for button's like WPS (which is working correctly).

Please ask if more details are necessary.

Attachments (0)

Change History (11)

comment:1 Changed 5 years ago by hnyman <hannu.nyman@…>

To my knowledge, the wifi button hotplug scripts are not included by default although the hardware driver support is there.

You have to write the hotplug scripts by hand or install the wifitoggle package and configure it for that button.

comment:2 Changed 5 years ago by jow

  • Resolution set to wontfix
  • Status changed from new to closed

OpenWrt never shipped with functionality tied to gpio buttons by default.

comment:3 Changed 5 years ago by openwrt@…

  • Resolution wontfix deleted
  • Status changed from closed to reopened

Thanks for the answers!
I understand that need scripts but I have created them and got only reaction on WPS button but not for Wifi ON/OFF hardware switch.

Here is what I did:

  • mkdir -p /etc/hotplug.d/button
  • vi /etc/hotplug.d/button/przyciski
    #!/bin/sh
        logger $BUTTON
        logger $ACTION
    

After pressing Wifi ON/OFF switch I got nothing but for WPS I got:

user.notice root: wps
user.notice root: released
user.notice root: wps
user.notice root: pressed

So it looks like this Wifi switch isn't properly handled. Before moving to OpenWrt firmware on TP-Link firmware switch was working.

Thanks for any advices.

comment:4 Changed 5 years ago by anonymous

Because WIFI is defined as slide, not like key.

comment:5 Changed 5 years ago by openwrt@…

Yes that's true but even if this is a slide I should see any reaction (event), yes?

comment:6 Changed 5 years ago by anonymous

Any good news with wifi switch?

comment:7 Changed 5 years ago by openwrt@…

Generally yes, but I don't like such solutions. I wrote simple, never ending, shell script which looking for gpio-17 state in /sys/kernel/debug/gpio. Base on that I can decide what to do.
The only problem which I have is that the OpenWrt startup scripts can't finish because of this even if script is put in background with & but everything seems to work correctly.

comment:8 Changed 4 years ago by Jordi

Maybe it is better if you use a periodic cron job which calls a script which checks that status and finish. You could check every few seconds or minutes.

comment:9 Changed 4 years ago by openwrt@…

Good point but the lowest cron timing is 1 minute so it's still confusing for slider button.

comment:10 Changed 3 years ago by jow

  • Milestone changed from Attitude Adjustment 12.09 to Barrier Breaker 14.07

Milestone Attitude Adjustment 12.09 deleted

comment:11 Changed 2 years ago by anonymous

The rfkill switch on my WDR4300 is *almost* usable in plain CC 15.05.
One annoying feature remains:
The hotplug system doesn't recognize if I change the slider while the thing is off or booting.

I added the following ugly hack to /etc/rc.local, and it does the job. I guess a more portable solution can be found increasing the usability of those sliders...

GPIO_STATE=`grep gpio-17 /sys/kernel/debug/gpio | awk '{print $6}'`
TYPE="switch"
if [ "${GPIO_STATE}" = "hi" ]; then
	ACTION="released"
else
	ACTION="pressed"
fi
. /etc/rc.button/rfkill

Add Comment

Modify Ticket

Action
as reopened .
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.