#9750 closed defect (fixed)
wifitoggle does not work
| Reported by: | anonymous | Owned by: | developers |
|---|---|---|---|
| Priority: | normal | Milestone: | Chaos Calmer 15.05 |
| Component: | packages | Version: | Backfire 10.03.1 RC5 |
| Keywords: | Cc: |
Description
wifitoggle does not work on DIR-825 B1. When the WPS button is pressed, nothing happened.
Attachments (0)
Change History (12)
comment:1 Changed 7 years ago by anonymous
comment:2 Changed 6 years ago by nbd
- Resolution set to no_response
- Status changed from new to closed
comment:3 Changed 6 years ago by anonymous
- Resolution no_response deleted
- Status changed from closed to reopened
Tested not working on Backfire 10.03.1 RC6.
Got the following message on system log:-
user.err wifitoggle: device(all) not recognized
comment:4 Changed 6 years ago by anonymous
Tested on Backfire 10.03.1 final and wifitoggle does not work.
The correct button name should be 'BTN_1'instead of the default 'wps'.
Once changed to 'BTN_1' and wifitoggle works.
comment:5 Changed 6 years ago by ernst.kloppenburg@…
Here (10.03.1 final, fresh installation) wifitoggle (1-2) does not work correctly, even with the right button configured.
I have a single wireless device and have disabled it using the LUCI Interface. Now when I press the button, logread shows 'user.err wifitoggle: device(all) not recognized'
The first problem is, /etc/hotplug.d/button/50-wifitoggle in the function load_wifitoggle() loops over the sections of type 'wifi-device' but the 'disabled' option is set for the 'wifi-iface'.
# uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type=mac80211
wireless.radio0.hwmode=11ng
wireless.radio0.htmode=HT20
wireless.radio0.channel=5
wireless.radio0.txpower=27
wireless.radio0.country=DE
wireless.@wifi-iface[0]=wifi-iface
wireless.@wifi-iface[0].device=radio0
wireless.@wifi-iface[0].network=lan
wireless.@wifi-iface[0].mode=ap
wireless.@wifi-iface[0].disabled=1
There is a second problem: disabling an interface or wifi-device that is enabled will never work, because a call like 'disabled="$(uci get wireless.radio0.disabled)"' will just fail in that case. So $disabled will be neither 0 nor 1 in the last if-statement of load_wifitoggle.
comment:6 Changed 6 years ago by anonymous
I have changed function set_wifi to:
setled
if [ "$device" = "all" ]
then
config_load wireless
config_foreach save_wireless wifi-device
else
save_wireless $device
fi
wifi
And now can enable and disable WiFi using button on TP-Link 1043ND with Backfire 10.03.1.
comment:7 Changed 6 years ago by dani@…
comment:8 Changed 6 years ago by dani@…
seems the wifitoggle script expects us to HAVE in /etc/config/wireless the:
option disabled 0
everything works fine now, thanks jow !
comment:9 Changed 5 years ago by anonymous
This fixed it for me (on an ASUS WL500gP with barrier_breaker/trunk):
root@openwrt:~# uci get wireless.radio0.disabled
uci: Entry not found
root@openwrt:~#
Ah... LUCI just removed "disabled" instead of setting it to "0".
root@openwrt:~# uci set wireless.radio0.disabled=0
root@openwrt:~# uci get wireless.radio0.disabled
0
root@openwrt:~#
Now, wifitoggle works as expected :-)
comment:10 Changed 5 years ago by anonymous
In 12.09-rc1 (WL-500W) wifitoggle works when I modify /etc/config/wireless and add "option disabled 0".
But as soon as Wifi in disabled or enabled in LUCI, "option disabled 0" will dissapear when Wifi is up again and wifitoggle does not work again. Same situation is for example when wifi is scheduled in cron to turn off (wifi down, wifi up). In the morning, when wifi up is done, SES button does not work again, message user.err wifitoggle: device(all) not recognized is logged.
Must be fixed anyway :)
comment:11 Changed 5 years ago by jow
- Resolution set to fixed
- Status changed from reopened to closed
comment:12 Changed 4 years ago by jow
- Milestone changed from Backfire 10.03.2 to Chaos Calmer (trunk)
Milestone Backfire 10.03.2 deleted

Perhaps the button name used internally in RC5 changed on DIR-825 B1 as well (see Ticket: #9725)
You can confirm if the button name is the same specified in /etc/config/wifitoggle by creating a /etc/hotplug.d/button/00-log file with these contents:
to check the log after the button was pressed
Since wifitoggle is case-sensitive, option button value in /etc/config/wifitoggle should have the same case as reported by the log (eg: option button 'WPS' ).
wifitoggle default for button is undercase 'wps'