mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 17:15:53 +03:00
[GH-ISSUE #762] setSaveParamsCallback() Hanging and not being able to save parameters #636
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#636
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 @martinberlin on GitHub (Nov 1, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/762
Hardware
WiFimanager Branch/Release:
Esp8266
ESP Core Version: 2.4.0, staging
Description
I have already a working version without using this new "param" in the menu on my FS2 Project and it's working fine. Also I though it could be a nice idea to let the users to edit the Setup without touching the connection but I'm struggling with it.
The logic could be the same as setSaveConfigCallback()
So this saveConfigCallback sets a flag like in your example shouldSaveConfig to true, and then IF (shouldSaveConfig) is true, then we save this in SPIFFS or whatever medium you use to save your configuration.
Well, it turns out that for me in the current state acts the same as saveConfigCallback except that it hangs after returning. So I can never get to save the settings.
Settings in IDE
Module: Wemos D1
Additional libraries:
This is the feature branch where I tried to integrate this:
https://github.com/martinberlin/FS2/compare/feature/param?expand=1
Debug Messages
@tablatronix commented on GitHub (Nov 2, 2018):
You are not saving though, you are doing something odd here.
if (memory.saveParamCallback) {
wm.startConfigPortal(configModeAP);
} else {
wm.autoConnect(configModeAP);
}
@martinberlin commented on GitHub (Nov 2, 2018):
I knew I was doing something stupid ;) Ok but then how it should be?
I read should be only one of both. So I can only call autoConnect? But that one will connect automatically if we are on the same WiFi.
Can you please make me a 3 lines example.
But even if I’m doing this wrong it’s not supposed to hang or I’m thinking it wrong?
@tablatronix commented on GitHub (Nov 2, 2018):
not sure what you are wanting that to do, how are you saving your params now? just use that instead
if (memory.saveParamCallback) {
// get params and save them to whereever
}
no idea why you are trying to restart the configportal
what does saving parameters have to do with autoconnect or startconfigportal ?
@tablatronix commented on GitHub (Nov 2, 2018):
hmm I guess I am confused as to what this is doing
you are setting
shouldSaveConfig = true;so that is goodwhat is purpose of
memory.saveParamCallback = false;@tablatronix commented on GitHub (Nov 2, 2018):
are you wanting to start the configportal if it was never setup before?
is that what that flag marks?
I would set that flag after you successfully save params.
@tablatronix commented on GitHub (Nov 2, 2018):
oh ok I think I might know what the problem is, save params does not stop the configportal.
I thought you were using non blocking mode, you are using blocking loop.
This makes sense now.
hmm, I may have to make some modifications to this to allow it to work with blocking mode, since there is no way to stop the configportal after the page gets served to user. Also you might not want to close the configportal.
let me think about this for a little bit, if you want to change your code to non blocking it will be a bit of work to move some stuff around.
@tablatronix commented on GitHub (Nov 2, 2018):
ok for now you will have to use exit button after save, it should work.
@tablatronix commented on GitHub (Nov 2, 2018):
I updated code, you can now call
wm.stopConfigPortal();if you want to stop the configportal when blockingso you can do
If you want to close the cp after saving params, until you can rewrite for non blocking
@tablatronix commented on GitHub (Nov 2, 2018):
do you know how to specify pins for OV2640 ?
I have one of these, I might be able to run your code on it.
@martinberlin commented on GitHub (Nov 2, 2018):
Ah ok now I understand. Yes that was a flag to say: Hey in next restart please start with WM in Config mode.
I will try it out thank you very much!
Yeah basically what I was trying to do is to restart the App and call WiFi manager just to enter the Setup. By the way there would be a way in the future to offer some kind of interface, so you can do this param edition from your application instead of starting again (And having to connect to the Accesspoint and so on ?)
@martinberlin commented on GitHub (Nov 2, 2018):
That might be a nightmare. Because the guys of Arducam just specified the Chip Select (CS) in the demo sketches. All the rest, unless I see it very wrong, is hardcoded in the ArduCam library itself. You can take a look here in their demos for ESP32 (That's one of those ?)
https://github.com/ArduCAM/ArduCAM_ESP32S_UNO/tree/master/libraries/ArduCAM/examples/ESP32
But I would anyways try it out! What kind of camera is that, can you send me the Specs page ?
For sure it comes with some example. I would not mind to branch my stuff and add an adapter for this one, then you can have a very small Spycam 👍
@tablatronix commented on GitHub (Nov 2, 2018):
I see thanks.
There is not yet a way to pass the webserver into WM, but the wm webserver is a public shared pointer, so you can use it in your code, and add events to it etc.
see DEV/ondemandconfigportal example
@martinberlin commented on GitHub (Nov 2, 2018):
Ah great I will try it out!
After looking some pointers, I guess MOSI / MISO and Clock should be the same so maybe it's not so hard to get this working with a different camera.
But of course it's time debugging and so on. I hope in 2 weeks will arrive my demo and you can connect this one I hope without to much effort first to some ESP8266 based board...And then if you want to ESP32 but I still didn't tested that. Today they arrived two Makerbot ESP32 boards so I will have some fun on the weekend :)
@martinberlin commented on GitHub (Nov 2, 2018):
I tried to simplify stuff:
github.com/martinberlin/FS2@ba0255be1aBut still calling the route: /paramsave brings a crash
[CALLBACK] saveParamCallback fired -> should save config is TRUE
Fatal exception 28(LoadProhibitedCause):
epc1=0x402195f9, epc2=0x00000000, epc3=0x00000000, excvaddr=0x000000a8, depc=0x00000000
Exception (28):
epc1=0x402195f9 epc2=0x00000000 epc3=0x00000000 excvaddr=0x000000a8 depc=0x00000000
ctx: cont
sp: 3ffffaa0 end: 3fffffc0 offset: 01a0
UPDATE: Typical I forgot making a git pull on your lib before testing this. Newbie mistake !!! ;)
Great ! Now it works perfectly.
I will test it again to make sure and close it down with an example
@martinberlin commented on GitHub (Nov 2, 2018):
Fantastic! Checked it two times, now it saves config correctly without hanging. Thanks a lot!
If anyone wants to see the implementation please check this branch on my camera project:
https://github.com/martinberlin/FS2/blob/feature/param/FasarekFS2/FasarekFS2.ino