ip_internal_network with fixed root using ethernet

cipandema
Posts: 3
Joined: Wed Jun 08, 2022 12:41 pm

ip_internal_network with fixed root using ethernet

Postby cipandema » Thu Jun 09, 2022 8:21 pm

I am trying to modify the example ip_internal_network to use a fixed root and connect to network using ethernet interface instead of wifi sta.

Can anyone suggest the needed modifications to allow for frames from nodes in the mesh network to be routed correctly to the outside network.

When I run the example as it is, I can see with wireshark that frames from nodes in the mesh network have the IP of my LAN gateway (192.168.1.1) as source IP.

In my modified version (with ethernet), the frames from a node in the mesh network is transmitted to the LAN network with root node's IP address (192.168.1.51) as source IP on LAN. This seems to be incorrect, but I have not been able to figure what needs to be changed for the messages to be routed the right way in the root of my mesh.

Any suggestion is appreciated!

cipandema
Posts: 3
Joined: Wed Jun 08, 2022 12:41 pm

Re: ip_internal_network with fixed root using ethernet

Postby cipandema » Fri Jun 10, 2022 12:36 pm

It turns out that I was using v4.3.1 of esp-idf.
moving to HEAD of master for esp-idf my code is actually working fine (after modifying some code to adopt to changes in esp-idf)
After this I tried also recommended stable version (currently 4.4.1), not working.
Then tested also release/v4.4 and release/5.0, none working.

I will keep this post open until I find the commit solving the issue.

If someone have a working solution for the recommended stable version (v4.4.1) I would appreciate some hints.

cipandema
Posts: 3
Joined: Wed Jun 08, 2022 12:41 pm

Re: ip_internal_network with fixed root using ethernet

Postby cipandema » Wed Jun 15, 2022 8:30 am

I am now able to use the esp-idf version of choice: release/v4.4 (as of now v4.4.1-262-g5e6cffbb14).

I am initializing the ethernet interface after the mesh network.
in the "got ip event", I added:
  1.             mesh_netifs_start(true);
  2.             esp_mesh_post_toDS_state(true);
  3.  
  4.             s_current_ip.addr = event->ip_info.ip.addr;
  5.         #if !CONFIG_MESH_USE_GLOBAL_DNS_IP
  6.             esp_netif_t *netif = event->esp_netif;
  7.             ESP_ERROR_CHECK(esp_netif_get_dns_info(netif, ESP_NETIF_DNS_MAIN, &s_dns));
  8.             mesh_netif_start_root_ap(true, s_dns.ip.u_addr.ip4.addr);
  9.         #endif
  10.             esp_mesh_comm_mqtt_task_start();
Works great to communication directly with resources outside of the mesh network from any node.

kikiriki
Posts: 1
Joined: Mon Oct 16, 2023 7:39 pm

Re: ip_internal_network with fixed root using ethernet

Postby kikiriki » Mon Oct 16, 2023 7:43 pm

Dear cipandema,

This is very interesting topic, thank you for sharing your findings.
Can you share modifications that you made to the example ip_internal_network to use a fixed root and connect to network using ethernet interface instead of wifi sta?

Thanks!

Who is online

Users browsing this forum: rsimpsonbusa and 68 guests