https://www.nongnu.org/lwip/2_1_x/group__bridgeif.html
Some instructions are given here, but it's too simple. How do I implement an LWIP bridge in ESP-IDF? Please help, thank you!
How to implement an LWIP bridge?
-
- Posts: 207
- Joined: Fri May 07, 2021 10:35 am
Re: How to implement an LWIP bridge?
There is already an example to demonstrate it Please see https://github.com/espressif/esp-idf/tr ... ork/bridge
Just note that Ethernet is supported only.
Just note that Ethernet is supported only.
Re: How to implement an LWIP bridge?
Thank you very much!
-
- Posts: 167
- Joined: Sun May 22, 2022 2:42 pm
Re: How to implement an LWIP bridge?
In a way to solve the requirements shown in the first post of https://github.com/espressif/esp-idf/issues/5697 I tried the bridge example, but I need to have a) a dhcp server running and b) bridge eth and wifi.
Although the manual forwarding as shown in one of David Cermak‘s examples works fine, it strikes me at being a bit hacky, I‘d prefer a solution done inside lwip. What would it take to enhance the bridging to also feature Wi-Fi (while having support for running a DHCP server on the Bridged interface)?
Although the manual forwarding as shown in one of David Cermak‘s examples works fine, it strikes me at being a bit hacky, I‘d prefer a solution done inside lwip. What would it take to enhance the bridging to also feature Wi-Fi (while having support for running a DHCP server on the Bridged interface)?
-
- Posts: 207
- Joined: Fri May 07, 2021 10:35 am
Re: How to implement an LWIP bridge?
@DrMickeyLauer I currently work on the LwIP bridge example to demonstrate bridged Wifi as well. I have working demo but it is very hacky so far to say. Please stand by.
Regarding DHCP server, try to modify
There should be also ESP NETIF API to do it programatically to modify properties of `br_netif`. Please excuse my vague suggestions. I'm on train, I'll check that tomorrow.
Please also note that LwIP's bridge Forwarding Database Functions are meant as an example as stated at https://www.nongnu.org/lwip/2_1_x/group ... __fdb.html. In addition, SPI is also bottle neck if you use SPI Ethernet. Therefore please expect limited performance.
For example, I achieved the following performance between two endnodes with bridge realized by two KSZ885's (SPI @40MHz):
UDP = 9.4 Mbps
TCP = 7.0 Mbps
This is good enough for generic IoT use case in my opinion. However may not be sufficient for some high performance use case.
Regarding DHCP server, try to modify
Code: Select all
esp_netif_br_config.flags = ESP_NETIF_DHCP_SERVER | ESP_NETIF_DEFAULT_ARP_FLAGS | ESP_NETIF_FLAG_EVENT_IP_MODIFIED | ESP_NETIF_FLAG_IS_BRIDGE;
Please also note that LwIP's bridge Forwarding Database Functions are meant as an example as stated at https://www.nongnu.org/lwip/2_1_x/group ... __fdb.html. In addition, SPI is also bottle neck if you use SPI Ethernet. Therefore please expect limited performance.
For example, I achieved the following performance between two endnodes with bridge realized by two KSZ885's (SPI @40MHz):
UDP = 9.4 Mbps
TCP = 7.0 Mbps
This is good enough for generic IoT use case in my opinion. However may not be sufficient for some high performance use case.
-
- Posts: 207
- Joined: Fri May 07, 2021 10:35 am
Re: How to implement an LWIP bridge?
You can find the very first "work in progress" version of bridge working with option to bridge WiFi AP at https://github.com/kostaond/esp-idf/tre ... ork/bridge
Who is online
Users browsing this forum: Bing [Bot] and 103 guests