Skip to content
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

Add example demonstrating how to configure a static IPv4 address in lieu of DHCP #323

Merged
merged 3 commits into from
Nov 29, 2023

Conversation

ssnover
Copy link
Contributor

@ssnover ssnover commented Nov 26, 2023

I had to do quite a bit of spelunking in the docs to figure this out and I think this is a fairly common use case (esp-wifi has an example like this).

One question I had was why the API for swapping the network interface configs needs to swap both the STA and AP configs at once when many are not necessarily using both? It'd help clean up this example if that were possible and the code of anyone who isn't running an ESP device as both an AP and STA device.

Testing

I tested this on an ESP32C3 on the ESP32-C3-MINI-1 dev board.

examples/wifi_static_ip.rs Outdated Show resolved Hide resolved
examples/wifi_static_ip.rs Outdated Show resolved Hide resolved
@ivmarkov
Copy link
Collaborator

One question I had was why the API for swapping the network interface configs needs to swap both the STA and AP configs at once when many are not necessarily using both? It'd help clean up this example if that were possible and the code of anyone who isn't running an ESP device as both an AP and STA device.

Pure laziness on my side. I don't think there's anything wrong with exposing - e.g. - swap_netif_sta and swap_netif_ap - in addition to the existing swap_netif method.

@ssnover ssnover requested a review from ivmarkov November 29, 2023 05:10
@ivmarkov ivmarkov merged commit 853a7f9 into esp-rs:master Nov 29, 2023
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants