Hostapd error trying to start AP

I’m just playing with my BananaPi R2 board that I just got. I followed the directions on this page: http://wiki.banana-pi.org/Getting_Started_with_R2#OpenWrt_On_SD_.26_Emmc_Steps

My build system is Ubuntu 19.04. I had to patch some of the build tools to accomodate glibc 2.28 but I got it to build.

However, when I try to start the AP http://wiki.banana-pi.org/Getting_Started_with_R2#WiFi_and_Ap_mode_on_R2_Openwrt

I get an error when hostapd starts. My complete log is this:

root@LEDE:/# ./setup.sh 
+ sleep 3
+ wmt_loader
init combo devic[   87.915270] [WMT-DETECT][I]wmt_detect_open:open major 154 minor 0 (pid 666)
e
[   87.923521] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191037),arg(0)
Opened combo dev[   87.930966] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (1074034433),arg(30243)
ice
get device[   87.939638] set current consys chipid (0x7623)
id : 30243
[   87.945427] [WMT-DETECT][I]wmt_detect_unlocked_ioctl:cmd (-2147191036),arg(30243)
set device id : [   87.954018] [WMT-MOD-INIT][I]do_common_drv_init:start to do common driver init, chipid:0x00007623
30243
[   87.993234] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[   88.000600] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[   88.008732] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[   88.016082] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[   88.024192] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[   88.031543] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[   88.040901] [WMT-CONSYS-HW][E]mtk_wmt_probe(122):Wmt Cannot find pinctrl default!
[   88.049059] [WMT-MOD-INIT][I]do_common_drv_init:finish common driver init
[   88.055818] [BT-MOD-INIT][I]do_bluetooth_drv_init:CONFIG_MTK_COMBO_BT is not defined
[   88.063496] [WCN-MOD-INIT][E]do_connectivity_driver_init(57):do common driver init failed, ret:-1
[   88.072310] [GPS-MOD-INIT][I]do_gps_drv_init:CONFIG_MTK_COMBO_GPS is not defined
[   88.079659] [WCN-MOD-INIT][E]do_connectivity_driver_init(62):do common driver init failed, ret:-1
[   88.088470] [FM-MOD-INIT][I]do_fm_drv_init:start to do fm module init
[   88.094868] [FM-MOD-INIT][I]do_fm_drv_init:finish fm module init
[   88.100821] [WLAN-MOD-INIT][I]do_wlan_drv_init:start to do wlan module init 0x7623
[   88.108745] [MTK-WIFI] WIFI_init: mtk_wmt_WIFI_chrdev driver(major 153) installed.
[   88.116278] [WLAN-MOD-INIT][I]do_wlan_drv_init:WMT-WIFI char dev init, ret:0
[   88.124139] [WLAN-MOD-INIT][I]do_wlan_drv_init:WLAN-GEN2 driver init, ret:0
[   88.131073] [WLAN-MOD-INIT][I]do_wlan_drv_init:finish wlan module init
do module init: [   88.137745] [WMT-DETECT][I]wmt_detect_close:close major 154 minor 0 (pid 666)
30243
failed to init module 
+ sleep 5
+ stp_uart_launc[   90.893410] [WMT-DEV][W]WMT_unlocked_ioctl:chipid = 0x7623
her -p /etc/firm[   90.899742] [WMT-LIB][W]wmt_lib_set_hif:new hifType: 2, fm:2
ware
open devic[   90.906795] [WMT-CORE][E]opfunc_hif_conf(874):WMT-CORE: WMT HIF info added
e node succeed.([   90.914948] [WMT-DEV][W]WMT_unlocked_ioctl:unknown cmd (-2147180516)
Node:/dev/stpwmt[   90.922680] vcn18: mode operation not allowed
, fd:3) 
chip id is 0x7623
chi[   90.929806] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(292):Read CONSYS chipId(0xfffff093)Id:0x7623, setting to property((null))
chiId:0x7623
run SOC chip flow
create pwr on thread ok
[   91.035344] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[   91.042687] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6620.defAnt, mt6620_ant_m3.cfg, -1)
[   91.050949] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[   91.058373] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6628.defAnt, mt6628_ant_m1.cfg, -1)
[   91.066557] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[   91.073893] [WMT-CONF][W]wmt_conf_parse:parse fail (mt6630.defAnt, mt6630_ant_m1.cfg, -1)
[   91.083907] [WMT-IC][W]mtk_wcn_soc_ver_check:0x7623: read hw_ver (hw version) (0x8a00)
[   91.092413] [WMT-IC][W]mtk_wcn_soc_ver_check:0x7623: read fw_ver (rom version) (0x8a00)
[   91.100432] [WMT-IC][W]mtk_wcn_soc_ver_check:0x7623: ic info: SOC_CONSYS.E1 (0x8a00/0x8a00, WMTHWVER:0, patch_ext:_e1)
enter power on connsys flowpatch name pre-fix:ROMv2_lm_patch
fwVersion:0x8a00
/etc/firmware/ROMv2_lm_patch_1_0_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x22,0x00,0x06,0x00
gpatchnum = [2]
gdwonseq = [2]
/etc/firmware/ROMv2_lm_patch_1_1_hdr.bin
fw Ver in patch: 0x8a00
read patch info:0x21,0x00,0x0e,0xf0
gdwonseq = [1]
cmd(srh_patch) resp(ok)
[   91.258959] [WMT-IC][W]mtk_wcn_soc_patch_dwn:wmt_core: patch dwn:0 frag(51, 268) ok
[   91.385938] [WMT-IC][W]mtk_wcn_soc_patch_dwn:wmt_core: patch dwn:0 frag(114, 52) ok
[   91.721213] [WMT-IC][W]mtk_wcn_soc_sw_init:co-clock disabled.
[   91.727739] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup
[   91.735193] [WMT-CORE][W]wmt_core_dump_func_state:[AF FUNC ON]status(b:0 f:0 g:0 w:0 lpbk:2 coredump:0 wmt:2 stp:0)
[   91.745665] [WMT-EXP][W]mtk_wcn_wmt_func_ctrl:OPID(3) type(9) ok
+ sleep 5
[   95.894449] [MTK-WIFI] WIFI_open: WIFI_open: major 153 minor 0 (pid 674)
+ [   95.901967] [MTK-WIFI] WIFI_write: WIFI_write A
[   95.901967] 
echo A
[   95.944893] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt wlan func on before wlan probe
[   95.980196] kalFirmwareImageMapping firmware size 225840
[   97.156087] [MTK-WIFI] register_set_p2p_mode_handler: (pid 670) register set p2p mode handler c0276f3c
[   97.165431] [WMT-FUNC][W]wmt_func_wifi_on:WMT-FUNC: wmt call wlan probe ok
[   97.172272] [WMT-CORE][W]wmt_core_dump_func_state:[AF FUNC ON]status(b:0 f:0 g:0 w:2 lpbk:2 coredump:0 wmt:2 stp:0)
[   97.182840] [WMT-EXP][W]mtk_wcn_wmt_func_ctrl:OPID(3) type(3) ok
[   97.188895] [MTK-WIFI] WIFI_write: WMT turn on WIFI success!
[   97.195829] [MTK-WIFI] WIFI_write: Set wlan mode 0 --> 1
[   97.201137] [MTK-WIFI] WIFI_close: WIFI_close: major 153 minor 0 (pid 674)
+ hostapd -d hostapd.conf
Configuration file: hostapd.conf
Line 4: invalid/unknown driver 'nl80211'
1 errors found in configuration file 'hostapd.conf'
Failed to set up interface with hostapd.conf
Failed to initialize interface

Any ideas on what I need to do to get AP mode to work?

Answering my own post, it seems that I needed to enable some 80211 stuff in the kernel configuration.

I turned on cfg80211, mac80211 and lib80211 and now the AP starts up fine.

Hello, Before you set ap mode, please try thess commands:

  1. nmcli radio wifi off
  2. rfkill unblock < network >
  3. hostapd -d <hostapd.conf>
1 Like

I neglected to mention that I’m using OpenWRT (and not ubuntu). The links that I posted were to the OpenWRT specific commands though.

Those commands (nmcli and rfkill) don’t seem to be available under OpenWRT. Are there equivalents for OpenWRT?

I got AP mode working by enabling some kernel options (mentioned in a previous post).

nmcli is commandline-tool for gnome network-manager, so at least this will not be available for openwrt. rfkill should also be available for openwrt.

but you’ve got AP working after add missing nl80211 so you don’t need to search anymore :wink: