Closed yiancar closed 3 years ago
Check if you set in the code
#define USE_DHCP_IP false
It's a little bit complex here in the example. Just test to see which setting is OK, then set-and-forget.
// Use USE_DHCP_IP == true for dynamic DHCP IP, false to use static IP which you have to change accordingly to your network
#if (defined(USE_STATIC_IP_CONFIG_IN_CP) && !USE_STATIC_IP_CONFIG_IN_CP)
// Force DHCP to be true
#if defined(USE_DHCP_IP)
#undef USE_DHCP_IP
#endif
#define USE_DHCP_IP true
#else
// You can select DHCP or Static IP here
#define USE_DHCP_IP true
//#define USE_DHCP_IP false
#endif
Regards,
Hello! It looks like
#define USE_STATIC_IP_CONFIG_IN_CP true
#define USE_DHCP_IP false
Does what I want. So I can understand better:
USE_STATIC_IP_CONFIG_IN_CP
allows the StaticIP field to exist
USE_DHCP_IP
when true prioratizes DHCP?
Yes, that's it. I almost forget all the details.
Cheers!
Is your feature request related to a problem? Please describe.
Hello again! This is more of a question regarding the intention behind the StaticIP field in the Config Portal. I am using the ESP32_FSWebServer_DRD example which does 99% of what I want it to do. As a test I tried the following: set a StaticIP in the Config Portal and connect to a network that has DHCP. As this device was connected using DHCP to this network before the router is autoassigning the previous IP.
As a result when the ESP connects to the network it uses the DHCP IP it was given and NOT the StaticIP that was set in the Config Portal.
Is the intention that if one provides a StaticIP and DHCP is not available on that network, the StaticIP will be used?
In a real world scenario I know that the best practice is to use a mac lookup table on the DHCP side to always assign a constant IP.
Cheers, Yiangos