Juerd / ESP-WiFiSettings

WiFi Manager for the ESP32 Arduino environment
Other
168 stars 35 forks source link

Allow for static IP options which reduce WiFi connection time. #8

Closed KeyOpt closed 4 years ago

KeyOpt commented 4 years ago

For ESP32 devices, using a Static IP address can reduce the connection time (from 900 - 1000 ms to 500-600 ms).

This change will give the user of this library the option to use Static IP if they are comfortable with that option (or to leave it as DHCP as the examples indicate).

Juerd commented 4 years ago

Thanks for submitting the feature and pull request. I will not merge the request, because it doesn't fit with the intended use case of switching networks easily. Hard-coding a static IP address interferes with that primary concept of this library.

The IP address is heavily dependent on the network you're connecting to. While it's possible that multiple wifi networks correspond to the same subnet, it's not the most likely setup. Since the wifi network is configured through the settings portal, I think any support for static addresses should be configurable through the same mechanism.

I haven't implemented configurable static IP addresses thus far, because there are a few things I'm not sure about:

But hardcoded configuration is not the way to go, as it simply doesn't align with the rest of the library.

Despite the rejection, thank you for taking the time to suggest and implement this feature!