mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #961] Lost custom parameters sometimes.. #816
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#816
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 @dontsovcmc on GitHub (Nov 6, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/961
Basic Infos
I add 27 custom parameters and increase style tag... Some /wifi responses are good, sometimes return page without all parameters or return only a piece of them (!)
Hardware
WiFimanager Branch/Release:
Esp8266/Esp32:
Hardware: ESP-12e, esp01, esp25
ESP Core Version: 2.4.0, staging
PLATFORM: Espressif 8266 2.2.3 #cd6f5cc > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: toolchain-xtensa 2.40802.190218 (4.8.2), framework-arduinoespressif8266 2.20502.0 (2.5.2), tool-esptool 1.413.0 (4.13), tool-esptoolpy 1.20600.0 (2.6.0)
Description
DEBUG_MAX: Mem looks good.
I test connections with 2-3 clients - no differences.
Open ConfigPortal with mobile phone - OK
Open ConfigPortal with PC CaptivePortal - OK
Open PC Chrome - Failed!
F5 - Failed!
F5 - OK
Debug Messages
//GOOD try:
@tablatronix commented on GitHub (Nov 6, 2019):
This sounds like another open issue that was running out of memory
@dontsovcmc commented on GitHub (Nov 6, 2019):
Also strange:
After ~5 connections/disconnections ESP lost all scanned networks.
There were 5. It shows 1 with empty name...
F5 - return 5 networks..
@dontsovcmc commented on GitHub (Nov 6, 2019):
I turn off asyncronous scan Wi-Fi.
Additional tryes:
GOOD
@tablatronix commented on GitHub (Nov 7, 2019):
This would be expected if stack is getting corrupted, I think the network scan struct gets created there
@dontsovcmc commented on GitHub (Nov 12, 2019):
@tablatronix here is a good explain of fragmentation: https://cpp4arduino.com/2018/11/06/what-is-heap-fragmentation.html
as you see "replace, concat... " functions are best fragmentation friends...
One of the possible way to decrease it: add __FlashStringHelper arguments for some functions.
Firstly, I should understand how can i measure fragmentation.
https://esp8266life.wordpress.com/2019/01/13/memory-memory-always-memory/
More warlike article: https://syonyk.blogspot.com/2017/02/common-arduino-library-sram-use.html
Look at our rock'n'roll config page: https://waterius.ru/esp/config.html
"understand and forgive" us with this issuu =)
@dontsovcmc commented on GitHub (Nov 12, 2019):
I fork and run heap fragmentation test for ESP8266 https://github.com/dontsovcmc/cpp4arduino/tree/esp8266_platformio_heap
I think, we have WiFiManager heap test.
Look and their Heap test! They allocate strings in the loop.
Available | LargestBlock | Fragmentation
12536 availiable memory, but only 1880 bytes you can allocate cause fragmention is 85% (1880 * 100% / 12536)
The first idea - add memory functions to WiFiManager and monitor fragmentation
@tablatronix commented on GitHub (Nov 12, 2019):
#518
@tablatronix commented on GitHub (Nov 12, 2019):
DEBUG_MAX already does memory logging fyi
i can add some fragmentation specific calls or hooks. Just a quick look and it should be pretty obvious where the main problem is
@dontsovcmc commented on GitHub (Nov 13, 2019):
I was gonna do this commit today, and you beat me to it. Thanks! I will report here.
@dontsovcmc commented on GitHub (Nov 13, 2019):
hm..
think about refactoring code.
adding String page; page.reserve(12000); is not a good way
@tablatronix commented on GitHub (Nov 13, 2019):
I am pretty sure all of the memory issues are the page string variable.
So simply fixing that will help.
Ideas welcome, I never had frag more than 13%, how much custom params or html are you using ?
@dontsovcmc commented on GitHub (Nov 13, 2019):
@tablatronix about 28 custom parameters with long labels and custom JS =) You can see result page (without minimizing): https://waterius.ru/esp/config.html
@dontsovcmc commented on GitHub (Nov 14, 2019):
@tablatronix do you have custom callback example?
I want to make pull request, but I added my pages into yours..
I need:
Is it possible outside WiFiManager files?
Refactor #1:
String getParamOut();
String getScanItemOut();
String getStaticOut();
It's better to add page.reserve(PAGE_MAX_BYTES);
@tablatronix commented on GitHub (Nov 14, 2019):
see DEV/* example
@dontsovcmc commented on GitHub (Nov 23, 2019):
I think problem solved! Memory issuu. Thanks for debug.