Elektroda.com
Elektroda.com
X

[Solved] Openbeken BK7231N Chip: Smart Switch WiFi Connection Failure - SSID and Password Correct

btmerz 582 36
  • #1
    btmerz
    Level 4  
    Hello,
    I have successfully flashed the newest Version in my smart switch with BK7231N chip. After connecting to the AP I was able to configure wifi.
    Unfortunately the module doesn't connect to my router. I've already tried other wifi networks, with the same negative result,
    After connecting a converter to the UART 2 pins I was able to get the startup-log. The SSID and password are correct there, but I get no connection. Can you check the log and give me a hint how to get it to work? Thanks in advance...

    Info:MAIN:Time 1, idle 282566/s, free 77832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 2, idle 191149/s, free 77832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 3, idle 190353/s, free 77832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 4, idle 190465/s, free 77832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    supplicant_main_exiting
    supplicant_exit_done
    [sa_sta]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [sa_sta]ME_CONFIG_REQ
    [sa_sta]ME_CHAN_CONFIG_REQ
    [sa_sta]MM_START_REQ
    hapd_intf_add_vif,type:2, s:0, id:0
    wpa_dInit
    wpa_supplicant_req_scan
    Setting scan[retry16] request: 0.100000 sec
    MANUAL_SCAN_REQ
    enter low level!
    mac c8:47:8c: 0: 0: 0
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    Info:MAIN:Time 5, idle 191300/s, free 77832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:Galaxy Bernd key:xxxxx
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    Info:MAIN:Time 6, idle 182548/s, free 72488, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 182438/s, free 72488, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_driver_scan_cb
    wpa_get_scan_rst:1
    cipher2security 2 2 16 16
    Info:MAIN:Time 8, idle 85971/s, free 72728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 9, idle 0/s, free 72728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 10, idle 0/s, free 72728, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=c8:47:8c:00:00:00
    Info:GEN:sta: 0, softap: 0, b/g/n
    wpa_supplicant_connect
    Cancelling scan request
    wpa_driver_associate
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    ssid:Galaxy Bernd, 1
    found scan rst rssi -33 > -50
    ht in scan
    scan_start_req_handler
    aready open
    aready open
    me_set_ps_disable:840 0 0 1 0 3
    sm_auth_send:1
    sm_deauth_handler
    sm_deauth_handler reason=1,vif=0
    Info:MAIN:Time 11, idle 111310/s, free 71208, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    SM_DISCONNECTING status=1
    sm_deauth_handler
    sm_deauth_handler reason=1,vif=0
    sm_deauth_handler
    sm_deauth_handler reason=1,vif=0
    ---------SM_CONNECT_IND_fail
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_AUTH_FAILED - 3
  • #2
    p.kaczmarek2
    Moderator Smart Home
    Hm, first thing you can try is to do a 2MB flash backup in flasher and then use "Restore RF" button. In worst case you can always return to original version from your backup. Check if it helps.
    https://github.com/openshwprojects/BK7231GUIFlashTool
  • #3
    btmerz
    Level 4  
    Thanks for your suggestion. Unfortunately I had no success, while trying several times. There is always the same result...

    I've flashed another wifi switch with the same firmare / wifi / tools, without any connection problem.

    
    supplicant_main_exiting
    supplicant_exit_done
    [sa_sta]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [sa_sta]ME_CONFIG_REQ
    [sa_sta]ME_CHAN_CONFIG_REQ
    [sa_sta]MM_START_REQ
    hapd_intf_add_vif,type:2, s:0, id:0
    wpa_dInit
    wpa_supplicant_req_scan
    Setting scan[retry16] request: 0.100000 sec
    MANUAL_SCAN_REQ
    enter low level!
    mac 38:1f:8d:f0:74:51
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    Info:MAIN:Time 5, idle 191632/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38 
    Info:MAIN:ssid:FRITZ!Box 7490 key: xxxxx
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=38:1f:8d:f0:74:51 
    Info:GEN:sta: 0, softap: 0, b/g/n
    wpa_supplicant_connect
    Cancelling scan request
    wpa_driver_associate
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    ssid:FRITZ!Box 7490, 1
    found scan rst rssi -44 > -50
    ht in scan
    scan_start_req_handler
    aready open
    aready open
    SM_DISCONNECTING status=1
    ---------SM_CONNECT_IND_fail
  • #4
    p.kaczmarek2
    Moderator Smart Home
    btmerz wrote:

    I've flashed another wifi switch with the same firmare / wifi / tools, without any connection problem.

    So you have only one problematic switch that doesn't want to connect to AP, even after doing RF restore, and the other one is working 100% OK?
  • #5
    btmerz
    Level 4  
    Yes, that is correct.
  • #6
    p.kaczmarek2
    Moderator Smart Home
    If you really did Restore RF, or even Erase All, then I have totally no idea what we could try next. Was this device even working with Tuya?
  • #7
    btmerz
    Level 4  
    I didn't want to install the tuya app, so I didn't test it before flashing.
    As I mentioned, I tried Restore RF and even erase all several times.
    So, it seems, that I have to scrap that part, unfortunately...

    Thanks for your support...
  • #9
    btmerz
    Level 4  
    I think it is a cb2s module with a bk7231N chip.
    Before flashing, I made a backup of the original firmware.
  • #11
    btmerz
    Level 4  
    I will send you the backup as soon as I'm at home.

    To use Tasmota and an ESP was something I already considered.
  • #12
    p.kaczmarek2
    Moderator Smart Home
    If you are from Germany, you can also consider sending me this broken CB2S module physically. I am from Poland, so we are close neighbours. I could do some more tests on that and check if it is really dead and not connecting to my AP. Just for research purposes. We had few (maybe 3 so far?) similar reports, but they were mostly solved by "Restore RF" button. I am curious what might went wrong on that CB2S.

    You can also first try restoring Tuya backup (2MB) and checking if it works in Tuya App.
  • #13
    btmerz
    Level 4  
    OK.
    First I will send you the original firmware.
    Then I try to get the modul to work several times again.
    If I'm still not successfull, I get in contact with you and send you the module...
  • #15
    btmerz
    Level 4  
    So, in the meantime I got some success.
    I set up a mobile hotspot on my mobile phone and was able to connect the CB2S module to it!

    So, in principal it works. Then I set up a guest network on my fritz!box with the same SSID and the same simple and short password (12345678) ;-)
    The connection again failed.

    Perhaps this could give you a hint, to find the error...
    Thanks again for your support.

    Hinzugefügt nach 1 [Minuten]:

    >>20581561
    Yes, currently I only have these two.
    Three more will come within a few weeks...
  • #16
    p.kaczmarek2
    Moderator Smart Home
    Very strange... but also good that there is a progress. Can you try setting a longer password for your WiFi and retry?

    btmerz wrote:

    Perhaps this could give you a hint, to find the error...
    Thanks again for your support.

    I am still very confused. If the password length is the issue, then both of devices should not connect. And whole program logic is in flash... but one works and second doesn't... so I really don't know right now what may be wrong...

    Just a word of warning - make sure that devices have different MAC addresses. Otherwise they will not work well. Keep it in mind, because you might have used "Clear flash" button already but forgot to restore RF.
  • #17
    btmerz
    Level 4  
    My standard wifi password is 20 digits long. and it worked in the other device without problems.

    For my mobile hotspot (were it worked) and after that the guest wifi I used the same SSID and password (doesn't work in the router.

    After erase all I made also a restore RF run.
  • #18
    p.kaczmarek2
    Moderator Smart Home
    btmerz wrote:
    My standard wifi password is 20 digits long. and it worked in the other device without problems.

    This also confuses me greatly. From what I can tell, all logic of WiFi is inside Flash memory, and OBK build is the same on both devices (we don't change wiFi code at all), so it's all very strange.

    Well, so now, does the problematic device works if you... if you change the password/SSID to be like on your hot spot?

    Or.... maybe please double check, maybe you have just a MAC address duplication and that's the cause of the problems? Maybe your both devices have the same MAC? MAC duplication can prevent one device from joining WiFi that has already another device with the same MAC.... hmm..

    EDIT: but still, it would be strange, because, as far as I know, RF restore does RANDOMIZE the generated MAC....
  • #19
    btmerz
    Level 4  
    In the menu you are able to change the mac adress. There I've changed some numbers randomly. ==> No positive change
    I now have the guest wifi set to the exact values as my hotspot. I can connect to the hotspot, but not to the guest wifi.

    In my router I also changed the wifi channel to the same as in my hotspot. Also not working...

    I made two logs of both versions:

    guest wifi (not working):
    Info:MAIN:Time 2, idle 191508/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 3, idle 190426/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    temp_code:38 - adc_code:323 - adc_trend:[15]:330->[16]:320
    Info:MAIN:Time 4, idle 189880/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    supplicant_main_exiting
    supplicant_exit_done
    [sa_sta]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [sa_sta]ME_CONFIG_REQ
    [sa_sta]ME_CHAN_CONFIG_REQ
    [sa_sta]MM_START_REQ
    hapd_intf_add_vif,type:2, s:0, id:0
    wpa_dInit
    wpa_supplicant_req_scan
    Setting scan[retry16] request: 0.100000 sec
    MANUAL_SCAN_REQ
    enter low level!
    mac 38:1f:8d:53:a9:91
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    Info:MAIN:Time 5, idle 393245/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:Bernd key:12345678
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    Info:MAIN:Time 6, idle 183300/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 181966/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_driver_scan_cb
    get_scan_rst_null
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_DISCONNECTED - 2
    RL_STATUS_STA_SCAN_VAIN
    Failed to get scan results - try scanning again, retry cnt = 15.
    wpa_supplicant_req_scan
    Setting scan[retry15] request: 1.000000 sec
    Info:MAIN:Time 8, idle 187703/s, free 73832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    Info:MAIN:Time 9, idle 189965/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 10, idle 199864/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=38:1f:8d:53:a9:91
    Info:GEN:sta: 0, softap: 0, b/g/n
    wpa_driver_scan_cb
    get_scan_rst_null
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_DISCONNECTED - 2
    RL_STATUS_STA_SCAN_VAIN
    Failed to get scan results - try scanning again, retry cnt = 14.
    wpa_supplicant_req_scan
    Setting scan[retry14] request: 1.000000 sec
    Info:MAIN:Time 11, idle 186059/s, free 73832, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    Info:MAIN:Time 12, idle 190639/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 13, idle 194724/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 14, idle 189972/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_driver_scan_cb
    get_scan_rst_null
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_DISCONNECTED - 2
    RL_STATUS_STA_SCAN_VAIN


    Hotspot (working):

    Info:MAIN:Time 2, idle 189235/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 3, idle 188258/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 4, idle 189091/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    supplicant_main_exiting
    supplicant_exit_done
    [sa_sta]MM_RESET_REQ
    [bk]tx_txdesc_flush
    [sa_sta]ME_CONFIG_REQ
    [sa_sta]ME_CHAN_CONFIG_REQ
    [sa_sta]MM_START_REQ
    hapd_intf_add_vif,type:2, s:0, id:0
    wpa_dInit
    wpa_supplicant_req_scan
    Setting scan[retry16] request: 0.100000 sec
    MANUAL_SCAN_REQ
    enter low level!
    mac 38:1f:8d:53:a9:91
    leave low level!
    net_wlan_add_netif done!, vif_idx:0
    Info:MAIN:Time 5, idle 189434/s, free 77792, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:ssid:Bernd key:12345678
    wpa_supplicant_scan
    wpa_drv_scan
    wpa_send_scan_req
    ht in scan
    scan_start_req_handler
    Info:MAIN:Time 6, idle 180378/s, free 73056, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Boot complete time reached (5 seconds)
    Info:CFG:####### Set Boot Complete #######
    Info:MAIN:Time 7, idle 182217/s, free 72520, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    wpa_driver_scan_cb
    wpa_get_scan_rst:1
    cipher2security 2 2 16 16
    Info:MAIN:Time 8, idle 84631/s, free 72816, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 9, idle 0/s, free 72816, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 10, idle 0/s, free 72816, MQTT 0(0), bWifi 0, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=0.0.0.0 gate=0.0.0.0 mask=0.0.0.0 mac=38:1f:8d:53:a9:91
    Info:GEN:sta: 0, softap: 0, b/g/n
    wpa_supplicant_connect
    Cancelling scan request
    wpa_driver_associate
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTING - 1
    ssid:Bernd, 1
    found scan rst rssi -60 < -50
    dis ht_support
    no ht in scan
    scan_start_req_handler
    aready open
    aready open
    me_set_ps_disable:840 0 0 1 0 3
    sm_auth_send:1
    sm_auth_handler
    ht NOT in assoc req
    sm_assoc_rsp_handler
    rc_init: station_id=0 format_mod=0 pre_type=0 short_gi=0 max_bw=0
    rc_init: nss_max=0 mcs_max=255 r_idx_min=0 r_idx_max=11 no_samples=10
    rc_init: nss_max=0 mcs_max=255 r_idx_min=0 r_idx_max=11 no_samples=10
    ---------SM_CONNECT_IND_ok
    wpa_driver_assoc_cb
    Cancelling scan request
    new dtim period:2

    new ie: 0 : 42 65 72 6e 64
    new ie: 1 : 82 84 8b 96
    new ie: 3 : 6
    new ie: 30 : 1 0 0 f ac 4 1 0 0 f ac 4 1 0 0 f ac 2 c 0
    new ie: 2d : ad 1 13 ff ff 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0

    __l2_packet_send: ret 0
    __l2_packet_send: ret 0
    hapd_intf_add_key CCMP
    add sta_mgmt_get_sta
    sta:0, vif:0, key:0
    sta_mgmt_add_key
    add hw key idx:24
    hapd_intf_add_key CCMP
    add is_broadcast_ether_addr
    sta:255, vif:0, key:1
    add hw key idx:1
    ctrl_port_hdl:1
    me_set_ps_disable:840 0 0 0 0 3
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    sta_ip_start

    configuring interface mlan (with DHCP client)WARN: TCPIP mutex is NOT locked (1) caller 57B27

    WARN: TCPIP mutex is NOT locked (1) caller 57B27

    ip_addr: 7185a8c0
    Info:MAIN:Main_OnWiFiStatusChange - WIFI_STA_CONNECTED - 4
    Info:MAIN:Time 11, idle 93747/s, free 72976, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    temp_code:34 - adc_code:332 - adc_trend:[14]:340->[15]:330
    Info:MAIN:Time 12, idle 187534/s, free 73016, MQTT 0(0), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MQTT:mqtt_host empty, not starting mqtt
    Info:MAIN:Time 13, idle 188428/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 14, idle 187404/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 15, idle 183812/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 16, idle 188964/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 17, idle 187400/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 18, idle 186958/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 19, idle 188023/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:MAIN:Time 20, idle 187850/s, free 73016, MQTT 0(1), bWifi 1, secondsWithNoPing -1, socks 2/38
    Info:GEN:dhcp=0 ip=192.168.133.113 gate=192.168.133.223 mask=255.255.255.0 mac=38:1f:8d:53:a9:91
    Info:GEN:sta: 1, softap: 0, b/g/n

    Hinzugefügt nach 5 [Minuten]:

    I have compared the two logs. They start to differ at the line:

    not working:
    wpa_driver_scan_cb
    get_scan_rst_null

    working:
    wpa_driver_scan_cb
    wpa_get_scan_rst:1

    It may be have something to do with the wpa authentification...
  • #20
    p.kaczmarek2
    Moderator Smart Home
    If you are saying that password lenght somehow affects it, then the first thing to try would be to set the same password (and SSID?) on your router as you set on mobile phone AP and check if it works. Do both access points have the same security settings?

    The log messages you've shown come deep from BK7231 SDK:
    https://github.com/search?q=repo%3Aopenshwpro...%2FOpenBK7231T%20wpa_driver_scan_cb&type=code
    https://github.com/search?q=repo%3Aopenshwprojects%2FOpenBK7231T+get_scan_rst_null&type=code
    The error seem to say that no AP of given SSID was found.
    Openbeken BK7231N Chip: Smart Switch WiFi Connection Failure - SSID and Password Correct
    Maybe, just maybe, it's just a typo, after all?
  • #21
    btmerz
    Level 4  
    I've used exactly the same SSID (Bernd) and Password (12345678) on my mobile hotspot and on the guest wifi on my Fritz!Box.
    I checked several times for a typo. Everything is the same.

    I also used the SSID and password (20 digits) of my standard wifi in my mobile hotspot and was able to connect to it.
    But it doesn't connect to the router wifi after switching of the hotspot...

    I have no clue what to do next...
  • #24
    p.kaczmarek2
    Moderator Smart Home
    So what are the encryption settings on both networks? WPA, WPA2, something else?

    Added after 7 [minutes]:

    EDIT: Does one of the networks feature MAC filtering?
  • #26
    btmerz
    Level 4  
    Yesterday I received another three switches. After successfully flashing one device, I have the same problem connecting to WiFi 😩
  • #27
    p.kaczmarek2
    Moderator Smart Home
    Have you managed to successfully connect to that WiFi with Tasmota?

    How far is the router?

    Are you 100% sure that there is no MAC filtering/anything running on your router?

    Can you check with another router?

    I have never heard so far about WPA2 implementations being different between themselves, but something just has to be different...
  • #28
    btmerz
    Level 4  
    With my tasmota Devices connectionis no Problem at all. And I definitely have no mac filter activated.
  • #30
    p.kaczmarek2
    Moderator Smart Home
    @btmerz does problem appear for both T and N chips?
    @torrijo yes, same here, and same for my testers... so we need to figure out what is the difference in @btmerz setup... maybe he has some kind of setting enabled on router or smth