[GH-ISSUE #401] Use custom settings fields ...my way... with JSON and SPIFFS... #336

Closed
opened 2026-02-28 01:24:49 +03:00 by kerem · 2 comments
Owner

Originally created by @nardev on GitHub (Aug 29, 2017).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/401

It's quite a pain to extend WiFiManager now with custom fields..

I was playing a bit with that, so i added some code in WiFiManager, IMHO it's quite easier approach and much much much more versatile and adaptable to custom needs.

I didn't try to save space so i event added jquery and some more files. All compressed and separately server. (can be avoided)

You can see all that in my project (under development, but this functionality works ok for demo)
https://github.com/nardev/hepek-iot

But regarding custom settings that i'm talking about, it's all in "lib/WiFiManagerCustom" link: https://github.com/nardev/hepek-iot/tree/master/lib/WiFiManagerCustom

Also, note, i added some options to: copy/compress files from "lib/WiFiManagerCustom/extras/..." to "data/". All that is still handled by same "parse.js" script, just little extended...

Essentially what i do is:

  1. get .json file and "populate" already prepared form. There is even loop for forms which have same blocks like mqtt topics etc.

  2. When saving, i parse form into a json and save it to a settings.json by just replacing the node which was submitted, all other "root" nodes are preserved.

So, it's "one form" == "one top level json node".

There should be one function checking consistency of posted data so that you can't POST empty node but some other checks are there.

I hope somebody will like this. (the project is not done. just this functionality)

Originally created by @nardev on GitHub (Aug 29, 2017). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/401 It's quite a pain to extend WiFiManager now with custom fields.. I was playing a bit with that, so i added some code in WiFiManager, IMHO it's quite easier approach and much much much more versatile and adaptable to custom needs. I didn't try to save space so i event added jquery and some more files. All compressed and separately server. (can be avoided) You can see all that in my project (under development, but this functionality works ok for demo) https://github.com/nardev/hepek-iot But regarding custom settings that i'm talking about, it's all in "lib/WiFiManagerCustom" link: https://github.com/nardev/hepek-iot/tree/master/lib/WiFiManagerCustom Also, note, i added some options to: copy/compress files from "lib/WiFiManagerCustom/extras/..." to "data/". All that is still handled by same "parse.js" script, just little extended... Essentially what i do is: 1. get .json file and "populate" already prepared form. There is even loop for forms which have same blocks like mqtt topics etc. 2. When saving, i parse form into a json and save it to a settings.json by just replacing the node which was submitted, all other "root" nodes are preserved. So, it's "one form" == "one top level json node". There should be one function checking consistency of posted data so that you can't POST empty node but some other checks are there. I hope somebody will like this. (the project is not done. just this functionality)
kerem closed this issue 2026-02-28 01:24:50 +03:00
Author
Owner

@tablatronix commented on GitHub (Aug 29, 2017):

I have been looking into ultra micro js frameworks
Also I think a templating system would be nice.

Not sure about the best solution, obviously bloating the library or requiring internet access for cdns is not ideal.

Nice project,

<!-- gh-comment-id:325652524 --> @tablatronix commented on GitHub (Aug 29, 2017): I have been looking into ultra micro js frameworks Also I think a templating system would be nice. Not sure about the best solution, obviously bloating the library or requiring internet access for cdns is not ideal. Nice project,
Author
Owner

@nardev commented on GitHub (Aug 30, 2017):

Well, i used jquery just to prove concept... it takes about 30K on SPIFFS.. which is ok in my case... it's gzipped of course...

<!-- gh-comment-id:325908442 --> @nardev commented on GitHub (Aug 30, 2017): Well, i used jquery just to prove concept... it takes about 30K on SPIFFS.. which is ok in my case... it's gzipped of course...
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#336
No description provided.