esp-mdf
esp-mdf copied to clipboard
get-started example doesn't create mesh on ESP32-C3
Environment
- Development Kit: |ESP32-C3-DevKitM-1|
- Kit version (for ESP32-C3-DevKitM-1): [v1.0|
- Core: |ESP32-C3-MINI-1U]
- MDF version: cf50274
- Development Env: |Make| Visual Studio Code
- Operating System: [Windows 11|
- Power Supply: [USB|
Problem Description
Hello there!
I'm flashing two boards with the get-started example, one as root, the other as non-root. They are less than a meter between each other.
When the devices start the mesh, they're not being able to connect and send messages to each other. I think it has something to do with the WiFi because I always have this log: "wifi: I haven't to connect to a suitable AP now!" But I haven't found any code where I can input my WiFi credentials.
I also tested the console-test example with the "mesh_config -i 14:12:12:12:12:12 -s espressif -p espressif" command, but that one didn't work either
Expected Behavior
Mesh network sends messages between each other as Hello root! and Hello node!
Actual Behavior
Devices don't create a mesh network between them, so no message is sent.
Steps to reproduce
- set the first device as root, compile and flash
- set the second device as non-root, compile and flash
Code to reproduce this issue
same as get-started example. I haven't changed anything.
SDK config file: sdkconfig.txt
Debug Logs
debug logs from root device
I (515) phy_init: phy_version 907,3369105-dirty,Dec 3 2021,14:55:12
I (559) wifi:mode : sta (84:f7:03:67:da:b0)
I (559) wifi:enable tsf
I (560) [mwifi, 298]: esp-mdf version: v1.0-156-gcf50274
I (561) wifi:mode : sta (84:f7:03:67:da:b0) + softAP (84:f7:03:67:da:b1)
I (567) wifi:Total power save buffer number: 16
I (571) wifi:Init max length of beacon: 752/752
chan:1,max_power:80
chan:2,max_power:80
chan:3,max_power:80
chan:4,max_power:80
chan:5,max_power:80
chan:6,max_power:80
chan:7,max_power:80
chan:8,max_power:80
chan:9,max_power:80
chan:10,max_power:80
chan:11,max_power:80
chan:12,max_power:80
chan:13,max_power:80
chan:14,max_power:80
I (601) wifi:Init max length of beacon: 752/752
I (607) mesh: <nvs>read layer:0, err:0x1102
I (609) mesh: <nvs>read assoc:0, err:0x1102
I (613) mesh: [IO]disable self-organizing<reconnect>
I (618) wifi:Set ps type: 0
I (621) mesh: [CONFIG]invalid router settings, ssid_len:0, ssid:, bssid:00:00:00:00:00:00
I (1254) mesh: [MANUAL]designated as root and router is not set
I (1255) [mwifi, 224]: MESH is started
I (1255) [get_started, 185]: event_loop_cb, event: 0
I (1259) [get_started, 189]: MESH is started
I (1264) [get_started, 30]: Root is running
W (11269) wifi:Haven't to connect to a suitable AP now!
I (11269) [get_started, 133]: System information, channel: 13, layer: 1, self mac: 84:f7:03:67:da:b0, parent bssid: 00:00:00:00:00:00, parent rssi: -120, node num: 1, free heap: 183664
W (21269) wifi:Haven't to connect to a suitable AP now!
I (21269) [get_started, 133]: System information, channel: 13, layer: 1, self mac: 84:f7:03:67:da:b0, parent bssid: 00:00:00:00:00:00, parent rssi: -120, node num: 1, free heap: 183664
W (31269) wifi:Haven't to connect to a suitable AP now!
I (31269) [get_started, 133]: System information, channel: 13, layer: 1, self mac: 84:f7:03:67:da:b0, parent bssid: 00:00:00:00:00:00, parent rssi: -120, node num: 1, free heap: 183664
debug logs from non-root device
I (548) phy_init: phy_version 907,3369105-dirty,Dec 3 2021,14:55:12
I (597) wifi:mode : sta (84:f7:03:68:13:d4)
I (597) wifi:enable tsf
I (598) [mwifi, 298]: esp-mdf version: v1.0-156-gcf50274
I (599) wifi:mode : sta (84:f7:03:68:13:d4) + softAP (84:f7:03:68:13:d5)
I (605) wifi:Total power save buffer number: 16
I (609) wifi:Init max length of beacon: 752/752
chan:1,max_power:80
chan:2,max_power:80
chan:3,max_power:80
chan:4,max_power:80
chan:5,max_power:80
chan:6,max_power:80
chan:7,max_power:80
chan:8,max_power:80
chan:9,max_power:80
chan:10,max_power:80
chan:11,max_power:80
chan:12,max_power:80
chan:13,max_power:80
chan:14,max_power:80
I (639) wifi:Init max length of beacon: 752/752
I (645) mesh: <nvs>read layer:0, err:0x1102
I (647) mesh: <nvs>read assoc:0, err:0x1102
I (652) wifi:Set ps type: 0
I (654) mesh: [CONFIG]invalid router settings, ssid_len:0, ssid:, bssid:00:00:00:00:00:00
I (1288) [mwifi, 224]: MESH is started
I (1288) [get_started, 185]: event_loop_cb, event: 0
I (1288) [get_started, 189]: MESH is started
I (1292) [get_started, 93]: Node write task is running
I (1298) [get_started, 64]: Note read task is running
W (1588) wifi:scan number is 0
I (1589) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (1593) mesh: [FAIL][1]root:0, fail:1, normal:0
W (1898) wifi:scan number is 0
I (1898) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (1902) mesh: [FAIL][2]root:0, fail:2, normal:0
W (2208) wifi:scan number is 0
I (2208) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (2212) mesh: [FAIL][3]root:0, fail:3, normal:0
W (2517) wifi:scan number is 0
I (2518) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (2522) mesh: [FAIL][4]root:0, fail:4, normal:0
W (2827) wifi:scan number is 0
I (2828) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (2831) mesh: [FAIL][5]root:0, fail:5, normal:0
W (3137) wifi:scan number is 0
I (3137) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (3141) mesh: [FAIL][6]root:0, fail:6, normal:0
W (3447) wifi:scan number is 0
I (3447) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (3451) mesh: [FAIL][7]root:0, fail:7, normal:0
W (3756) wifi:scan number is 0
I (3757) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (3761) mesh: [FAIL][8]root:0, fail:8, normal:0
W (4066) wifi:scan number is 0
I (4066) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (4070) mesh: [FAIL][9]root:0, fail:9, normal:0
W (4376) wifi:scan number is 0
I (4376) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (4380) mesh: [FAIL][10]root:0, fail:10, normal:0
W (4686) wifi:scan number is 0
I (4686) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (4690) mesh: [FAIL][11]root:0, fail:11, normal:0
W (4995) wifi:scan number is 0
I (4996) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (5000) mesh: [FAIL][12]root:0, fail:12, normal:0
W (5305) wifi:scan number is 0
I (5306) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (5310) mesh: [FAIL][13]root:0, fail:13, normal:0
W (5615) wifi:scan number is 0
I (5616) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (5620) mesh: [FAIL][14]root:0, fail:14, normal:0
W (5925) wifi:scan number is 0
I (5926) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (5929) mesh: [FAIL][15]root:0, fail:15, normal:0
W (6235) wifi:scan number is 0
I (6235) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (6239) mesh: [FAIL][16]root:0, fail:16, normal:0
W (6545) wifi:scan number is 0
I (6545) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (6549) mesh: [FAIL][17]root:0, fail:17, normal:0
W (6855) wifi:scan number is 0
I (6855) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (6859) mesh: [FAIL][18]root:0, fail:18, normal:0
W (7165) wifi:scan number is 0
I (7165) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (7169) mesh: [FAIL][19]root:0, fail:19, normal:0
W (7474) wifi:scan number is 0
I (7475) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (7479) mesh: [FAIL][20]root:0, fail:20, normal:0
W (7784) wifi:scan number is 0
I (7785) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (7789) mesh: [FAIL][21]root:0, fail:21, normal:0
W (8094) wifi:scan number is 0
I (8095) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (8099) mesh: [FAIL][22]root:0, fail:22, normal:0
W (8404) wifi:scan number is 0
I (8405) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (8408) mesh: [FAIL][23]root:0, fail:23, normal:0
W (8714) wifi:scan number is 0
I (8714) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (8718) mesh: [FAIL][24]root:0, fail:24, normal:0
W (9024) wifi:scan number is 0
I (9024) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (9028) mesh: [FAIL][25]root:0, fail:25, normal:0
W (9334) wifi:scan number is 0
I (9334) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (9338) mesh: [FAIL][26]root:0, fail:26, normal:0
W (9644) wifi:scan number is 0
I (9644) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (9648) mesh: [FAIL][27]root:0, fail:27, normal:0
W (9954) wifi:scan number is 0
I (9954) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (9958) mesh: [FAIL][28]root:0, fail:28, normal:0
W (10263) wifi:scan number is 0
I (10264) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (10268) mesh: [FAIL][29]root:0, fail:29, normal:0
W (10574) wifi:scan number is 0
I (10574) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (10578) mesh: [FAIL][30]root:0, fail:30, normal:0
W (10884) wifi:scan number is 0
I (10884) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (10888) mesh: [FAIL][31]root:0, fail:31, normal:0
W (11194) wifi:scan number is 0
I (11194) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (11198) mesh: [FAIL][32]root:0, fail:32, normal:0
W (11304) wifi:Haven't to connect to a suitable AP now!
I (11304) [get_started, 133]: System information, channel: 13, layer: -1, self mac: 84:f7:03:68:13:d4, parent bssid: 00:00:00:00:00:00, parent rssi: -120, node num: 0, free heap: 179180
W (11504) wifi:scan number is 0
I (11505) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (11509) mesh: [FAIL][33]root:0, fail:33, normal:0
W (11814) wifi:scan number is 0
I (11815) mesh: [SCAN][ch:13]AP:0, other(ID:0, RD:0), MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0][00:00:00:00:00:00][FIXED-ROOT]<>
I (11819) mesh: [FAIL][34]root:0, fail:34, normal:0
playing around I reset first the non-root device, and then the root device, which outputs these logs but nothing happens:
I (19887) mesh: <MESH_NWK_PARENT_SELECTION>no parent found, set ROOTLESS, scan times:60, heap:172784
I (19897) [get_started, 185]: event_loop_cb, event: 9
I (19898) mesh: <MESH_NWK_PARENT_SELECTION>channel<cfg:13> is allowed to switch, do a full channel scan
W (19912) wifi:age timer already deinit
I (19915) wifi:mode : sta (84:f7:03:68:13:d4)
I (19920) [mwifi, 266]: Network state: root_less
I (19924) [get_started, 185]: event_loop_cb, event: 11
I (19930) [get_started, 185]: event_loop_cb, event: 20
I (19925) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x2, need_scan_router:0x0, look_for_nwk_count:0
W (21304) wifi:Haven't to connect to a suitable AP now!
I (21304) [get_started, 133]: System information, channel: 4, layer: -1, self mac: 84:f7:03:68:13:d4, parent bssid: 00:00:00:00:00:00, parent rssi: -120, node num: 0, free heap: 180444
I (23849) mesh: [FIND][ch:0]AP:1, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]
I (23849) mesh: [FIND:1]fail to find a network, channel:0, cfg<channel:13, router:, 00:00:00:00:00:00>
I (23857) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x2, need_scan_router:0x0, look_for_nwk_count:0
I (27770) mesh: [FIND][ch:0]AP:1, otherID:0, MAP:0, idle:0, candidate:0, root:0[00:00:00:00:00:00][FIXED-ROOT]
I (27770) mesh: [FIND:2]fail to find a network, channel:0, cfg<channel:13, router:, 00:00:00:00:00:00>
...
@gomez9656 For print: W (141331) wifi:Haven't to connect to a suitable AP now! This is because of the mwifi_get_parent_rssi API. This is not a problem, just a hint that the root node is not connecting to the server.
From your log, this means that the mesh id set by the node may be incorrect, resulting in the failure to network successfully.
I can't see CONFIG_MESH_ID="123456" from the sdkconfig you sent me. Make sure you haven't made any menuconfig changes, just set the device type. Screenshot below: