ESP32S3,IDF5.1,Wifi连接不上,auth -> init (200)

teddyzheng
Posts: 11
Joined: Tue Aug 22, 2023 3:06 am

ESP32S3,IDF5.1,Wifi连接不上,auth -> init (200)

Postby teddyzheng » Mon Sep 18, 2023 6:01 pm

官方开发板上是:
wifi:state: init -> auth (b0)
wifi:state: auth -> assoc (0)
wifi:state: assoc -> run (10)
然后就连接上了,但我这里老是从auth状态退回到init状态,不知道啥原因?
要对芯片做什么配置吗?
错误日志:

Code: Select all

V (31147) esp_adapter: thread sem create: sem=0x3fce4aec
V (31157) esp_adapter: thread sem get: sem=0x3fce4aec
V (31157) esp_adapter: thread sem get: sem=0x3fce4aec
D (31167) nvs: nvs_get opmode 1
V (31167) esp_adapter: thread sem get: sem=0x3fce4aec
D (31167) wifi:clear blacklist
D (31177) nvs: nvs_set_blob sta.ssid 36
D (31177) nvs: nvs_set_blob sta.pswd 65
D (31187) nvs: nvs_set bssid.set 1 0
D (31187) nvs: nvs_set sta.lis_intval 2 3
D (31187) nvs: nvs_set sta.chan 1 0
D (31197) nvs: nvs_set sta.scan_method 1 1
D (31197) nvs: nvs_set sta.sort_method 1 0
D (31217) nvs: nvs_set sta.minrssi 1 -120
D (31217) nvs: nvs_set sta.minauth 1 3
D (31217) nvs: nvs_set_blob sta.apsw 2
D (31217) nvs: nvs_set sta.pmf_e 1 1
D (31217) nvs: nvs_set sta.pmf_r 1 0
D (31217) nvs: nvs_set sta.rrm_e 1 0
D (31227) nvs: nvs_set sta.btm_e 1 0
D (31227) nvs: nvs_set sta.mbo_e 1 0
D (31247) nvs: nvs_set sta.ft 1 0
D (31247) nvs: nvs_set sta.owe 1 0
D (31247) nvs: nvs_set sta.bss_retry 1 0
D (31247) nvs: nvs_set sta.trans_d 1 0
D (31247) nvs: nvs_set sta.sae_h2e 1 2
D (31247) nvs: nvs_set sta.sae_pk_mode 1 0
D (31257) nvs: nvs_set_blob sta.sae_h2e_id 32
D (31257) nvs: nvs_set_blob sta.apinfo 700
V (31277) esp_adapter: thread sem get: sem=0x3fce4aec
V (31277) wifi:ht20 freq=2412, chan=1
D (31277) wifi:filter: set rx policy=0
I (31277) wifi:mode : sta (7c:df:a1:f2:0a:e8)
I (31277) wifi:enable tsf
D (31287) wifi:filter: set rx policy=1
D (31287) wifi:connect status 0 -> 0
D (31287) event: running post WIFI_EVENT:2 with handler 0x4207f3fc and context 0x3c19a06c on loop 0x3c191458
D (31297) wifi_init_default: wifi_start esp-netif:0x3c199e0c event-id2
V (31287) pthread: pthread_task_func END 0x420ef6a4
D (31307) wifi_init_default: WIFI mac address: 7c df a1 f2 a e8
V (31317) esp_adapter: thread sem create: sem=0x3fce4bb0
V (31317) esp_adapter: thread sem get: sem=0x3fce4bb0
V (31317) esp_adapter: thread sem create: sem=0x3fce4c60
D (31337) esp_netif_lwip: check: remote, if=0x3c199e0c fn=0x4207b9e0

V (31337) esp_adapter: thread sem get: sem=0x3fce4c60
D (31347) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (31307) pthread: Task stk_wm = 4496
D (31357) esp_netif_handlers: esp_netif action has started with netif0x3c199e0c from event_id=2
V (31337) pthread: pthread_join 0x3c1a9e1c
D (31367) esp_netif_lwip: check: remote, if=0x3c199e0c fn=0x4207c284

V (31377) pthread: pthread_join 0x3c1a9e1c EXIT 0
V (31387) esp_adapter: thread sem get: sem=0x3fce4c60
D (31387) esp_netif_lwip: esp_netif_start_api 0x3c199e0c
D (31397) esp_netif_lwip: esp_netif_get_hostname esp_netif:0x3c199e0c
V (31397) pthread: pthread_mutex_destroy 0x3c1a9da8
D (31407) esp_netif_lwip: check: local, if=0x3c199e0c fn=0x4207caf8

V (31427) esp_adapter: thread sem get: sem=0x3fce4c60
D (31417) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3c199e0c
V (31437) esp_netif_lwip: esp_netif_is_netif_up esp_netif:0x3c199e0c
D (31447) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (31447) event: running post WIFI_EVENT:2 with handler 0x4200d528 and context 0x3c1a8490 on loop 0x3c191458
V (31457) esp_adapter: thread sem get: sem=0x3fce4bb0
D (31467) wifi:Start wifi connect
D (31467) wifi:connect status 0 -> 0
D (31477) wifi:connect chan=0
V (31477) wifi:nvs=0, ssid=NetGear, channel=255
V (31477) wifi:ssid=NetGear match nvs 0, channel=255
D (31487) wifi:first chan=1
D (31487) wifi:connect status 0 -> 1
D (31487) wifi:filter: set rx policy=3
D (31497) wifi:clear scan ap list
D (31497) wifi:start scan: type=0x50f, priority=2, cb=0x420b0bd0, arg=0x0, ss_state=0x1, time=31517326, index=0
V (31507) wifi:inter_channel_timeout: arg=0x0, ss_state=0x1
D (31517) wifi:perform scan: ss_state=0x9, chan<1,0>, dur<0,120>
V (31517) wifi:change: chan<1,0>, dur<0,240>
V (31527) wifi:enter start op, arg=0x3fca3f1e
V (31527) wifi:scan operation: state=0x3, chan<1,0>, arg=0x3fca3f1e, status=0
V (31537) wifi:scan specific ssid=NetGear
V (31537) wifi:start max timer
V (31637) esp_adapter: thread sem get: sem=0x3fce4c60
D (31777) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (31777) wifi:perform scan: ss_state=0x9, chan<2,0>, dur<0,120>
V (31777) wifi:change: chan<2,0>, dur<0,240>
V (31787) wifi:ht20 freq=2417, chan=2
V (31787) wifi:enter start op, arg=0x3fca3f1e
V (31787) wifi:scan operation: state=0x3, chan<2,0>, arg=0x3fca3f1e, status=0
V (31797) wifi:scan specific ssid=NetGear
V (31797) wifi:start max timer
V (31897) esp_adapter: thread sem get: sem=0x3fce4c60
D (32047) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (32047) wifi:perform scan: ss_state=0x9, chan<3,0>, dur<0,120>
V (32047) wifi:change: chan<3,0>, dur<0,240>
V (32047) wifi:ht20 freq=2422, chan=3
V (32047) wifi:enter start op, arg=0x3fca3f1e
V (32057) wifi:scan operation: state=0x3, chan<3,0>, arg=0x3fca3f1e, status=0
V (32067) wifi:scan specific ssid=NetGear
V (32067) wifi:start max timer
V (32167) esp_adapter: thread sem get: sem=0x3fce4c60
D (32307) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (32307) wifi:perform scan: ss_state=0x9, chan<4,0>, dur<0,120>
V (32307) wifi:change: chan<4,0>, dur<0,240>
V (32317) wifi:ht20 freq=2427, chan=4
V (32317) wifi:enter start op, arg=0x3fca3f1e
V (32317) wifi:scan operation: state=0x3, chan<4,0>, arg=0x3fca3f1e, status=0
V (32327) wifi:scan specific ssid=NetGear
V (32327) wifi:start max timer
V (32427) esp_adapter: thread sem get: sem=0x3fce4c60
D (32577) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (32577) wifi:perform scan: ss_state=0x9, chan<5,0>, dur<0,120>
V (32577) wifi:change: chan<5,0>, dur<0,240>
V (32577) wifi:ht20 freq=2432, chan=5
V (32577) wifi:enter start op, arg=0x3fca3f1e
V (32587) wifi:scan operation: state=0x3, chan<5,0>, arg=0x3fca3f1e, status=0
V (32587) wifi:scan specific ssid=NetGear
V (32597) wifi:start max timer
V (32697) esp_adapter: thread sem get: sem=0x3fce4c60
D (32837) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (32837) wifi:perform scan: ss_state=0x9, chan<6,0>, dur<0,120>
V (32837) wifi:change: chan<6,0>, dur<0,240>
V (32837) wifi:ht20 freq=2437, chan=6
V (32847) wifi:enter start op, arg=0x3fca3f1e
V (32847) wifi:scan operation: state=0x3, chan<6,0>, arg=0x3fca3f1e, status=0
V (32857) wifi:scan specific ssid=NetGear
V (32857) wifi:start max timer
V (32957) esp_adapter: thread sem get: sem=0x3fce4c60
D (33107) wifi:scan end: arg=0x0, status=0, ss_state=0x3
D (33107) wifi:perform scan: ss_state=0x9, chan<7,0>, dur<0,120>
V (33107) wifi:change: chan<7,0>, dur<0,240>
V (33107) wifi:ht20 freq=2442, chan=7
V (33107) wifi:enter start op, arg=0x3fca3f1e
V (33117) wifi:scan operation: state=0x3, chan<7,0>, arg=0x3fca3f1e, status=0
V (33117) wifi:scan specific ssid=NetGear
V (33127) wifi:start max timer
D (33197) wifi:rsn valid: gcipher=3 ucipher=3 akm=5

V (33197) wifi:updated connection retries to 0
D (33197) wifi:profile match: ss_state=0x7
V (33197) wifi:scan histroy table is not full yet, add
V (33197) wifi:add ssid=NetGear, chan=7 to scan history
V (33227) esp_adapter: thread sem get: sem=0x3fce4c60
D (33297) wifi:rsn valid: gcipher=3 ucipher=3 akm=5

D (33297) wifi:set max rate: from <rate=130, phy=3, sig=0> to <rate=144, phy=3 sig=0>
D (33297) wifi:sig_b=0, sig_g=0, sig_n=0, max_b=22, max_g=108, max_n=144
D (33307) wifi:profile match: ss_state=0x7
V (33307) wifi:update scan history ssid=NetGear, channel=7
D (33367) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (33367) wifi:perform scan: ss_state=0xd, chan<8,0>, dur<0,120>
V (33367) wifi:change: chan<8,0>, dur<0,240>
V (33367) wifi:ht20 freq=2447, chan=8
V (33377) wifi:enter start op, arg=0x3fca3f1e
V (33377) wifi:scan operation: state=0x7, chan<8,0>, arg=0x3fca3f1e, status=0
V (33387) wifi:scan specific ssid=NetGear
V (33387) wifi:start max timer
V (33487) esp_adapter: thread sem get: sem=0x3fce4c60
D (33637) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (33637) wifi:perform scan: ss_state=0xd, chan<9,0>, dur<0,120>
V (33637) wifi:change: chan<9,0>, dur<0,240>
V (33637) wifi:ht20 freq=2452, chan=9
V (33637) wifi:enter start op, arg=0x3fca3f1e
V (33647) wifi:scan operation: state=0x7, chan<9,0>, arg=0x3fca3f1e, status=0
V (33647) wifi:scan specific ssid=NetGear
V (33657) wifi:start max timer
V (33757) esp_adapter: thread sem get: sem=0x3fce4c60
D (33897) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (33897) wifi:perform scan: ss_state=0xd, chan<10,0>, dur<0,120>
V (33897) wifi:change: chan<10,0>, dur<0,240>
V (33897) wifi:ht20 freq=2457, chan=10
V (33907) wifi:enter start op, arg=0x3fca3f1e
V (33907) wifi:scan operation: state=0x7, chan<10,0>, arg=0x3fca3f1e, status=0
V (33917) wifi:scan specific ssid=NetGear
V (33917) wifi:start max timer
V (34017) esp_adapter: thread sem get: sem=0x3fce4c60
D (34157) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (34167) wifi:perform scan: ss_state=0xd, chan<11,0>, dur<0,120>
V (34167) wifi:change: chan<11,0>, dur<0,240>
V (34167) wifi:ht20 freq=2462, chan=11
V (34167) wifi:enter start op, arg=0x3fca3f1e
V (34177) wifi:scan operation: state=0x7, chan<11,0>, arg=0x3fca3f1e, status=0
V (34177) wifi:scan specific ssid=NetGear
V (34187) wifi:start max timer
V (34287) esp_adapter: thread sem get: sem=0x3fce4c60
D (34427) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (34427) wifi:perform scan: ss_state=0xd, chan<12,0>, dur<360,360>
V (34427) wifi:change: chan<12,0>, dur<0,240>
V (34427) wifi:ht20 freq=2467, chan=12
V (34437) wifi:enter start op, arg=0x3fca3f1e
V (34437) wifi:scan operation: state=0x7, chan<12,0>, arg=0x3fca3f1e, status=0
V (34447) wifi:passive scan, listen only
V (34447) wifi:start max timer
V (34547) esp_adapter: thread sem get: sem=0x3fce4c60
D (34697) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (34697) wifi:perform scan: ss_state=0xd, chan<13,0>, dur<360,360>
V (34697) wifi:change: chan<13,0>, dur<0,240>
V (34697) wifi:ht20 freq=2472, chan=13
V (34697) wifi:enter start op, arg=0x3fca3f1e
V (34707) wifi:scan operation: state=0x7, chan<13,0>, arg=0x3fca3f1e, status=0
V (34707) wifi:passive scan, listen only
V (34717) wifi:start max timer
V (34817) esp_adapter: thread sem get: sem=0x3fce4c60
D (34957) wifi:scan end: arg=0x0, status=0, ss_state=0x7
D (34957) wifi:perform scan: ss_state=0xd, chan<14,0>, dur<360,360>
V (34957) wifi:change: chan<14,0>, dur<0,240>
V (34957) wifi:ht20 freq=2484, chan=14
V (34967) wifi:enter start op, arg=0x3fca3f1e
V (34967) wifi:scan operation: state=0x7, chan<14,0>, arg=0x3fca3f1e, status=0
V (34977) wifi:passive scan, listen only
V (34977) wifi:start max timer
V (35077) esp_adapter: thread sem get: sem=0x3fce4c60
D (35227) wifi:scan end: arg=0x0, status=0, ss_state=0x7
V (35227) wifi:back home chan=<1,0>, current chan=<14,0>
V (35227) wifi:ht20 freq=2412, chan=1
D (35227) wifi:filter: set rx policy=4
D (35227) wifi:first chan=1
V (35227) wifi:scan_done: arg=0x0, status=0, cur_time=35250976, scan_id=128, scan state=0
V (35237) wifi:call scan_done cb, arg=0x0
D (35247) wifi:handoff_cb: status=0
V (35247) wifi:best bss has set.
D (35247) wifi:ap found, mac=5c:78:f8:da:18:80
V (35257) wifi:bssid=5c:78:f8:da:18:80, LR=0
D (35257) wifi:new_bss=0x3fca4218, cur_bss=0x0, new_chan=<7,0>, cur_chan=1
D (35267) wifi:filter: set rx policy=5
I (35267) wifi:new:<7,0>, old:<1,0>, ap:<255,255>, sta:<7,0>, prof:1
V (35277) wifi:ht20 freq=2442, chan=7
D (35277) wifi:connect_op: status=0, auth=5, cipher=3 
D (36117) nvs: nvs_set_blob sta.apinfo 700
V (36117) esp_adapter: thread sem get: sem=0x3fce4c60
D (36127) wifi:auth mode is not none
D (36127) wifi:connect_bss: auth=1, reconnect=0
I (36127) wifi:state: init -> auth (b0)
D (36127) wifi:start 1s AUTH timer
D (36137) wifi:clear scan ap list
V (36227) esp_adapter: thread sem get: sem=0x3fce4c60
V (36327) esp_adapter: thread sem get: sem=0x3fce4c60
V (36427) esp_adapter: thread sem get: sem=0x3fce4c60
V (36527) esp_adapter: thread sem get: sem=0x3fce4c60
V (36627) esp_adapter: thread sem get: sem=0x3fce4c60
V (36727) esp_adapter: thread sem get: sem=0x3fce4c60
V (36827) esp_adapter: thread sem get: sem=0x3fce4c60
V (36927) esp_adapter: thread sem get: sem=0x3fce4c60
V (37027) esp_adapter: thread sem get: sem=0x3fce4c60
V (37127) esp_adapter: thread sem get: sem=0x3fce4c60
D (37137) wifi:auth timeout
I (37137) wifi:state: auth -> init (200)
D (37137) wifi:connect status 1 -> 4
D (37137) wifi:stop beacon/connect timer
D (37137) wifi:reason: auth expire(2)
D (37137) wifi:add bssid 5c:78:f8:da:18:80 to blacklist, cnt=0
D (37147) wifi:stop CSA timer
V (37147) wifi:bss connection retry cnt=0
D (37157) wifi:remove 5c:78:f8:da:18:80 from rc list
I (37157) wifi:new:<7,0>, old:<7,0>, ap:<255,255>, sta:<7,0>, prof:1
D (37167) wifi:filter: set rx policy=8
D (37167) wifi:Send disconnect event, reason=2, AP number=0
D (37177) event: running post WIFI_EVENT:5 with handler 0x4207f370 and context 0x3c19a0fc on loop 0x3c191458
D (37177) esp_netif_handlers: esp_netif action disconnected with netif0x3c199e0c from event_id=5
D (37187) esp_netif_lwip: check: remote, if=0x3c199e0c fn=0x4207c040

V (37177) esp_adapter: thread sem get: sem=0x3fce4c60
D (37197) esp_netif_lwip: esp_netif_down_api esp_netif:0x3c199e0c
D (37207) esp_netif_lwip: esp_netif_start_ip_lost_timer esp_netif:0x3c199e0c
D (37217) esp_netif_lwip: if0x3c199e0c start ip lost tmr: no need start because netif=0x3c199e90 interval=120 ip=0
D (37227) esp_netif_lwip: check: local, if=0x3c199e0c fn=0x4207caf8

D (37237) esp_netif_lwip: esp_netif_update_default_netif_lwip 0x3c199e0c
V (37237) esp_adapter: thread sem get: sem=0x3fce4c60
V (37237) esp_netif_objects: esp_netif_next_unsafe 0x0
V (37247) esp_netif_lwip: esp_netif_is_netif_up esp_netif:0x3c199e0c
V (37257) esp_netif_objects: esp_netif_next_unsafe 0x3c199e0c
D (37217) mqtt_client: Reconnecting...
D (37257) esp_netif_lwip: call api in lwip: ret=0x0, give sem
D (37267) event: running post MQTT_EVENTS:7 with handler 0x4200cc00 and context 0x3c1a8e24 on loop 0x3c1a9b9c
D (37267) event: running post WIFI_EVENT:5 with handler 0x4200d528 and context 0x3c1a8490 on loop 0x3c191458

ESP_Penguin_Helper
Posts: 156
Joined: Tue Jul 11, 2023 6:55 am

Re: ESP32S3,IDF5.1,Wifi连接不上,auth -> init (200)

Postby ESP_Penguin_Helper » Tue Sep 19, 2023 6:33 am

看你的log应该是连接超时了。

Code: Select all

D (37137) wifi:auth timeout
I (37137) wifi:state: auth -> init (200)
D (37137) wifi:connect status 1 -> 4
D (37137) wifi:stop beacon/connect timer
D (37137) wifi:reason: auth expire(2)
参考 Wi-Fi 原因代码:https://docs.espressif.com/projects/esp ... .html#id34
wificode.png
wificode.png (54.98 KiB) Viewed 3839 times
需要抓包来进行进一步分析。

teddyzheng
Posts: 11
Joined: Tue Aug 22, 2023 3:06 am

Re: ESP32S3,IDF5.1,Wifi连接不上,auth -> init (200)

Postby teddyzheng » Tue Sep 19, 2023 8:28 am

ESP_Penguin_Helper wrote:
Tue Sep 19, 2023 6:33 am
看你的log应该是连接超时了。

Code: Select all

D (37137) wifi:auth timeout
I (37137) wifi:state: auth -> init (200)
D (37137) wifi:connect status 1 -> 4
D (37137) wifi:stop beacon/connect timer
D (37137) wifi:reason: auth expire(2)
参考 Wi-Fi 原因代码:https://docs.espressif.com/projects/esp ... .html#id34
wificode.png

需要抓包来进行进一步分析。
另外问一下:
我们是使用芯片来直接onboard,没有使用官方模组。想问一下出厂的芯片需要对wifi、蓝牙做什么配置才能用吗?比如发射功率、频偏等。还是说不配置通常也能用,只是信号好坏的细微差别?
程序按道理是没有错的,因为同一个固件在官方的模组上可以正常跑,在我们板子上wifi连不上,而且蓝牙是可以用的,看信号也没有啥大问题,就WiFi不行。
我用命令“espefuse.py summary”读取芯片的efuse,与官方模组中的efuse做对比,除mac地址外,Calibration fuses的差异比较大。
有什么建议吗?

ESP_Penguin_Helper
Posts: 156
Joined: Tue Jul 11, 2023 6:55 am

Re: ESP32S3,IDF5.1,Wifi连接不上,auth -> init (200)

Postby ESP_Penguin_Helper » Tue Sep 19, 2023 9:52 am

使用芯片的话需要对射频进行调试,主要由三部分组成:PCB 板射频走线、芯片匹配电路、天线及其匹配电路。

匹配网络的参数值需基于实际天线和 PCB 布局进行测试来确定。参考 ESP32-S3 硬件设计指南 2.5 射频章节:https://www.espressif.com/sites/default ... nes_cn.pdf

请问你们有参考硬件设计指南做合适的射频匹配吗?

另外,Calibration fuses 中没有射频校准的参数,所以应该不用去参考这个。

teddyzheng
Posts: 11
Joined: Tue Aug 22, 2023 3:06 am

Re: ESP32S3,IDF5.1,Wifi连接不上,auth -> init (200)

Postby teddyzheng » Thu Sep 21, 2023 5:43 am

ESP_Penguin_Helper wrote:
Tue Sep 19, 2023 9:52 am
使用芯片的话需要对射频进行调试,主要由三部分组成:PCB 板射频走线、芯片匹配电路、天线及其匹配电路。

匹配网络的参数值需基于实际天线和 PCB 布局进行测试来确定。参考 ESP32-S3 硬件设计指南 2.5 射频章节:https://www.espressif.com/sites/default ... nes_cn.pdf

请问你们有参考硬件设计指南做合适的射频匹配吗?

另外,Calibration fuses 中没有射频校准的参数,所以应该不用去参考这个。
经检查,确实是天线的问题,感谢!

Who is online

Users browsing this forum: Google [Bot] and 212 guests