旅行时经常开手机热点,很耗电,打算调高 Beacon 时槽来节电。
查了下 hostapd.conf ,里面有一段
# Beacon interval in kus (1.024 ms) (default: 100; range 15..65535) beacon_int=100
正好是我要的,复制了一份 /data/msc/wifi/hostapd.conf ,加了进去
但之后用相同的 cmdline 启动 hostapd , logcat 输出
07-28 16:32:36.764 17673 17673 I hostapd : rfkill: Cannot open RFKILL control device 07-28 16:32:36.799 17673 17673 E hostapd : nl80211: Could not configure driver mode 07-28 16:32:36.799 17673 17673 I hostapd : nl80211: deinit ifname=wlan0 disabled_11b_rates=0 07-28 16:32:36.803 17673 17673 E hostapd : nl80211 driver initialization failed. 07-28 16:32:36.804 17673 17673 I hostapd : wlan0: interface state UNINITIALIZED->DISABLED 07-28 16:32:36.804 17673 17673 I hostapd : wlan0: AP-DISABLED
换回系统生成的配置也是上面这样,只有在手机设置界面开热点才能正常工作, logcat 输出
07-28 16:32:16.151 17265 17265 I hostapd : rfkill: Cannot open RFKILL control device 07-28 16:32:16.167 17265 17265 E hostapd : Using interface wlan0 with hwaddr 78:f8:82:a4:df:7c and ssid "AndroidAP" 07-28 16:32:16.250 17265 17265 I hostapd : wlan0: interface state UNINITIALIZED->ENABLED 07-28 16:32:16.252 17265 17265 I hostapd : wlan0: AP-ENABLED
不知为什么,从终端里启动就“ Could not configure driver mode ”,无法切到 AP 模式
请教一下原因?启动 hostapd 之前是否要执行其他命令?(已尝试过 ifconfig wlan0 up )是否要加载什么驱动?
系统生成的配置如下
interface=wlan0 driver=nl80211 ctrl_interface=/data/misc/wifi/hostapd ssid=AndroidAP channel=1 ieee80211n=1 hw_mode=g ignore_broadcast_ssid=0 wowlan_triggers=any wpa=2 rsn_pairwise=CCMP wpa_psk 略
1 aigebiu OP 最终解决方案是在 netd 的 SoftApController 里新增了几行 使之读入自定义的一个配置文件 附加在原配置尾部 https://github.com/isofew/mydroid/blob/master/netd.ap.conf.patch |