Hi,
It looks like this is a bug in v3.3 beta ("git describe" says it is version - v3.3-beta1-223-ga62cbfe) as it works fine in v3.1.2 with or without the call to "esp_mesh_set_self_organized(true,true)" after the call to esp_mesh_set_router. The code which does the switch is
Code: Select all
mesh_router_t newinfo;
strcpy((char*)newinfo.ssid, "XXXXXXX");
strcpy((char*)newinfo.password,"YYYYYY" );
newinfo.ssid_len = strlen((char*) newinfo.ssid);
ESP_LOGI(HOMEIOT_TAG, "About to call set router org ssid[%s] password[%s] len[%d]", newinfo.ssid, newinfo.password, newinfo.ssid_len);
esp_err_t err = esp_mesh_set_router(&newinfo);
ESP_LOGI(HOMEIOT_TAG, "Finished set router err [%d = %s]", err, esp_err_to_name(err));
err = esp_mesh_set_self_organized(true,true);
ESP_LOGI(HOMEIOT_TAG, "Finished set self organised [%d = %s]", err, esp_err_to_name(err));
the logs for this code segment using v3.3 beta are as follows
with the call to esp_mesh_set_self_organized
Code: Select all
[0;32mI (22368) mesh_node: MeshNodeEvent: <MESH_EVENT_NO_PARENT_FOUND>scan times:60[0m
[0;32mI (22378) HomeIoT: About to call set router org ssid[XXXXXX] password[YYYYYY] len[6][0m
[0;32mI (22388) HomeIoT: Finished set router err [0 = ESP_OK][0m
I (22388) mesh: [IO]enable self-organizing, search parent<adaptive>
[0;32mI (22398) HomeIoT: Finished set self organised [0 = ESP_OK][0m
D (22408) event: SYSTEM_EVENT_SCAN_DONE, status:1, number:0[0m
I (22408) mesh: <SYSTEM_EVENT_SCAN_DONE>status:fail, num:0, id:188
[0;32mI (22418) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (22408) mesh: <MESH_NWK_SCAN_REQ_PASSIVE>unexpected, stop previous scan by parent selection
I (22428) mesh: <MESH_NWK_SCAN_DONE>unexpected, flush scan results, request a new scan by MESH_NWK_LOOK_FOR_NETWORK
D (26648) event: SYSTEM_EVENT_SCAN_DONE, status:0, number:2[0m
I (26648) mesh: [FIND][ch:0]AP:2, otherID:0, MAP:0, idle:0, candidate:0, root:0[0e:fd:3f:0c:00:00]
[0;32mI (26648) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (26648) mesh: [FIND:61]fail to find a network, channel:0, cfg<channel:1, router:XXXXXX, 0e:fd:3f:0c:00:00>
without the call to esp_mesh_set_self_organized
Code: Select all
[0;32mI (22498) mesh_node: MeshNodeEvent: <MESH_EVENT_NO_PARENT_FOUND>scan times:60[0m
[0;32mI (22508) HomeIoT: About to call set router org ssid[XXXXXX] password[YYYYYY] len[6][0m
[0;32mI (22518) HomeIoT: Finished set router err [0 = ESP_OK][0m
[0;32mI (22528) HomeIoT: Finished set self organised [0 = ESP_OK][0m
D (22828) event: SYSTEM_EVENT_SCAN_DONE, status:0, number:1[0m
I (22828) mesh: [FIND][ch:1]AP:1, otherID:0, MAP:0, idle:0, candidate:0, root:0[20:fd:3f:0c:00:00]
[0;32mI (22828) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (22838) mesh: [FIND:61]fail to find a network, channel:0, cfg<channel:1, router:XXXXXX, 20:fd:3f:0c:00:00>
I (22848) mesh: <MESH_NWK_LOOK_FOR_NETWORK>need_scan:0x3, need_scan_router:0x1, look_for_nwk_count:62
I (22978) mesh: [FIND][ch:1]AP:1, otherID:0, MAP:0, idle:0, candidate:0, root:0[20:fd:3f:0c:00:00]<scan router>
D (22978) event: SYSTEM_EVENT_SCAN_DONE, status:0, number:1[0m
I (22978) mesh: [FIND:62]fail to find a network, channel:0, cfg<channel:1, router:XXXXXX, 20:fd:3f:0c:00:00>
Now the same logs for v3.1.2
with the call to esp_mesh_set_self_organized
Code: Select all
[0;32mI (45306) mesh_node: MeshNodeEvent: <MESH_EVENT_NO_PARENT_FOUND>scan times:0[0m
[0;32mI (45306) HomeIoT: About to call set router org ssid[XXXXXX] password[YYYYYY] len[6][0m
[0;32mI (45316) HomeIoT: Finished set router err [0 = ESP_OK][0m
I (45326) mesh: [IO]enable self-organizing, search parent<adaptive>
[0;32mI (45326) HomeIoT: Finished set self organised [0 = ESP_OK][0m
I (45336) mesh: <MESH_NWK_PARENT_SELECTION>scan_from_yield:0, connected_layer:0
D (45346) event: SYSTEM_EVENT_SCAN_DONE, status:1, number:0[0m
W (45346) wifi: scan number 0
[0;32mI (45346) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (45356) mesh: [SCAN][ch:1]AP:0, otherID:0, MAP:0, idle:0, candidate:0, root:0, topMAP:0[c:0,i:0]<>
I (45366) mesh: [FAIL][121]root:0, fail:121, normal:0, <pre>backoff:0
D (45676) event: SYSTEM_EVENT_SCAN_DONE, status:0, number:1[0m
I (45676) mesh: [SCAN][ch:1]AP:1, otherID:0, MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:0]router found<>
[0;32mI (45676) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (45676) mesh: 1232[SCAN]init rc[24:0a:c4:82:6f:1d,-48], mine:0, voter:0
I (45686) mesh: 1270, vote myself, router rssi:-48 > voted rc_rssi:-120
I (45696) mesh: [SCAN:1/10]rc[128][24:0a:c4:82:6f:1d,-48], self[24:0a:c4:82:6f:1c,-48,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,24:0a:c4:82:6f:1d]
without the call to esp_mesh_set_self_organized
Code: Select all
[0;32mI (45126) mesh_node: MeshNodeEvent: <MESH_EVENT_NO_PARENT_FOUND>scan times:0[0m
[0;32mI (45136) HomeIoT: About to call set router org ssid[XXXXXX] password[YYYYYY] len[6][0m
[0;32mI (45146) HomeIoT: Finished set router err [0 = ESP_OK][0m
[0;32mI (45146) HomeIoT: Finished set self organised [0 = ESP_OK][0m
I (45156) mesh: <MESH_NWK_PARENT_SELECTION>scan_from_yield:0, connected_layer:0
D (45466) event: SYSTEM_EVENT_SCAN_DONE, status:0, number:1[0m
I (45466) mesh: [SCAN][ch:1]AP:1, otherID:0, MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:0]router found<>
[0;32mI (45466) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (45466) mesh: 1232[SCAN]init rc[24:0a:c4:82:6f:1d,-41], mine:0, voter:0
I (45486) mesh: 1270, vote myself, router rssi:-41 > voted rc_rssi:-120
I (45486) mesh: [SCAN:1/10]rc[128][24:0a:c4:82:6f:1d,-41], self[24:0a:c4:82:6f:1c,-41,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,24:0a:c4:82:6f:1d]
D (45806) event: SYSTEM_EVENT_SCAN_DONE, status:0, number:1[0m
I (45806) mesh: [SCAN][ch:1]AP:1, otherID:0, MAP:0, idle:0, candidate:1, root:0, topMAP:0[c:0,i:1]router found<>
[0;32mI (45806) wifi_node: WIFINodeEvent: Unknown event [1][0m
I (45806) mesh: 1232[SCAN]init rc[24:0a:c4:82:6f:1d,-40], mine:0, voter:0
I (45826) mesh: [SCAN:2/10]rc[128][24:0a:c4:82:6f:1d,-40], self[24:0a:c4:82:6f:1c,-40,reason:0,votes:1,idle][mine:1,voter:1(1.00)percent:1.00][128,1,24:0a:c4:82:6f:1d]