Failed to connect to Wi-Fi problem

Which Khadas SBC do you use?

VIM3 Pro

Which system do you use? Android, Ubuntu, OOWOW or others?

Ubuntu MATE 20.04

Which version of system do you use? Khadas official images, self built images, or others?

Khadas official images + customize (theme: MATE)

Please describe your issue below:

The problem is that the VIM3 Pro fails to connect to Wi-Fi. That Wi-Fi (ie AP) has no connection failures with other devices such as laptops or cell phones. Moreover, this connection failure problem did not only appear in one AP, but also in APs of different manufacturers.
I have several VIM3s, but this problem appeared randomly, so I couldn’t figure out what the problem was. Even in VIM3, which was well connected and used, it appeared suddenly.

So, I did some digging, and I have several questions.

  • Sometimes the wireless LAN driver (wlan0) is brcmfmac or bcmsdh-sdmmc.

    • What is the difference, and which one is proper to use?
    • Which one has better compatibility?
    • How do I set it to what I want?
  • hostapd is running every 2 seconds by systemd in the background.
    If I don’t use VIM3 Pro as AP, is it ok to disable hostapd.service via systemctl?

  • The following logs were in dmesg and /var/log/syslog. we used in KR (republic of Korea)

    • Is it related to the connection failure problem?
    • Is it related to the ccode in /lib/firmware/brcm/config.txt?`
    dhd_conf_set_country: set country CN, revision 38
    Country code: CN (CN/38)
    

Post a console log of your issue below:

MAC address of AP is hided, dmesg attached partially.


               dhd_bus_devreset: == WLAN ON ==
[ 9624.877522] F1 signature read @0x18000000=0x17294359
[ 9624.881315] F1 signature OK, socitype:0x1 chip:0x4359 rev:0x9 pkg:0x2
[ 9624.881868] DHD: dongle ram size is set to 917504(orig 917504) at 0x160000
[ 9624.881919] dhd_bus_set_default_min_res_mask: Unhandled chip id
[ 9624.882149] dhd_conf_read_config: Ignore config file /lib/firmware/brcm/config_bcm4359c0_ag.txt
[ 9624.882156] Final fw_path=/lib/firmware/brcm/fw_bcm4359c0_ag.bin
[ 9624.882157] Final nv_path=/lib/firmware/brcm/nvram_ap6398s.txt
[ 9624.882158] Final clm_path=/lib/firmware/brcm/clm.blob
[ 9624.882160] Final conf_path=/lib/firmware/brcm/config_bcm4359c0_ag.txt
[ 9624.882547] dhd_os_open_image: /lib/firmware/brcm/fw_bcm4359c0_ag.bin (637347 bytes) open success
[ 9624.947325] dhd_os_open_image: /lib/firmware/brcm/nvram_ap6398s.txt (6096 bytes) open success
[ 9624.947340] NVRAM version: AP6398S_NVRAM_V3.0_20200312A
[ 9624.947898] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 9625.139054] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[ 9625.139091] si_get_pmu_reg_addr: addrRET: 18000670
[ 9625.139245] bcmsdh_oob_intr_register: HW_OOB irq=103 flags=0x8
[ 9625.139342] dhd_get_memdump_info: File [/data/misc/wifi/.memdump.info] doesn't exist
[ 9625.139344] dhd_get_memdump_info: MEMDUMP ENABLED = 2
[ 9625.141217] dhd_tcpack_suppress_set: TCP ACK Suppress mode 0 -> mode 1
[ 9625.141488] dhd_apply_default_clm: Ignore clm file /lib/firmware/brcm/clm.blob
[ 9625.142495] Firmware up: op_mode=0x0405, MAC=d4:9c:dd:da:04:88
[ 9625.151554]   Driver: 1.579.77.41.10 (r)
                 Firmware: wl0: Sep 20 2019 20:22:36 version 9.87.51.11.34 (edb7293@shgit) (r711217) FWID 01-c7feb1ee
                 CLM: 9.7.5 
[ 9625.151720] dhd_txglom_enable: enable 1
[ 9625.151722] dhd_conf_set_txglom_params: txglom_mode=copy
[ 9625.151725] dhd_conf_set_txglom_params: txglomsize=36, deferred_tx_len=0
[ 9625.151727] dhd_conf_set_txglom_params: txinrx_thres=128, dhd_txminmax=-1
[ 9625.151729] dhd_conf_set_txglom_params: tx_max_offset=0, txctl_tmo_fix=300
[ 9625.151734] dhd_conf_get_disable_proptx: fw_proptx=0, disable_proptx=1
[ 9625.152690] dhd_pno_init: Support Android Location Service
[ 9625.178799] rtt_do_get_ioctl: failed to send getbuf proxd iovar (CMD ID : 1), status=-23
[ 9625.178803] dhd_rtt_init : FTM is not supported
[ 9625.178806] dhd_preinit_ioctls: SensorHub diabled 0
[ 9625.179030] dhd_preinit_ioctls failed to set ShubHub disable
[ 9625.179984] failed to set WNM capabilities
[ 9625.180150] dhd_conf_set_country: set country CN, revision 38
[ 9625.182239] Country code: CN (CN/38)
[ 9625.183536] CONFIG-ERROR) dhd_conf_set_intiovar: txbf setting failed -23
[ 9625.190961] wl_android_wifi_on: Success
[ 9625.229240] dhd_open : the lock is released.
[ 9625.229247] dhd_open: Exit ret=0
[ 9625.298120] P2P interface registered
[ 9625.298131] wl_cfgp2p_add_p2p_disc_if: wdev: ffffffc08d972400, wdev->net:           (null)
[ 9625.312876] WLC_E_IF: NO_IF set, event Ignored
[ 9625.314148] P2P interface started
[ 9625.341597] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 9630.289835] Connecting with xx:xx:xx:xx:xx:80 ssid "roboAP#3", len (8) channel=157

[ 9630.295557] dhd_dbg_start_pkt_monitor, 1724
[ 9640.396676] CFG80211-ERROR) wl_cfg80211_check_in4way : wl_cfg80211_check_in4way: return -EBUSY cnt 1
[ 9641.397657] CFG80211-ERROR) wl_cfg80211_check_in4way : wl_cfg80211_check_in4way: return -EBUSY cnt 2
[ 9642.398599] CFG80211-ERROR) wl_cfg80211_check_in4way : wl_cfg80211_check_in4way: return -EBUSY cnt 3
[ 9643.400391] CFG80211-ERROR) wl_run_escan :  Escan set error (-16)
[ 9643.400405] dhd_ioctl_entry_local invalid parameter
[ 9643.400407] CFG80211-ERROR) wl_run_escan : error (-16), cnt=1
[ 9643.400414] CFG80211-ERROR) __wl_cfg80211_scan : Scan err = (-16), busy?-16
[ 9643.811984] CFG80211-ERROR) wl_cfg80211_scan : 
[ 9643.811989] scan error (-16)
[ 9644.813243] CFG80211-ERROR) wl_run_escan :  Escan set error (-16)
[ 9644.813256] dhd_ioctl_entry_local invalid parameter
[ 9644.813259] CFG80211-ERROR) wl_run_escan : error (-16), cnt=2
[ 9644.813266] CFG80211-ERROR) __wl_cfg80211_scan : Scan err = (-16), busy?-16
[ 9645.220001] CFG80211-ERROR) wl_cfg80211_scan : 
[ 9645.220008] scan error (-16)
[ 9645.728403] connect failed event=0 e->status 1 e->reason 0 
[ 9645.737353] CFG80211-ERROR) wl_bss_connect_done : Report connect result - connection failed
[ 9648.661113] Connecting with xx:xx:xx:xx:xx:10 ssid "roboAP#3", len (8) channel=11

[ 9648.675064] dhd_dbg_start_pkt_monitor, 1724
[ 9648.761410] wl_iw_event: Link UP with xx:xx:xx:xx:xx:10
[ 9648.761439] wl_bss_connect_done succeeded with xx:xx:xx:xx:xx:10 
[ 9648.761659] CFG80211-ERROR) wl_cfg80211_scan_abort : scan abort  failed 
[ 9648.798161] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 9648.813291] wl_bss_connect_done succeeded with xx:xx:xx:xx:xx:10 vndr_oui: 00-40-96 
[ 9713.434101] CFG80211-ERROR) wl_cfg80211_cleanup_mismatch_status : Disassociate previous connection!
[ 9713.436491] wl_iw_event: Link Down with xx:xx:xx:xx:xx:10, reason=2
[ 9713.436512] CFG80211-ERROR) wl_is_linkdown : Link down Reason : WLC_E_LINK
[ 9713.449024] Connecting with xx:xx:xx:xx:xx:80 ssid "roboAP#3", len (8) channel=157

[ 9713.459971] dhd_dbg_start_pkt_monitor, 1724
[ 9713.462479] CFG80211-ERROR) wl_cfg80211_get_station : NOT assoc
[ 9714.040817] CFG80211-ERROR) wl_cfg80211_get_station : NOT assoc
[ 9714.042018] CFG80211-ERROR) wl_cfg80211_get_station : NOT assoc
[ 9720.041411] CFG80211-ERROR) wl_cfg80211_get_station : NOT assoc
[ 9720.041766] CFG80211-ERROR) wl_cfg80211_get_station : NOT assoc
[ 9723.460551] CFG80211-ERROR) wl_cfg80211_disconnect : Reason 3
[ 9723.460569] dhd_dbg_stop_pkt_monitor, 1963
[ 9723.461090] connect failed event=0 e->status 4 e->reason 1 
[ 9726.070976] CFG80211-ERROR) wl_cfg80211_disconnect : Reason 2
[ 9726.070995] dhd_dbg_stop_pkt_monitor, 1963
[ 9728.601698] CFG80211-ERROR) wl_cfg80211_disconnect : Reason 2
[ 9728.601715] dhd_dbg_stop_pkt_monitor, 1963
[ 9732.039330] CFG80211-ERROR) wl_cfg80211_disconnect : Reason 2
[ 9732.039347] dhd_dbg_stop_pkt_monitor, 1963
[ 9735.490019] CFG80211-ERROR) wl_cfg80211_disconnect : Reason 2
[ 9735.490038] dhd_dbg_stop_pkt_monitor, 1963
[ 9739.065350] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[ 9740.448884] CFG80211-ERROR) wl_cfg80211_disconnect : Reason 2
[ 9740.448896] dhd_dbg_stop_pkt_monitor, 1963

Please help @numbqq @Frank

@mwjung What we maintain on VIM3 is the GNOME desktop, the MATE desktop is not maintained, we just provide this compilation option. Can you try the GNOME desktop firmware?