Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If I set wifi auth==wpa ,node can't connect to root in esp mesh network (IDFGH-11521) #12646

Closed
3 tasks done
fzboffice opened this issue Nov 23, 2023 · 9 comments
Closed
3 tasks done
Assignees
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF

Comments

@fzboffice
Copy link

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

IDF version.

v5.2

Espressif SoC revision.

ESP32

Operating System used.

Windows

How did you build your project?

VS Code IDE

If you are using Windows, please specify command line type.

None

Development Kit.

ESP32_DEVKIT_V4

Power Supply used.

USB

What is the expected behavior?

node connect to root

What is the actual behavior?

node can not connect to root

Steps to reproduce.

I use esp-idf\examples\mesh\internal_communication project.
Call esp_mesh_fix_root(true);
Call esp_mesh_set_type(MESH_NODE);(another development board call call esp_mesh_set_type(MESH_ROOT);)
Set Mesh AP Authentication Mode to CONFIG_WIFI_AUTH_WPA_PSK in "Example Configuration" in menuconfig.
Compile esp-idf\examples\mesh\internal_communication and flash.

Debug Logs.

ets Jun  8 2016 00:22:57

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:7140
load:0x40078000,len:15500
load:0x40080400,len:4
load:0x40080404,len:3904
entry 0x40080640
I (29) boot: ESP-IDF v5.2-dev-3903-g66992aca7a 2nd stage bootloader
I (29) boot: compile time Nov 23 2023 09:39:41
I (31) boot: Multicore bootloader
I (35) boot: chip revision: v1.0
I (38) boot.esp32: SPI Speed      : 40MHz
I (43) boot.esp32: SPI Mode       : DIO
I (48) boot.esp32: SPI Flash Size : 2MB
I (52) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (61) boot: ## Label            Usage          Type ST Offset   Length
I (68) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (76) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (83) boot:  2 factory          factory app      00 00 00010000 00100000
I (91) boot: End of partition table
I (95) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=2c730h (182064) map
I (166) esp_image: segment 1: paddr=0003c758 vaddr=3ffb0000 size=038c0h ( 14528) load
I (172) esp_image: segment 2: paddr=00040020 vaddr=400d0020 size=ac1e0h (704992) map
I (413) esp_image: segment 3: paddr=000ec208 vaddr=3ffb38c0 size=0045ch (  1116) load
I (414) esp_image: segment 4: paddr=000ec66c vaddr=40080000 size=1658ch ( 91532) load
I (466) boot: Loaded app from partition at offset 0x10000
I (466) boot: Disabling RNG early entropy source...
I (478) cpu_start: Multicore app
I (487) cpu_start: Pro cpu start user code
I (487) cpu_start: cpu freq: 160000000 Hz
I (487) cpu_start: Application information:
I (490) cpu_start: Project name:     internal_communication
I (496) cpu_start: App version:      1
I (501) cpu_start: Compile time:     Nov 23 2023 09:45:01
I (507) cpu_start: ELF file SHA256:  28edbd050...
I (512) cpu_start: ESP-IDF:          v5.2-dev-3903-g66992aca7a
I (519) cpu_start: Min chip rev:     v0.0
I (523) cpu_start: Max chip rev:     v3.99 
I (528) cpu_start: Chip rev:         v1.0
I (533) heap_init: Initializing. RAM available for dynamic allocation:
I (540) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (546) heap_init: At 3FFB9A00 len 00026600 (153 KiB): DRAM
I (552) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (559) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (565) heap_init: At 4009658C len 00009A74 (38 KiB): IRAM
I (573) spi_flash: detected chip: generic
I (576) spi_flash: flash io: dio
W (580) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (594) main_task: Started on CPU0
I (604) main_task: Calling app_main()
I (654) wifi:wifi driver task: 3ffc1d04, prio:23, stack:6656, core=0
I (674) wifi:wifi firmware version: b43e2ce
I (674) wifi:wifi certification version: v7.0
I (674) wifi:config NVS flash: enabled
I (674) wifi:config nano formating: disabled
I (684) wifi:Init data frame dynamic rx buffer num: 32
I (684) wifi:Init static rx mgmt buffer num: 5
I (694) wifi:Init management short buffer num: 32
I (694) wifi:Init dynamic tx buffer num: 32
I (694) wifi:Init static rx buffer size: 1600
I (704) wifi:Init static rx buffer num: 10
I (704) wifi:Init dynamic rx buffer num: 32
I (714) wifi_init: rx ba win: 6
I (714) wifi_init: tcpip mbox: 32
I (714) wifi_init: udp mbox: 6
I (724) wifi_init: tcp mbox: 6
I (724) wifi_init: tcp tx win: 5744
I (734) wifi_init: tcp rx win: 5744
I (734) wifi_init: tcp mss: 1440
I (734) wifi_init: WiFi IRAM OP enabled
I (744) wifi_init: WiFi RX IRAM OP enabled
I (744) phy_init: phy_version 4780,16b31a7,Sep 22 2023,20:42:16
I (834) wifi:mode : sta (c4:4f:33:3e:cb:01) + softAP (c4:4f:33:3e:cb:02)
I (834) wifi:enable tsf
I (834) wifi:Total power save buffer number: 16
I (834) wifi:Init max length of beacon: 752/752
I (834) wifi:Init max length of beacon: 752/752
I (844) mesh: <nvs>read layer:0, err:0x1102
I (844) mesh: <nvs>read assoc:0, err:0x1102
I (854) wifi:Set ps type: 0, coexist: 0

I (854) mesh: [CONFIG]fail to set node, err:0x4008
I (874) wifi:Total power save buffer number: 16
I (1134) wifi:mode : sta (c4:4f:33:3e:cb:01)
I (1144) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x1, need_scan_router:0x0, look_for_nwk_count:1
I (1144) mesh_main: <MESH_EVENT_MESH_STARTED>ID:77:77:77:77:77:77
I (1144) mesh_main: mesh starts successfully, heap:171536, root fixed<0>(tree), ps:0
I (1154) main_task: Returned from app_main()
I (1444) mesh: [FIND][ch:1]AP:7, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]
I (1444) mesh: [FIND:1]fail to find a network, channel:0, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (1454) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x1, look_for_nwk_count:2
I (1584) mesh: [FIND][ch:1]AP:0, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]<scan router>
I (1584) mesh: [FIND:2]fail to find a network, channel:0, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (1594) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x0, look_for_nwk_count:3
I (1904) mesh: [FIND][ch:1]AP:6, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]
I (1904) mesh: [FIND:3]fail to find a network, channel:0, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (1914) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x1, look_for_nwk_count:4
I (2044) mesh: [FIND][ch:1]AP:0, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]<scan router>
I (2044) mesh: [FIND:4]fail to find a network, channel:0, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (2054) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x0, look_for_nwk_count:5
I (2364) mesh: [FIND][ch:1]AP:8, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]
I (2364) mesh: [FIND:5]fail to find a network, channel:0, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (2374) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x1, look_for_nwk_count:6
I (2504) mesh: [FIND][ch:1]AP:0, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]<scan router>
I (2504) mesh: [FIND:6]fail to find a network, channel:0, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (2514) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x0, look_for_nwk_count:7
I (2824) mesh: find root:ESPM_3EECF5, root_cap:1(max:300), new channel:1, old channel:0
I (2824) mesh: [FIND][ch:1]AP:8, otherID:0, MAP:1, idle:0, candidate:0, root:1[00:00:00:00:00:00][FIXED-ROOT]
I (2824) mesh: [FIND:7]find a network, channel:1, cfg<channel:1, router:12345678, 00:00:00:00:00:00>

I (2834) mesh_main: <MESH_EVENT_FIND_NETWORK>new channel:1, router BSSID:00:00:00:00:00:00
I (2834) wifi:mode : sta (c4:4f:33:3e:cb:01) + softAP (c4:4f:33:3e:cb:02)
W (2854) wifi:<MESH AP>adjust channel:1, secondary channel offset:1(40U)
I (2864) wifi:Total power save buffer number: 16
W (2874) wifi:<MESH AP>adjust channel:1, secondary channel offset:1(40U)
I (2884) wifi:Total power save buffer number: 16
I (3184) mesh: [SCAN][ch:1]AP:8, other(ID:0, RD:0), MAP:1, idle:0, candidate:1, root:1, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (3184) mesh: 7370[selection]try rssi_threshold:-78, backoff times:0, max:5<-78,-82,-85>
I (3194) mesh: [DONE]connect to parent:ESPM_3EECF5, channel:1, rssi:-22, c4:4f:33:3e:ec:f6[layer:1, assoc:0], my_vote_num:0/voter_num:0, rc[00:00:00:00:00:00/-120/0]
I (4734) mesh: [wifi]disconnected reason:201(), continuous:1/max:12, non-root, vote(,)<><>
I (4734) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:201
I (6234) mesh: [wifi]disconnected reason:201(), continuous:2/max:12, non-root, vote(,)<><>
I (6234) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:201
I (7744) mesh: [wifi]disconnected reason:201(), continuous:3/max:12, non-root, vote(,)<><>
I (7744) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:201
I (9244) mesh: [wifi]disconnected reason:201(), continuous:4/max:12, non-root, vote(,)<><>
I (9244) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:201
I (10744) mesh: [wifi]disconnected reason:201(), continuous:5/max:12, non-root, vote(,)<><>
I (10744) mesh_main: <MESH_EVENT_PARENT_DISCONNECTED>reason:201

More Information.

No response

@fzboffice fzboffice added the Type: Bug bugs in IDF label Nov 23, 2023
@fzboffice
Copy link
Author

If I set wifi auth==WPA/WPA2, it works.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Nov 23, 2023
@github-actions github-actions bot changed the title If I set wifi auth==wpa ,node can't connect to root in esp mesh network If I set wifi auth==wpa ,node can't connect to root in esp mesh network (IDFGH-11521) Nov 23, 2023
@fzboffice
Copy link
Author

This issue does not seem to be caused by the auth mode. The error with this issue is that my AP password is randomly selected between "!" and "~". When I am randomly selected between "0" and "9", no matter which authentication method is used, it can work normally.

@fzboffice
Copy link
Author

update!
I can connect when password include '0'-'9' and auth is wpa/wpa2
I can't connect when password include '!'-'~' and auth is wpa/wpa2
I can't connect when auth is wpa,no matter what password

@zhangyanjiaoesp
Copy link
Collaborator

@fzboffice Can you reproduce it just running the internal_communication project? I have tested on the internal_communication example, and set the password to mypass!word, mypass~word, !!!!~~~~, !~!~!~!~, they all can connect successfully.

@fzboffice
Copy link
Author

fzboffice commented Nov 23, 2023

@zhangyanjiaoesp not just '!'and '''' word,it is random start from'!' to ''''.

@fzboffice
Copy link
Author

@zhangyanjiaoesp Do you set auth mode to wpa?

@espressif-bot espressif-bot added Status: In Progress Work is in progress and removed Status: Opened Issue is new labels Nov 24, 2023
@zhangyanjiaoesp
Copy link
Collaborator

@zhangyanjiaoesp Do you set auth mode to wpa?

Just test with the authmode set to WPA, and the node device can't found the AP indeed. And we will solve it ASAP.

@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: In Progress Work is in progress Status: Reviewing Issue is being reviewed labels Nov 30, 2023
@fzboffice
Copy link
Author

@zhangyanjiaoesp Has this issue been solved?

@zhangyanjiaoesp
Copy link
Collaborator

The fix has been merged internally, and it will take some time to sync to Github.

igrr pushed a commit that referenced this issue Dec 20, 2023
1. fix the bug that station can't found AP when the authmode is WPA
2. fix wifi mode error when mesh start after station has connected to router

Closes #12646
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Type: Bug bugs in IDF
Projects
None yet
Development

No branches or pull requests

3 participants