-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception 3 WiFiManager::getParamOut() when ConfigPortal started #931
Comments
Arrr... The problem in number of Custom Parameters. How I can optimise a memory to increase their number? Why old version of SDK 2.0.4 works? I print 'page' variable:
|
if you set DEBUG_MAX in .h file for debuglevel you will get debugging for heap size in logs. |
|
have you tried it with 2.04? to see a difference? |
@tablatronix |
@tablatronix look: there are a lot of difference in building... |
lots of changes there. Are you using spiffs ? there seems to have been some major changes to that. You can decode the exceptions of course, I think there are some debugging utils now, or gdb stub, but I have not yet tested them out. Do you know what |
can you upload a minimal reproducable sketch, with just the params, have you added a test loop to the example to generate 30 etc.. It does seem that the most likely problem is |
Did you turn all debugging on ? Esp debugging , you might get some better output before the exception. it is definitely a memory thing. `
|
yes. wait, I prepare it.
I think it doesn't work in platformio.. maybe I do smth wrong? Can you write an example of ini file? or any defines for debug?
yes. if i descrese parameters number it works, increase - exception in getParamOut() |
here you go
|
Thanks a lot for you help! Wow, build_flags works! hm.. last time not. main.cpp https://pastebin.com/NM5bw3bB platformio.ini
|
I rolled back to esp 2_3_0 and get the same crash |
Only 2.0.4 works. I think, I need to find commit in Arduino framework between 2.20500.0 and 2.20501.0. |
That is a very long time ago, a whole different sdk etc. I am betting fragmenting memory from string, maybe something changed that leads to more possibility of fragmentation of heap, we can try to figure it out, ideally we need to just change it to use a a proper buffer. |
I can't believe, that we are alone with this framework difference. I try to add String &page argument to getParamOut(), also add page.reserve(8000). Memory count changes but exception raised. |
@tablatronix do you know about this https://arduino-esp8266.readthedocs.io/en/latest/PROGMEM.html ? I use PROGMEM string with WifiManager, that don't have _P() functions to works with this type of strings... I check it |
all html strings are in progmem, I have no idea how you that would work with non constants |
IT WORKS! Without PROGMEM string for parameters... I think, somewhere is wrong function for Progmem strings... |
what did you do , put your own sketch strings in progmem ? |
It looks like the webserver already has this, I wonder if it has a send buffer and we can just write to it then send instread of concatenating our own string.. I have not worked much with the webserver. ESP8266WebServer::send_P |
It also has methods with params for code and content_type, I wonder if we can get rid of sending our own headers now. void WebServer::send(int code, const char* content_type, const String& content) {
...
_prepareHeader(header, code, content_type, content.length());
server->sendHeader(FPSTR(HTTP_HEAD_CL), String(page.length()));
server->send(200, FPSTR(HTTP_HEAD_CT), page); |
Ok I see no buffer, so is it as easy as using PSTR() ? |
Now I make "easy" changes - remove "PROGMEM" everywhere. But, I think, It better understand behaviour for WifiManager. Maybe using const char * in functions arguments is wrong? All my strings are custom HTML: i see this patch and think my code is wrong: This is what I need: const char * footer = String(F("\r\n")).c_str(); |
ok so how did you fix it ??? |
yes, remove PROGMEM in my code. I try it today night. Write here result |
Show nothing on the screen:
Crash:
OK:
and also:
|
It's interesting, that WiFiManager fails if
|
oups... i think it's look like this bug: esp8266/Arduino#4372 (comment) I change WiFi.mode(WIFI_STA); to WiFi.mode(WIFI_OFF); in setup(), add WiFi.mode(WIFI_AP) before ConfigPortal and it works:
So I see (only with -DDEBUG_ESP_PORT=Serial -DDEBUG_ESP_CORE): |
offtopic |
very interesting |
I think we should add remark to listing or documentation, that using PROGMEM strings with WifiManagerParameter is prohibited. |
Yeah I am not entirely sure why, not sure I fully understand whats going on |
@tablatronix I try to describe: Working with PROGMEM strings with common functions "strlen", "memcmp", "scanf" is dangerous (read "prohibited"). What's why this "operator=" can raise exception: Look at String contructors:
|
ok, so we would have to add some checking to avoid exceptions, a note for now will work. Of course it might be possible to rework some stuff to allow pstrings |
@tablatronix I can't understand how to check it =(. Only add functions with |
Basic Infos
I try the last ESP8266 SDK with development branch and it's falls when ConfigPortal started.
How I can debug this problem? It's important to use latest SDK =(. Thanks!
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
don't know
Description
I try development branch with 2.5.2 SDK and it fails. I'm confuzed, cause it works with 2.0.4 version...
2.1.0, 2.2.0 also raise exceptions.
I use ~30 params in config.
Versions
Exception decode
The text was updated successfully, but these errors were encountered: