mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1627] How to save/load a static IP field ? #1386
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#1386
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @julian-lp on GitHub (Jun 17, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1627
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
@julian-lp commented on GitHub (Jun 19, 2023):
Well, I keep investigating a little bit and I found this:
If I include this line
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
@woodenplastic commented on GitHub (Sep 26, 2023):
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.
@tablatronix commented on GitHub (Sep 29, 2023):
I think you have to save and load static yourself