Using ethernet instead of wifi at root node

willemmerson
Posts: 6
Joined: Mon Mar 18, 2019 12:34 pm

Using ethernet instead of wifi at root node

Postby willemmerson » 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.

it_zzc
Posts: 40
Joined: Mon Apr 15, 2019 1:37 pm

Re: Using ethernet instead of wifi at root node

Postby it_zzc » Thu Sep 05, 2019 3:16 am

Your plan is OK, there are other customers who use it as well.

1. You can add it based on the simple example of get-started
Ethernet function
2. You need to add your mqtt creation in got_ip_event_handler
3. If you still can't solve it, please provide us with your code example. We can help you analyze the problem.

Who is online

Users browsing this forum: No registered users and 2 guests