Help running the manual_networking example

abulafi
Posts: 4
Joined: Tue Dec 25, 2018 11:20 am

Help running the manual_networking example

Postby abulafi » Tue Dec 25, 2018 1:37 pm

I am looking for help to run the manual_networking example on latest SDK (v3.3-beta1-132-gdb8bc3e).
The leaf node cannot find the root node and throws an exception instead.

First I tried to run the example with MESH_SET_ROOT on the root esp module. During this, I faced one issue connecting to the router:

Code: Select all

I (79702) mesh: [wifi]disconnected reason:110(empty password), continuous:524/max:12, root, vote(,stopped)<><><><>
This happened although the router password was set correctly in menuconfig.
However, I managed to fix this issue (or maybe not) by manually setting the password just below the line if (my_type == MESH_ROOT) {

Code: Select all

memcpy((uint8_t *)&parent.sta.password, CONFIG_MESH_ROUTER_PASSWD, strlen(CONFIG_MESH_ROUTER_PASSWD));
After that, the root node seems to be started successfully with following log:

Code: Select all

W (7823) mesh_main: <PARENT>Linksys07445, xx:xx:xx:2e:6c:80, channel:1, rssi:-37
I (7833) wifi: mode : sta (xx:xx:xx:c5:66:bc) + softAP (xx:xx:xx:c5:66:bd)
I (7843) mesh: [IO]disable self-organizing<reconnect>
I (8843) mesh: [MANUAL]connect to router:Linksys07445, xx:xx:xx:2e:6c:80[layer:0], ID:00:00:00:00:00:00<connect>
I (10473) wifi: new:<1,1>, old:<1,0>, ap:<1,1>, sta:<1,0>, prof:1
I (11453) wifi: state: init -> auth (b0)
I (11463) wifi: state: auth -> assoc (0)
I (11473) wifi: state: assoc -> run (10)
I (11503) wifi: connected with Linksys07445, channel 1, bssid = xx:xx:xx:2e:6c:80
I (11503) wifi: pm start, type: 0

I (11503) mesh: [scan]new scanning time:600ms
W (11503) wifi: [beacon]new interval:300ms
E (11503) event: invalid static ip
I (11513) mesh_main: <MESH_EVENT_PARENT_CONNECTED>layer:0-->1, parent:xx:xx:xx:2e:6c:80<ROOT>, ID:00:00:00:00:00:00
I (11523) mesh_main: <MESH_EVENT_TODS_REACHABLE>state:0
I (11533) mesh_main: <MESH_EVENT_ROOT_ADDRESS>root address:xx:xx:xx:c5:66:bd
I (13763) mesh_main: <MESH_EVENT_ROOT_GOT_IP>sta ip: 192.168.100.132, mask: 255.255.255.0, gw: 192.168.100.1
I (13763) event: sta ip: 192.168.100.132, mask: 255.255.255.0, gw: 192.168.100.1
Next I tried to compile and flash the code on the second esp with MESH_SET_NODE flag. However, the node esp is not able to find the root node and instead throw an exception:

Code: Select all

W (7803) mesh_main: <Warning>no parent found, modify IE crypto configuration and scan
W (7813) mesh_main: <Config>modify IE crypto key to hello, esp-mesh.
ESP_ERROR_CHECK failed: esp_err_t 0xffffffff (ESP_FAIL) at 0x4008bf74
0x4008bf74: _esp_error_check_failed at C:/......./esp/esp-idf/components/esp32/panic.c:712

file: "C:/......./esp/modified-examples/mesh/manual_networking/main/mesh_main.c" line 142
func: mesh_scan_done_handler
expression: esp_wifi_scan_stop()

Backtrace: 0x4008bb2c:0x3ffd1660 0x4008bf77:0x3ffd1680 0x400d2f0b:0x3ffd16a0 0x400d3345:0x3ffd1910 0x4012ebe0:0x3ffd19a0 0x4008ef09:0x3ffd1d00
0x4008bb2c: invoke_abort at C:/......./esp/esp-idf/components/esp32/panic.c:707

0x4008bf77: _esp_error_check_failed at C:/......./esp/esp-idf/components/esp32/panic.c:713

0x400d2f0b: mesh_scan_done_handler at C:/......./esp/modified-examples/mesh/manual_networking/main/mesh_main.c:142 (discriminator 1)

0x400d3345: mesh_event_handler at C:/......./esp/modified-examples/mesh/manual_networking/main/mesh_main.c:257 (discriminator 9)

0x4012ebe0: mesh_nwk_task_main at ??:?

0x4008ef09: vPortTaskWrapper at C:/......./esp/esp-idf/components/freertos/port.c:403
After doing some tracing I found that the root module is listed but the returned ie_len by calling esp_mesh_scan_get_ap_ie_len is 0.

Code: Select all

I (7503) mesh_main: [0], xx:xx:xx:c5:66:bd, channel:1, rssi:-20
Appreciate any help.

ESP_yudong
Posts: 68
Joined: Wed May 16, 2018 12:31 pm

Re: Help running the manual_networking example

Postby ESP_yudong » Wed Dec 26, 2018 7:39 am

Hi abulafi,

Thanks for using ESP-MESH.
There's issue in the manual_networking example, the issue has been fixed but not merged now.

If you want to use the example immediately. You can change your codes locally.
  • remove ESP_ERROR_CHECK of esp_wifi_scan_stop
  • change the code to set password

    Code: Select all

             if (my_type == MESH_ROOT) {
    +           memcpy(&parent.sta.password, CONFIG_MESH_ROUTER_PASSWD, strlen(CONFIG_MESH_ROUTER_PASSWD));
                 ESP_LOGW(....);
             } else {
    +           memcpy(&parent.sta.password, CONFIG_MESH_AP_PASSWD, strlen(CONFIG_MESH_AP_PASSWD));
                 ESP_LOGW(...);
             }
             ESP_ERROR_CHECK(esp_mesh_set_parent(&parent, (mesh_addr_t *)&parent_assoc.mesh_id, my_type, my_layer)); 
    

giomar
Posts: 3
Joined: Wed Dec 19, 2018 10:42 am

Re: Help running the manual_networking example

Postby giomar » Wed Jan 09, 2019 9:50 am

Hello,

I'm a newbie and I just try the last version of the manual_networking example with two ESP-WROVER-KIT V3.
I do not modify anything, except for the router SSID and password in the make menuconfig.

As expected, the root node (the one compiled with #define MESH_SET_ROOT uncommented) connects to the router.

The proposed fix is already present, but the child node (the one compiled with #define MESH_SET_ROOT leaved commented) cannot connect to the parent.

Using the debugger, I noticed that the child seems to fail to connect to the parent due to the ie_len equal to 0.

Can you suggest me where I'm wrong?

Thank you!

unmesh_swar
Posts: 1
Joined: Thu Nov 21, 2019 8:44 am

Re: Help running the manual_networking example

Postby unmesh_swar » Thu Nov 21, 2019 8:49 am

even I am facing the same issue. sometimes I get the ssid and ie_len filled but most of the time they are empty. why am i getting such inconsistency?

ESP_yudong
Posts: 68
Joined: Wed May 16, 2018 12:31 pm

Re: Help running the manual_networking example

Postby ESP_yudong » Thu Nov 28, 2019 8:53 am

Root log:

Code: Select all

I (2316) mesh_main: <MESH_EVENT_STARTED>ID:77:77:77:77:77:77
I (7026) mesh_main: IE_CRYPTO_KEY:MAP_PASSWD, MESH_ID:77:77:77:77:77:77
...
I (10086) esp_netif_handlers: sta ip: 192.168.10.7, mask: 255.255.255.0, gw: 192.168.10.1
I (10086) mesh_main: <IP_EVENT_STA_GOT_IP>IP:192.168.10.7
I (10086) mesh_main: IE_CRYPTO_KEY:MAP_PASSWD, MESH_ID:00:00:00:00:00:00 
Node log:

Code: Select all

I (7020) mesh_main: <MESH_EVENT_SCAN_DONE>number:106
I (7020) mesh_main: IE_CRYPTO_KEY:MAP_PASSWD, MESH_ID:77:77:77:77:77:77
...
W (7030) mesh_main: <Warning>no parent found, modify IE crypto configuration and scan
W (7040) mesh_main: <Config>modify IE crypto key to hello, esp-mesh.
I (12290) mesh: 3352<scan>self-organized is disabled, users shall read out scan results by themselves.
I (12290) mesh_main: <MESH_EVENT_SCAN_DONE>number:105
I (12290) mesh_main: IE_CRYPTO_KEY:hello, esp-mesh., MESH_ID:77:77:77:77:77:77
...
The mesh id was changed when the root connecting to the router. So the non-root node can't decrypt the mesh ie of the root.
If we set them to the same mesh_id and ie_crypto_key, the node could find the root successfully.

I think these problems will be fixed in the manual_networking example later.


Edit:
The author of this example thought this example is used to connect to an existing network. This means if you want to use this example, you should build an existing network first.

Who is online

Users browsing this forum: No registered users and 36 guests