Using ethernet instead of wifi at root node

willemmerson
Posts: 40
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.

ESP_Bond
Posts: 51
Joined: Mon Apr 15, 2019 1:37 pm

Re: Using ethernet instead of wifi at root node

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

tototrix
Posts: 1
Joined: Sat Feb 08, 2020 9:31 am

Re: Using ethernet instead of wifi at root node

Postby tototrix » Sat Feb 08, 2020 9:35 am

Hi,
I'm interested to get the same thing ( esp-mesh <----> ethernet or cellular).
Unfortunately i don't know where to start.
Can't you help me giving some links or ideas ?

Best regards.

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

Re: Using ethernet instead of wifi at root node

Postby willemmerson » Thu Mar 05, 2020 11:02 am

I think you would take the no_router example as a starting point:
https://github.com/espressif/esp-mdf/tr ... /no_router
Then instead of communicating over UART on the root node, you'd communicate over Ethernet/MQTT/Whatever.

Who is online

Users browsing this forum: No registered users and 23 guests