-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ethernet to WiFi bridge: where to start? #508
Comments
A quick googling reveals this C ESP IDF example which should be your starting point, and seems to do exactly what you want: https://github.com/espressif/esp-idf/tree/release/v5.2/examples/network/bridge Informally speaking, how it operates is as follows:
Apparently, this is something new in ESP IDF 5. ESP IDF 4.4 did not support layer-2 bridging, only layer3 IP packet forwarding (which is still supported in the How to do it in Rust?
Now the non-trivial part: Once you have this, I would appreciate if you publish it as I can use it as a template to expose the bridge APIs in a safe way in The bridge configuration stuff in the example starts from here. All above (ethernet and wifi conf) can be done with safe Rust. Hope that helps. |
Hi @ivmarkov , This helps so much! I plan to get started on this next week and I'll report my findings. Thank you so much for this, I don't think I would have been able to figure this out in a reasonable time myself. Many thanks! Simon |
Np.
... the custom network configuration is only necessary if you have multiple eth interfaces, as then each needs to have its own unique key and distance. Since you'll have only one, none of this is necessary. Only the step where you assign the same MAC address to both your eth and the netif bridge is necessary. |
Hey @ivmarkov, I've been getting some work done on and this and have been slowly porting the C code from the example to Rust. However, I got stuck on the last part that uses the esp_netif_br_glue_* types and structs and functions. I can't seem to find these anywhere on the rust side. Not in esp-idf-svc, nor in esp-idf-sys. Is this just missing for now or am I looking in the wrong place? |
Hey @ivmarkov, Just checking if you've already looked at this. I don't have much experience making Rust bindings for C so I'm (for now at least) hoping you can point me in the right direction :P. Simon |
@FrigoEU Thanksd for reminding me! Just make sure to add the following in your [patch.crates-io]
esp-idf-svc = { git = "https://github.com/esp-rs/esp-idf-svc" }
esp-idf-hal = { git = "https://github.com/esp-rs/esp-idf-hal" }
esp-idf-sys = { git = "https://github.com/esp-rs/esp-idf-sys" }
cmake = { git = "https://github.com/ivmarkov/cmake-rs" } |
And in your
... as per the C example. |
Thank you very much! I'll continue with this next week. |
You should look for the raw bindings in |
Hi,
This isn't an issue but rather a request for a nudge in the right direction. I've made a fairly large application in Rust running on the ESP32. So far it's been fairly smooth sailing. But the next feature I'd like to build is to me quite difficult to get started on.
The situation: my ESP32 will be plugged into Ethernet. When connection is successful (and it's configured as such) it should start a WiFi access point (with pre-configured ssid/password) and allow another device to connect to the WiFi and connect to the internet via the ESP32's Ethernet connection. I feel in theory this should be possible but I've found only very limited information/examples online (especially in the Rust language).
I'd greatly appreciate it if somebody could point me in the right direction to get started on this.
Simon
The text was updated successfully, but these errors were encountered: