mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1527] Persistent custom values #1303
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#1303
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 @pablopeu on GitHub (Nov 28, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1527
Is there a way to make the defined custom values to be persistant?
` WiFiManagerParameter custom_User_ID("User_ID", "Used ID", "", 30);
WiFiManagerParameter custom_Bot_Token("Bot_Token", "BOT token", "", 46);
wm.addParameter(&custom_User_ID);
wm.addParameter(&custom_Bot_Token);
`
This is my example of the values I want to keep across reboots/resets, does the library allows for this, or I need to write/retrieve them by myself from say EEPROM?
Thanks
@tablatronix commented on GitHub (Nov 28, 2022):
you need to save them to fs yourself
@pablopeu commented on GitHub (Nov 29, 2022):
solved it by using the Effortless SPIFFS library (https://github.com/thebigpotatoe/Effortless-SPIFFS)
`
String usid = custom_User_ID.getValue();
String toke = custom_Bot_Token.getValue();
if (usid !=""){
fileSystem.saveToFile("/usid.txt", usid);
}
if (usid ==""){
fileSystem.openFromFile("/usid.txt", usid);
userid = usid.toInt(); //userid is global
}
if (toke !=""){
fileSystem.saveToFile("/toke.txt", toke);
}
if (toke ==""){
fileSystem.openFromFile("/toke.txt", toke);
toke.toCharArray(buf, 80); // char token[80] is global
}`
@tablatronix commented on GitHub (Nov 29, 2022):
Consider using littlefs, spiffs has been deprecated