Echo 0 has been done before in my wifi script ( based on yours ). Now I’ve downloaded your script, and run it, but no success! I see ap0 is there, has ip address, but not visible as wifi.
Hostapd doesn’t throw anything :
/usr/sbin/hostapd -dd /etc/hostapd/hostapd_2.4_onboard.conf
nl80211: Event message available
nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for ap0
nl80211: Delete station d8:f1:5b:e7:87:b0
ap0: Event DISASSOC (1) received
ap0: STA d8:f1:5b:e7:87:b0 IEEE 802.11: disassociated
Disassociation notification for unknown STA d8:f1:5b:e7:87:b0
nl80211: Event message available
nl80211: Drv Event 20 (NL80211_CMD_DEL_STATION) received for ap0
nl80211: Delete station 28:6d:cd:23:13:eb
ap0: Event DISASSOC (1) received
ap0: STA 28:6d:cd:23:13:eb IEEE 802.11: disassociated
Disassociation notification for unknown STA 28:6d:cd:23:13:eb
nl80211: Event message available
nl80211: Drv Event 16 (NL80211_CMD_STOP_AP) received for ap0
ap0: Event INTERFACE_UNAVAILABLE (28) received
Interface ap0 is unavailable -- stopped
RTM_NEWLINK: ifi_index=38 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
nl80211: Interface down (ap0/ap0)
ap0: Event INTERFACE_DISABLED (26) received
ap0: INTERFACE-DISABLED
VLAN: RTM_NEWLINK: ifi_index=38 ifname=ap0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(ap0)
RTM_DELLINK: ifi_index=38 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
RTM_DELLINK: Interface 'ap0' removed - mark if_removed=1
ap0: Event INTERFACE_STATUS (5) received
Unknown event 5
VLAN: RTM_DELLINK: ifi_index=38 ifname=ap0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_dellink(ap0)
RTM_DELLINK: ifi_index=37 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
RTM_DELLINK: Interface 'wlan0' removed
VLAN: RTM_DELLINK: ifi_index=37 ifname=wlan0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_dellink(wlan0)
nl80211: Event message available
nl80211: Ignored event (cmd=36) for foreign interface (ifindex -1 wdev 0x0)
nl80211: Event message available
nl80211: Ignored event (cmd=36) for foreign interface (ifindex -1 wdev 0x0)
RTM_NEWLINK: ifi_index=0 ifname=wlan%d wext ifi_family=0 ifi_flags=0x1002 ()
ap0: Event INTERFACE_STATUS (5) received
Unknown event 5
VLAN: RTM_NEWLINK: ifi_index=0 ifname=wlan%d ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(wlan%d)
RTM_NEWLINK: ifi_index=39 ifname=wlan0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: RTM_NEWLINK: ifi_index=39 ifname=wlan0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(wlan0)
RTM_NEWLINK: ifi_index=40 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x1002 ()
nl80211: Update ifindex for a removed interface
nl80211: Supported cipher 00-0f-ac:1
nl80211: Supported cipher 00-0f-ac:5
nl80211: Supported cipher 00-0f-ac:2
nl80211: Supported cipher 00-0f-ac:4
nl80211: Supported cipher 00-0f-ac:6
nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=1
nl80211: Supported vendor command: vendor_id=0x1a11 subcmd=6
nl80211: interface ap0 in phy phy12
nl80211: Set mode ifindex 40 iftype 3 (AP)
nl80211: Unsubscribe mgmt frames handle 0x88d2ec21 (start AP)
nl80211: Setup AP(ap0) - device_ap_sme=1 use_monitor=0
nl80211: Subscribe to mgmt frames with AP handle 0x5a64a8 (device SME)
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=04
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0501
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0503
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0504
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=06
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=08
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=09
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=0a
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=11
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=12
nl80211: Register frame type=0xd0 (WLAN_FC_STYPE_ACTION) nl_handle=0x5a64a8 match=7f
nl80211: Probe Request reporting already on! nl_preq=0x88d2fbc1
nl80211: Connect handle already created (nl_connect=0x5a59e0)
nl80211: Mark if_removed=0 for ap0 based on RTM_NEWLINK event
ap0: Event INTERFACE_STATUS (5) received
Unknown event 5
RTM_NEWLINK: ifi_index=40 ifname=ap0 operstate=2 linkmode=0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
nl80211: Interface up (ap0/ap0)
ap0: Event INTERFACE_ENABLED (25) received
ap0: INTERFACE-ENABLED
wpa_driver_nl80211_set_key: ifindex=40 (ap0) alg=3 addr=0x53f9fc key_idx=1 set_tx=1 seq_len=0 key_len=16
nl80211: KEY_DATA - hexdump(len=16): [REMOVED]
broadcast key
nl80211: Set beacon (beacon_set=0)
nl80211: Beacon head - hexdump(len=58): 80 00 00 00 ff ff ff ff ff ff 02 08 22 50 c7 3d 02 08 22 50 c7 3d 00 00 00 00 00 00 00 00 00 00 64 00 11 04 00 07 48 46 47 2d 49 6f 54 01 08 82 84 8b 96 0c 12 18 24 03 01 03
nl80211: Beacon tail - hexdump(len=123): 07 06 48 55 20 01 0d 14 2a 01 04 32 04 30 48 60 6c 30 14 01 00 00 0f ac 04 01 00 00 0f ac 04 01 00 00 0f ac 02 0c 00 2d 1a 0e 00 03 ff 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 3d 16 03 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 7f 04 00 00 00 02 dd 18 00 50 f2 02 01 01 00 00 03 a4 00 00 27 a4 00 00 42 43 5e 00 62 32 2f 00
nl80211: ifindex=40
nl80211: beacon_int=100
nl80211: beacon_rate=0
nl80211: rate_type=0
nl80211: dtim_period=2
nl80211: ssid - hexdump_ascii(len=7):
48 46 47 2d 49 6f 54 HFG-IoT
* beacon_int=100
* dtim_period=2
nl80211: hidden SSID not in use
nl80211: privacy=1
nl80211: auth_algs=0x1
nl80211: wpa_version=0x2
nl80211: key_mgmt_suites=0x2
nl80211: pairwise_ciphers=0x10
nl80211: group_cipher=0x10
nl80211: SMPS mode - off
nl80211: beacon_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: proberesp_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: assocresp_ies - hexdump(len=6): 7f 04 00 00 00 02
nl80211: Beacon set failed: -22 (Invalid argument)
Failed to set beacon parameters
nl80211: Set IF_OPER_UP again based on ifi_flags and expected operstate
netlink: Operstate: ifindex=40 linkmode=-1 (no change), operstate=6 (IF_OPER_UP)
RTM_NEWLINK: ifi_index=40 ifname=ap0 operstate=6 linkmode=0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: RTM_NEWLINK: ifi_index=40 ifname=ap0 ifi_family=0 ifi_flags=0x1002 ()
VLAN: vlan_newlink(ap0)
VLAN: RTM_NEWLINK: ifi_index=40 ifname=ap0 ifi_family=0 ifi_flags=0x11003 ([UP][LOWER_UP])
VLAN: vlan_newlink(ap0)
VLAN: RTM_NEWLINK: ifi_index=40 ifname=ap0 ifi_family=0 ifi_flags=0x11043 ([UP][RUNNING][LOWER_UP])
VLAN: vlan_newlink(ap0)
I get just this output :
[ 4440.135629] [WMT-LIB][E]wmt_lib_cmb_rst(1674):[whole chip reset] fail at wmt_lib_hw_rst!
[ 4440.874756] [WMT-DEV][E]wmt_dev_rx_timeout(1430):gRxCount != 0 (-1), reset it!
[ 4440.890322] [WMT-CTRL][E]wmt_ctrl_rx(262):wmt_dev_rx_timeout: timeout,jiffies(414081),timeoutvalue(20000)
[ 4440.908251] [WMT-CORE][E]wmt_core_rx(346):WMT-CORE: wmt_core_ctrl failed: WMT_CTRL_RX, iRet:-1
[ 4440.925221] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 348, (0)
[ 4440.925234] [WMT-CORE][E]opfunc_pwr_sv(1208):wmt_core: read SLEEP_EVT fail(-1) len(0, 6)
[ 4440.925246] [WMT-CTRL][E]wmt_ctrl_evt_parser(967):parser wmt evt from BTIF buf fail(0)
[ 4440.925254] [WMT-CORE][E]wmt_core_ctrl(499):WMT-CORE: wmt_core_ctrl failed: id(29), type(1), value(0) iRet:(-1)
[ 4440.925260] drivers/misc/mediatek/connectivity/common/conn_soc/core/wmt_core.c, 501, (0)
[ 4440.925275] [STP-PSM] [E]_stp_psm_notify_stp(1006):ERROR! Action = SLEEP, ACT state, the case should not happens
[ 4440.925281] [STP-PSM] [E]_stp_psm_notify_stp(1008):ERROR! state = 0, flag = 40
[ 4440.925367] [MTK-WIFI] register_set_p2p_mode_handler: (pid 796) register set p2p mode handler 00000000
[ 4441.425357] vcn18: mode operation not allowed
[ 4441.438161] vcn18: mode operation not allowed
[ 4441.452672] [WMT-CONSYS-HW][E]mtk_wcn_consys_hw_reg_ctrl(291):Read CONSYS chipId(0xfffff093)
[ 4441.545018] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6620.defAnt'.
[ 4441.577573] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6628.defAnt'.
[ 4441.593222] [WMT-CONF][E]wmt_conf_parse_pair(323):unknown field 'mt6630.defAnt'.
[ 4442.159635] [STP] mtk_wcn_stp_psm_enable:[W] STP Not Ready, Dont do Sleep/Wakeup
[ 4442.175293] [MTK-WIFI] wifi_reset_end: WIFI state recovering...
[ 4442.197566] kalFirmwareImageMapping firmware size 225840
[ 4443.267750] [MTK-WIFI] register_set_p2p_mode_handler: (pid 796) register set p2p mode handler 67c012d1
[ 4443.286729] [MTK-WIFI] wifi_reset_end: WMT turn on WIFI success!
[ 4443.304139] [MTK-WIFI] wifi_reset_end: Set wlan mode 1
Maybe I should test it with another OS, but I’m afraid there is a harware issue!