mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #846] WiFiManagerParameter and array is not compiling/working #710
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#710
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 @maikheinrich on GitHub (Mar 9, 2019).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/846
Hello All,
I will use the WiFiManagerParameter in combination with an array. This seems not to work.
working example (no array):
WiFiManagerParameter custom_relais_1_off("relais_1_off", "relais_1_off", relais_1_off, 3);
WiFiManagerParameter custom_relais_2_off("relais_2_off", "relais_2_off", relais_2_off, 3);
NOT working example (array):
for (int i = 0; i < 2; i++) {
WiFiManagerParameter custom_relais_off[i]("relais_off", "relais_off", relais_off[i], 3);
}
I become an compiler error: variable-sized object 'custom_relais_auto_off' may not be initialized
How must I init this custom_relais_auto_off array ?
Issues without basic info will be ignored or closed!
@dontsovcmc commented on GitHub (Mar 27, 2019):
This is not C++.
You should use pointers:
// after using WM you should free memory:
@Gamelauncher commented on GitHub (Oct 19, 2020):
@dontsovcmc, I am struggling with this as well and although I get close, the result is not good .any suggestion? I've tried following your example with this code:
I need to be able to dynamically allocate a number of rows based on serial numbers of detectors and map them to a zone number.
Results in:
@Gamelauncher commented on GitHub (Oct 20, 2020):
I've managed to solve this for now, wasn't paying attention to the sizes and overlooked an array indicator.
Increasing the size of the arraySize and duplicating the code to allow for zone number and zone location values as well, I hit another obstacle ..
CORRUPT HEAP: multi_heap.c:431 detected at 0x3ffedaf8
abort() was called at PC 0x4008c9e4 on core 1
This happens either directly on loading wifimanager or when requesting the param page. Ideally I would like an array size of 64, anyone have an idea on howto optimise the code a bit more for this? Heap seems just happy as after loading successfully with 32, it reports still over 90000 available. When checking the exception decoder it refers to "to many (new) operations" ?
@tablatronix commented on GitHub (Oct 20, 2020):
There is some optimization to be done on the heap that might get you more memory, all the web output uses a single $page string, and no pre allocation is done. There is an open issue discussing this #518
@tablatronix commented on GitHub (Oct 20, 2020):
Ill try to find the relevant issue and link it