Modify

Opened 4 years ago

Last modified 3 years ago

#15354 new defect

wlan on/off button does not work TP-Link TL-WR1043ND v2.1

Reported by: anonymous Owned by: developers
Priority: normal Milestone: Chaos Calmer 15.05
Component: packages Version: Trunk
Keywords: Cc:

Description

The button is located on the left side in the rear view and is marked as "Wireless on/off".
Pressing and releasing the button does not emit any hotplug event.

According to trunk/target/linux/ar71xx/files/arch/mips/ath79/mach-tl-wr1043nd-v2.c, it should be handled as the "WLAN button".

Necessary packages are installed, the reset (marked as WPS/Reset) button works.

/tmp/sysinfo/board_name:tl-wr1043nd-v2
/tmp/sysinfo/model:TPLink TL-WR1043ND v2
OpenWrt (/etc/openwrt_)version:r39969

Attachments (0)

Change History (9)

comment:1 Changed 4 years ago by Nilfred

Output of opkg list-installed | grep kmod-[ig][pn][pi] please.
If the button does not generate an interrupt you may require
kmod-input-gpio-keys-polled

comment:2 Changed 4 years ago by anonymous

The modules are default for the platform/device:

root@garlic:/# opkg list_installed | grep kmod-[ig][pn][pi]
kmod-gpio-button-hotplug - 3.10.32-1
kmod-input-core - 3.10.32-1
kmod-input-polldev - 3.10.32-1

The installation of kmod-input-gpio-keys-polled does not change a thing.

Actually pressing the button changes the state:

root@garlic:/# cat /sys/kernel/debug/gpio
GPIOs 0-23, ath79:
 gpio-17  (WLAN button         ) in  lo

and releasing it changes the state back:

root@garlic:/# cat /sys/kernel/debug/gpio
GPIOs 0-23, ath79:
 gpio-17  (WLAN button         ) in  hi

comment:3 Changed 4 years ago by anonymous

Both combinations of kmod-gpio-button-hotplug or kmod-input-gpio-keys-polled+kmod-button-hotplug work the same way. Buttons are defined in the platform data and modules register and handle them (as detected in comment:2).

The problem is that the KEY_WLAN is unknown to kmod-gpio-button-hotplug or kmod-button-hotplug. The modules know these keys:

        BH_MAP(BTN_0,           "BTN_0"),
        BH_MAP(BTN_1,           "BTN_1"),
        BH_MAP(BTN_2,           "BTN_2"),
        BH_MAP(BTN_3,           "BTN_3"),
        BH_MAP(BTN_4,           "BTN_4"),
        BH_MAP(BTN_5,           "BTN_5"),
        BH_MAP(BTN_6,           "BTN_6"),
        BH_MAP(BTN_7,           "BTN_7"),
        BH_MAP(BTN_8,           "BTN_8"),
        BH_MAP(BTN_9,           "BTN_9"),
        BH_MAP(KEY_RESTART,     "reset"),
        BH_MAP(KEY_POWER,       "power"),
        BH_MAP(KEY_RFKILL,      "rfkill"),
        BH_MAP(KEY_WPS_BUTTON,  "wps"),
        BH_MAP(KEY_WIMAX,       "wwan"),

So these modules cannot generate hotplug events for this button.

This type of device generally uses two buttons, reset and wps. If we would like to stick to manufacturer's labels, it would be rfkill. What is the reason for selecting a different key? It is the only one device in the ar71xx tree that behaves differently.

I would prefer to handle it as WPS.

comment:4 follow-up: Changed 4 years ago by anonymous

I would prefer to handle it as WPS.

Even though I don't have any preferation,
The 'reset' button is labeled 'Reset/WPS' on the sticker below the button
The other button is labeled 'Wireless On/Off'
Calling it 'wps' might be on par with standards, it is prone for misinterpretation when you look to the physical label stickers.

comment:5 Changed 4 years ago by hnyman

#15477 is a new duplicate of this bug.

Based on the info on both bugs, I propose that a new button definition is added for the "wifi" button. Many routers have a wifi on/off button, so it seems strange that we should use other names for the button.

So, adding this to gpio-button-hotplug definition list might be a solution:

BH_MAP(KEY_WLAN, "wifi"),

Then there would be a "wifi" button for the hotplug actions.

comment:6 in reply to: ↑ 4 Changed 4 years ago by anonymous

Replying to anonymous:

Calling it 'wps' might be on par with standards, it is prone for misinterpretation when you look to the physical label stickers.

The misinterpretation of the Reset/WPS button is much likely. Any user expecting the WPS function will see only a restart or a reset to default when pressing longer.

Notice that devices with the Wireless on/of implement it as a real switch not just a push button. It is the rfkill action in such case.

Replying to hnyman:

This type of router commonly handles restart and WPS buttons regardless of their manufacturer's label (wps/qss/jumpstart).
Another key mapping requires changing existing general functions implementing button hotplug (WPS) as well just for this device.
The WPS mapping does not prevent anyone from using it any way.

I do not object extending the hotplug modules. The KEY_WLAN is defined in other devices (some brcmxxxx) and they would profit from the change.

I use it for a different function regardless of the mapping. I only reported it because the device did not work as expected. e.g. it did not generate the hotplug event.

comment:7 Changed 4 years ago by anonymous

The misinterpretation of the Reset/WPS button is much likely.

On second thought, this misinterpretation is only for the people with root access.
IMHO people will look at wiki/ToH section before adding button support.
Let's stick with 'wps' and put a notice in the wiki?

comment:8 Changed 3 years ago by rlindeman@…

The root cause of the problem might be related to a recent change to the gpio_button_hotplug.c file in the package/kernel/gpio-button-hotplug/src directory. Specifically there was a #ifdef CONFIG_HOTPLUG added to the file along with an #else clause that defines a button_hotplug_event method that does nothing on GPIO button events. I believe what happened is the Makefile didn't pass along a CONFIG_HOTPLUG define to the src file during the compile step. The solution should be to either modify the Makefile to include the CONFIG_HOTPLUG definition or remove the #ifdef that was added to the file.

comment:9 Changed 3 years ago by rlindeman@…

Looks like this was solved in issue #16413.

Add Comment

Modify Ticket

Action
as new .
Author


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

 
Note: See TracTickets for help on using tickets.