[GH-ISSUE #991] Multiple Param Pages #844

Open
opened 2026-02-28 01:27:18 +03:00 by kerem · 8 comments
Owner

Originally created by @antoniuschan99 on GitHub (Jan 9, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/991

Hi,

Is it possible to add multiple Param Pages?

Say I want to have two separate param pages:

wifiManager.addParameter(&updateFrequency);
wifiManager.setSaveParamsCallback(saveUpdateFrequencyParamCallback);

wifiManager.addParameter(&updateHumidityOffset);
wifiManager.setSaveParamsCallback(saveUpdateHumidityOffsetParamCallback);

If I call param in the menu, it shows the first parameter (updateFrequency) in both pages when testing code:

std::vector<const char *> menu = {"wifi","info", "sep", "param", "param", "sep","restart","exit"};

Thank you

Originally created by @antoniuschan99 on GitHub (Jan 9, 2020). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/991 Hi, Is it possible to add multiple Param Pages? Say I want to have two separate param pages: wifiManager.addParameter(&updateFrequency); wifiManager.setSaveParamsCallback(saveUpdateFrequencyParamCallback); wifiManager.addParameter(&updateHumidityOffset); wifiManager.setSaveParamsCallback(saveUpdateHumidityOffsetParamCallback); If I call param in the menu, it shows the first parameter (updateFrequency) in both pages when testing code: std::vector<const char *> menu = {"wifi","info", "sep", "param", "param", "sep","restart","exit"}; Thank you
Author
Owner

@antoniuschan99 commented on GitHub (Jan 9, 2020):

so far I have something like this to read multiple param values. It's true that there is unlimited EEPROM Read Cycles yes?

void saveUpdateParamsCallback() {
Serial.println("Saving Update Frequency");
Serial.println(getParam("updateFrequencyId").toInt());

EEPROM.begin(eepromSize);
EEPROM.write(address, getParam("updateFrequencyId").toInt());
EEPROM.commit();

Serial.println("Saving Update Humidity Offset");
Serial.println(getParam("updateHumidityOffsetId").toInt());

EEPROM.begin(eepromSize);
EEPROM.write(address, getParam("updateHumidityOffsetId").toInt());
EEPROM.commit();
}

<!-- gh-comment-id:572390169 --> @antoniuschan99 commented on GitHub (Jan 9, 2020): so far I have something like this to read multiple param values. It's true that there is unlimited EEPROM Read Cycles yes? void saveUpdateParamsCallback() { Serial.println("Saving Update Frequency"); Serial.println(getParam("updateFrequencyId").toInt()); EEPROM.begin(eepromSize); EEPROM.write(address, getParam("updateFrequencyId").toInt()); EEPROM.commit(); Serial.println("Saving Update Humidity Offset"); Serial.println(getParam("updateHumidityOffsetId").toInt()); EEPROM.begin(eepromSize); EEPROM.write(address, getParam("updateHumidityOffsetId").toInt()); EEPROM.commit(); }
Author
Owner

@tablatronix commented on GitHub (Jan 9, 2020):

I noted this somewhere else, I don’t think I made an issue for it. It is a good idea plus we can let you leave wifi stuff on wifi page, Right now custom params can only be on wifi or params page.

<!-- gh-comment-id:572556805 --> @tablatronix commented on GitHub (Jan 9, 2020): I noted this somewhere else, I don’t think I made an issue for it. It is a good idea plus we can let you leave wifi stuff on wifi page, Right now custom params can only be on wifi or params page.
Author
Owner

@antoniuschan99 commented on GitHub (Jan 9, 2020):

ok great thanks!

<!-- gh-comment-id:572581683 --> @antoniuschan99 commented on GitHub (Jan 9, 2020): ok great thanks!
Author
Owner

@antoniuschan99 commented on GitHub (Jan 11, 2020):

After saving a parameter, is it possible to retrieve the value that was just saved?

Say the user saved the value, but goes back to the params page. I want the %s value to reflect the value that was just saved. However, it doesn't do that (it always gets the value that was loaded the very first time the device booted)

const char* setFrequencyValue =
"

"
""
""
"15 Minutes"

";
char write_letter[1024];
sprintf(write_letter, setFrequencyValue, String(frequencyValue));

new (&setFrequency) WiFiManagerParameter(write_letter);

wifiManager.addParameter(&setFrequency);

<!-- gh-comment-id:573296166 --> @antoniuschan99 commented on GitHub (Jan 11, 2020): After saving a parameter, is it possible to retrieve the value that was just saved? Say the user saved the value, but goes back to the params page. I want the %s value to reflect the value that was just saved. However, it doesn't do that (it always gets the value that was loaded the very first time the device booted) const char* setFrequencyValue = "<div id='setFrequencyContainer'>" "<label for='frequencyId'><b>Update Frequency</b></label>" "<input type='radio' name='frequencyId' value='%s' checked>" "<input type='radio' name='frequencyId' value='15'>15 Minutes" </div>"; char write_letter[1024]; sprintf(write_letter, setFrequencyValue, String(frequencyValue)); new (&setFrequency) WiFiManagerParameter(write_letter); wifiManager.addParameter(&setFrequency);
Author
Owner

@tablatronix commented on GitHub (Jan 11, 2020):

hmm not sure if you can set the param again worth a try just use the new content on the same parameter do not new

<!-- gh-comment-id:573334085 --> @tablatronix commented on GitHub (Jan 11, 2020): hmm not sure if you can set the param again worth a try just use the new content on the same parameter do not new
Author
Owner

@antoniuschan99 commented on GitHub (Jan 12, 2020):

How would go about doing that? For now I have user save everything at once then will just disconnect.

<!-- gh-comment-id:573436054 --> @antoniuschan99 commented on GitHub (Jan 12, 2020): How would go about doing that? For now I have user save everything at once then will just disconnect.
Author
Owner

@tablatronix commented on GitHub (Jan 12, 2020):

Hmm might need a callout for that, let me think about it. Not sure we have any hook. You would have to be in non blocking mode

<!-- gh-comment-id:573444693 --> @tablatronix commented on GitHub (Jan 12, 2020): Hmm might need a callout for that, let me think about it. Not sure we have any hook. You would have to be in non blocking mode
Author
Owner

@antoniuschan99 commented on GitHub (Jan 13, 2020):

ok thanks!

<!-- gh-comment-id:573498020 --> @antoniuschan99 commented on GitHub (Jan 13, 2020): ok thanks!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#844
No description provided.