mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 00:55:52 +03:00
[GH-ISSUE #1033] Crash in wifi_softap_start? #881
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#881
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 @cmarrin on GitHub (Apr 8, 2020).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1033
I'm running the development build of WiFiManager, mostly so I can use function pointers for the setAPCallback() method. I'm using this same version in another project that is build in the Arduino IDE. But I'm building this project in VSCode using PlatformIO, still with the Arduino SDK.
I have a dead simple case of:
This is in setup(). I'm running this on a Wemos D1 Mini.
I decorated the coredump and it showed me:
So it looks like its getting a memory corruption or something. I print out the heap just before calling this code and it's at 38KB, so I don't think I'm running out of memory.
One more detail is that I'm building with C++14, so I fear I may be getting some core libraries from the wrong place or something.
Has anyone seen any issues like this?
@tablatronix commented on GitHub (Apr 8, 2020):
Do a full erase and update your esp lib
Also try staging, I had alot of crashes in 2.6.x
@tablatronix commented on GitHub (Apr 10, 2020):
It looks like it is getting way past your callback, I mean there is not much going on in there..
Do you have serial logs? Do you have any special settings for cp ?
wifi_softap_startpvPortMalloc<-- is that your debug mem print?@tablatronix commented on GitHub (Apr 10, 2020):
Might be an environment thing, I use pio standalone and it works,
Although it wont compile with that capture for some reason.
/Users/shawn/projects/microcontrollers/dev/libraries/WiFiManager/examples/Tests/AnonymousCB.ino:9:29: error: invalid use of 'this' in non-member function wifiManager.setAPCallback([this](WiFiManager* wifiManager) {@cmarrin commented on GitHub (Apr 10, 2020):
My setup is pretty "custom" right now. I'm using the development version of WiFiManager. I'm also using a 5.2 version of the toolchain so I can compile c++14 and I'm compiling debug with gdb_init in place. With that I've added some extra log messages to WiFiManager and the Arduino WiFi libraries. Here's the log output:
I added the "mode:14" message to ESP8266WiFiGenericClass::mode() just before the call to wifi_set_opmode_current(). I also have "-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI" turned on which I think is what is showing some of these diagnostics.
The final "$T0b#e6z" is the system trying to connect with GDB after the crash. I've turned that off and that's where I got the crashdump stack trace from the original message.
I've also tried turning everything off, using the stock toolchain and just building the auto connect example in a new project and it still happens. So if definitely seems like some sort of build environment issue.
@cmarrin commented on GitHub (Apr 10, 2020):
Sorry, but my PlatformIO knowledge is not great.
Is adding:
to platformio.ini what you mean by trying staging?
When I do that with my simple test app, it first updates a bunch stuff, then builds and uploads and fails in the same way
@cmarrin commented on GitHub (Apr 10, 2020):
@tablatronix when you say " I use pio standalone and it works," do you mean you build and upload from the command line? I tried:
platformio run -t uploadand the same thing happens
@tablatronix commented on GitHub (Apr 10, 2020):
Well I mean my platformio IDE is not vscode, but its still pio..
staging is github master.
platform = https://github.com/platformio/platform-espressif8266.git#feature/stage@tablatronix commented on GitHub (Apr 10, 2020):
Are you using esp IDF arduino toolchain ? I use straight arduino..
@cmarrin commented on GitHub (Apr 10, 2020):
@tablatronix When I try the platform URL you sent, I get:
Error: VCS: Could not process command ['git', 'clone', '--recursive', '--depth', '1', '--branch', 'feature/stage', 'https://github.com/platformio/platform-espressif8266.git', '/Users/cmarrin/.platformio/platforms/_tmp_installing-0iQvME-package']@cmarrin commented on GitHub (Apr 10, 2020):
I don't see any feature branch in that repo. Just master, develop and a release branch
@cmarrin commented on GitHub (Apr 10, 2020):
Should have given the simpler part of the error message:
@tablatronix commented on GitHub (Apr 10, 2020):
Thats in my platormio.ini env
Not sure how vscode env works, or how you pull in github repos.
@tablatronix commented on GitHub (Apr 10, 2020):
What happens if you use a callback function and not a lambda ?
@cmarrin commented on GitHub (Apr 10, 2020):
My example right now doesn't set the callback at all. The AutoConnect sample doesn't do it so I assumed it was an ok thing to do.
I was think it could be crashing in malloc because the ssid length was not set so it way trying to allocate an enormous buffer. But I've tried not giving it an SSID and just letting it pick one on its own and the same thing happens.
One thing for sure. I was thinking the code I had around all this was somehow corrupting memory. But since it happens in the most basic example, that's not the case.
One other tidbit. I have another project I'm building in the Arduino IDE. It is using the same development version of WiFiManager and it's working fine. This for sure has to do specifically with starting the AP mode. When I was first testing this project after adding WiFiManager support everything was working fine. That was because I replaced some older code that hardcoded the SSID, so WiFiManager was just picking up those setting and turning on STA mode. When I did resetSettings to test the config portal I started having this problem
@tablatronix commented on GitHub (Apr 10, 2020):
Always erase flash for problems with crashes, it gets corrupt when changing versions after updates etc.
So the callback above is not related? You removed it?