TP-Link WR841ND에 OpenWRT를 설치했습니다. 모든 것이 예상대로 작동하지만 Wi-Fi 스위치가 작동하지 않습니다. 위에서 설명한 가이드를 따랐습니다.이 라우터의 OpenWRT 페이지. 스위치를 켜거나 끄면 스크립트가 /etc/hotplug.d/button/
전혀 실행되지 않습니다.
이유는 무엇입니까? 일부 패키지나 커널 모듈이 누락되었습니까?
내가 설치한 패키지:
base-files - 117-r36088
busybox - 1.19.4-6
dnsmasq - 2.62-2
dropbear - 2011.54-2
firewall - 2-55.1
hotplug2 - 1.0-beta-4
iptables - 1.4.10-4
iw - 3.6-1
jshn - 2013-01-29-0bc317aa4d9af44806c28ca286d79a8b5a92b2b8
kernel - 3.3.8-1-d6597ebf6203328d3519ea3c3371a493
kmod-ath - 3.3.8+2012-09-07-3
kmod-ath9k - 3.3.8+2012-09-07-3
kmod-ath9k-common - 3.3.8+2012-09-07-3
kmod-cfg80211 - 3.3.8+2012-09-07-3
kmod-crypto-aes - 3.3.8-1
kmod-crypto-arc4 - 3.3.8-1
kmod-crypto-core - 3.3.8-1
kmod-gpio-button-hotplug - 3.3.8-1
kmod-ipt-conntrack - 3.3.8-1
kmod-ipt-core - 3.3.8-1
kmod-ipt-nat - 3.3.8-1
kmod-ipt-nathelper - 3.3.8-1
kmod-leds-gpio - 3.3.8-1
kmod-ledtrig-default-on - 3.3.8-1
kmod-ledtrig-netdev - 3.3.8-1
kmod-ledtrig-timer - 3.3.8-1
kmod-ledtrig-usbdev - 3.3.8-1
kmod-lib-crc-ccitt - 3.3.8-1
kmod-mac80211 - 3.3.8+2012-09-07-3
kmod-nls-base - 3.3.8-1
kmod-ppp - 3.3.8-1
kmod-pppoe - 3.3.8-1
kmod-pppox - 3.3.8-1
kmod-usb-core - 3.3.8-1
kmod-usb-ohci - 3.3.8-1
kmod-usb2 - 3.3.8-1
kmod-wdt-ath79 - 3.3.8-1
libblobmsg-json - 2013-01-29-0bc317aa4d9af44806c28ca286d79a8b5a92b2b8
libc - 0.9.33.2-1
libgcc - 4.6-linaro-1
libip4tc - 1.4.10-4
libiwinfo - 36
libiwinfo-lua - 36
libjson - 0.9-2
liblua - 5.1.4-8
libnl-tiny - 0.1-3
libubox - 2013-01-29-0bc317aa4d9af44806c28ca286d79a8b5a92b2b8
libubus - 2013-01-13-bf566871bd6a633e4504c60c6fc55b2a97305a50
libubus-lua - 2013-01-13-bf566871bd6a633e4504c60c6fc55b2a97305a50
libuci - 2013-01-04.1-1
libuci-lua - 2013-01-04.1-1
libxtables - 1.4.10-4
lua - 5.1.4-8
luci - 0.11.1-1
luci-app-firewall - 0.11.1-1
luci-i18n-english - 0.11.1-1
luci-lib-core - 0.11.1-1
luci-lib-ipkg - 0.11.1-1
luci-lib-nixio - 0.11.1-1
luci-lib-sys - 0.11.1-1
luci-lib-web - 0.11.1-1
luci-mod-admin-core - 0.11.1-1
luci-mod-admin-full - 0.11.1-1
luci-proto-core - 0.11.1-1
luci-proto-ppp - 0.11.1-1
luci-sgi-cgi - 0.11.1-1
luci-theme-base - 0.11.1-1
luci-theme-openwrt - 0.11.1-1
mtd - 18.1
netifd - 2013-01-29.2-4bb99d4eb462776336928392010b372236ac3c93
opkg - 618-3
ppp - 2.4.5-8
ppp-mod-pppoe - 2.4.5-8
swconfig - 10
uboot-envtools - 2012.04.01-1
ubus - 2013-01-13-bf566871bd6a633e4504c60c6fc55b2a97305a50
ubusd - 2013-01-13-bf566871bd6a633e4504c60c6fc55b2a97305a50
uci - 2013-01-04.1-1
uhttpd - 2012-10-30-e57bf6d8bfa465a50eea2c30269acdfe751a46fd
wifitoggle - 1-3
wpad-mini - 20120910-1
커널 모듈:
Module Size Used by Tainted: G
ath79_wdt 2240 1
ohci_hcd 16160 0
ledtrig_usbdev 2032 0
ledtrig_netdev 3184 0
nf_nat_irc 784 0
nf_conntrack_irc 2464 1 nf_nat_irc
nf_nat_ftp 976 0
nf_conntrack_ftp 4416 1 nf_nat_ftp
ipt_MASQUERADE 976 1
iptable_nat 2544 1
nf_nat 10256 4 nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat
pppoe 7488 0
xt_conntrack 2048 3
xt_CT 1216 0
xt_NOTRACK 448 0
iptable_raw 560 1
xt_state 608 0
nf_conntrack_ipv4 4384 6 iptable_nat,nf_nat
nf_defrag_ipv4 656 1 nf_conntrack_ipv4
nf_conntrack 38336 12 nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_conntrack,xt_CT,xt_NOTRACK,xt_state,nf_conntrack_ipv4
ehci_hcd 33632 0
pppox 1152 1 pppoe
ipt_REJECT 1808 2
xt_TCPMSS 2560 1
ipt_LOG 6160 0
xt_comment 400 0
xt_multiport 1104 0
xt_mac 528 0
xt_limit 944 1
iptable_mangle 832 1
iptable_filter 592 1
ip_tables 8864 4 iptable_nat,iptable_raw,iptable_mangle,iptable_filter
xt_tcpudp 1632 4
x_tables 9984 18 ipt_MASQUERADE,iptable_nat,xt_conntrack,xt_CT,xt_NOTRACK,iptable_raw,xt_state,ipt_REJECT,xt_TCPMSS,ipt_LOG,xt_comment,xt_multiport,xt_mac,xt_limit,iptable_mangle,iptable_filter,ip_tables,xt_tcpudp
ppp_async 5952 0
ppp_generic 18848 3 pppoe,pppox,ppp_async
slhc 4368 1 ppp_generic
ath9k 84944 0
ath9k_common 1152 1 ath9k
ath9k_hw 329024 2 ath9k,ath9k_common
ath 14320 3 ath9k,ath9k_common,ath9k_hw
mac80211 252240 1 ath9k
usbcore 99200 4 ohci_hcd,ledtrig_usbdev,ehci_hcd
usb_common 480 1 usbcore
nls_base 4640 1 usbcore
crc_ccitt 944 1 ppp_async
cfg80211 153696 3 ath9k,ath,mac80211
compat 5776 5 ath9k,ath9k_common,ath9k_hw,mac80211,cfg80211
arc4 768 2
aes_generic 29808 0
crypto_algapi 9200 2 arc4,aes_generic
ledtrig_timer 1072 0
ledtrig_default_on 416 0
leds_gpio 1552 0
gpio_button_hotplug 3184 0
답변1
OpenWRT 15.05.1로 업그레이드했는데 약간의 조작 후에 이것이 작동하는 것 같습니다. 다음을 /etc/hotplug.d/button/50-wifiswitch
포함하는 스크립트를 만들었습니다.
#/bin/sh
if [ "$BUTTON" = "rfkill" ] ; then
if [ "$ACTION" = "released" ] ; then
logger "Disabling wifi"
uci set 'wireless.@wifi-device[0].disabled=1'
elif [ "$ACTION" = "pressed" ] ; then
logger "Enabling wifi"
uci set 'wireless.@wifi-device[0].disabled=0'
else
logger "Unknown action: $ACTION"
exit 1
fi
wifi
fi
지침:
- 버튼 이름은 입니다
rfkill
. - 실제로 토글 버튼이 아닌 스위치이므로 Wi-Fi 상태는 토글이 아닌 "눌림"/"손 떼기"에 의해 결정됩니다.
답변2
핫플러그가 procd 패키지로 대체되고 있기 때문에 이 문제가 발생할 수 있습니다. 자세한 내용과 버튼을 작동시키는 방법은 여기에서 확인하세요. http://wiki.openwrt.org/doc/howto/hardware.button
버튼이 제대로 작동하면 위키를 업데이트하세요.