Open julian-lp opened 1 year ago
Well, I keep investigating a little bit and I found this:
If I include this line
wm.setSTAStaticIPConfig(IPAddress(CONF_IP_LOCAL), IPAddress(CONF_IP_DEFAULT_GATEWAY), IPAddress(CONF_IP_SUBNET));
then those fields (static IP, gateway and subnet) appears in the config portal. Otherwise, if the line isn't included, those fields arent visible in the config portal.
Now... how can I get the values of those fields ???(in order to save them to flash and retrieve every time the esp boots), given the fact that they are not "additional parameters" such as
WiFiManagerParameter parameter("parameterId", "Label", "default value", 40);
In Setup of your sketch:
//wm.setSTAStaticIPConfig(IPAddress(10,0,1,99), IPAddress(10,0,1,1), IPAddress(255,255,255,0)); wm.setShowStaticFields(false); wm.setShowDnsFields(false);
Set the fields to true and they show up. Saving is handled by WM in eeprom.
I think you have to save and load static yourself
I've been trying to save the static ip that I want to be assigned to the esp32 (the device will be used somewhere else and I'll not have access to its serial port to know its IP if it's done dynamically)
The configuration portal has one field whose name is Static IP, but I'm unclear how can I get that field and use in the line
I'm wondering if that line is executed once the config portal has ran and the wi-fi autentication occurs, or the ip is set even if there's no valid credentials, ... I mean, I'd like it to be: 1-run the portal 2-set net ID, password and Static IP 3-save that static IP in eeprom (flash) << ID and password is managed by wi fi manager but dont know about the IP ???? 4-before the wi fi manager tries to connect to wi-fi, load that static IP I've set in config portal
cause it is clear that it's me who is setting 192,168,1,177 IP rather the one I entered by the config portal
Sorry for my english, hope I explained the issue almost well