Using ethernet instead of wifi at root node
Posted: Tue Sep 03, 2019 8:46 am
I am wondering if it's possible to use ethernet and the best way to achieve this.
I have an esp32 dev board with an ethernet port and I currently have ethernet connecting and getting an ip, with the mesh set up as being a root node, as in routerless example. The code is mostly the same as the mwifi mqtt_example but with addition of ethernet code.
The problem is that MDF_EVENT_MWIFI_ROOT_GOT_IP event never happens so the code that sets up mqtt, root tasks, etc. doesn't get called, see https://github.com/espressif/esp-mdf/bl ... ple.c#L338
I tried esp_mesh_post_toDS_state(true) after getting an ip address from ethernet but it doesn't work.
I also tried sending the event myself e.g. mdf_event_loop_send(MDF_EVENT_MWIFI_ROOT_GOT_IP, NULL) which works but later code such as esp_mesh_get_routing_table() returns nothing because it hasn't registered the root node over ethernet.
Perhaps I just need to rewrite this part of the code but is what I'm doing sensible? I suspect even if I got this working other things like mupgrade wouldn't work. I was looking at the eth2ap ethernet example and wondered if I could do the same thing, redirect ethernet to ap so the mesh thinks it's connected to a router and I don't have to change any code.
I have an esp32 dev board with an ethernet port and I currently have ethernet connecting and getting an ip, with the mesh set up as being a root node, as in routerless example. The code is mostly the same as the mwifi mqtt_example but with addition of ethernet code.
The problem is that MDF_EVENT_MWIFI_ROOT_GOT_IP event never happens so the code that sets up mqtt, root tasks, etc. doesn't get called, see https://github.com/espressif/esp-mdf/bl ... ple.c#L338
I tried esp_mesh_post_toDS_state(true) after getting an ip address from ethernet but it doesn't work.
I also tried sending the event myself e.g. mdf_event_loop_send(MDF_EVENT_MWIFI_ROOT_GOT_IP, NULL) which works but later code such as esp_mesh_get_routing_table() returns nothing because it hasn't registered the root node over ethernet.
Perhaps I just need to rewrite this part of the code but is what I'm doing sensible? I suspect even if I got this working other things like mupgrade wouldn't work. I was looking at the eth2ap ethernet example and wondered if I could do the same thing, redirect ethernet to ap so the mesh thinks it's connected to a router and I don't have to change any code.