mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1226] ESP32-S2 Support #1045
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#1045
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 @lienbacher on GitHub (Mar 15, 2021).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1226
Hello!
I'm trying to use WifiManager on a custom ESP32-S2 device and I am running into a compilation problem.
I am using platformio with following platformio.ini:
Arduino support for ESP32-S2 is not stable yet, the issue may have to do with that (that's why i'm using a repo from platformio with arduino)
apart from a few warnings that I can fix (warnings regarding system vs arduino events, for some reason there's some ambiguity) there is one compilation error I am a bit stuck on and I don't quite understand what's happened here.
here's the compiler warning:
The overloads for Wifi.onEvent are declared as follows in WiFiGeneric.h:
any pointers on whats going on and how I could fix this?
@tablatronix commented on GitHub (Mar 15, 2021):
Sure Ill take a look
@lienbacher commented on GitHub (Mar 16, 2021):
looking at the function that throws the error, what does the std::bind part actually do? I've never used it and have trouble following along
@lienbacher commented on GitHub (Mar 16, 2021):
Regardless, I got it to compile by replacing all system_event references with arduino_event references. They seem to correlate, however I can't verify as I am still having some struggles with getting my code onto the flash memory of my S2. I'll report back once that's finished.
@tablatronix commented on GitHub (Mar 16, 2021):
https://github.com/tzapu/WiFiManager/tree/esp32s2
@lienbacher commented on GitHub (Mar 18, 2021):
I've tried including that branch in a fresh project and unfortunately it fails to compile looking for Update.h:
it is not in my modified version of #develop, so I tried uncommenting
#include <Update.h>and it then fails to findWebServer.h, which should be part of the arduino framework and is found fine in my original project.Any ideas what that could be?
@tablatronix commented on GitHub (Mar 18, 2021):
hmm not sure what is your exact build enviroment? pio ini ?
What does build out put say ?
It could be a bad pio ldf mode
@lienbacher commented on GitHub (Mar 18, 2021):
yeah it's weird, I've tripple checked everything i am aware of, all necessary paths are in
.vscode/c_cpp_properties.json...pio.ini:
output:
@tablatronix commented on GitHub (Mar 18, 2021):
This seems wrong
| |-- 1.0
|-- 1.0
@tablatronix commented on GitHub (Mar 18, 2021):
It just stops there which is odd.
You might have to add verbose so it shows you the paths for the libs
I am not building using wm as deps, so mine is a little different, maybe ldf mode deep ?
@lienbacher commented on GitHub (Mar 18, 2021):
I just tried moving WifiManager into the libs folder and remove it from pio.ini and it compiled just fine, I don't know why 🤷♂️
@tablatronix commented on GitHub (Mar 18, 2021):
It is definitely your linker mode, I have seen other reports of this and linker not finding libs in the platform for some reason
try adding includes to your code and see if it changes
@tablatronix commented on GitHub (Mar 18, 2021):
try lib_ldf_mode=deep+
https://docs.platformio.org/en/latest/librarymanager/ldf.html
@tablatronix commented on GitHub (Mar 18, 2021):
are you including wifimanager.h properly?
@lienbacher commented on GitHub (Mar 18, 2021):
Oh boy now i am embarrassed. I did not include any code yet, just added the library. After including it the error went away 🤦
sorry for the clutter.
There is one last warning left:
replacing
SYSTEM_EVENT_SCAN_DONEwithARDUINO_EVENT_WIFI_SCAN_DONEmutes the warning.@tablatronix commented on GitHub (Mar 18, 2021):
OOPS
@tablatronix commented on GitHub (Mar 18, 2021):
I will merge this once I figure out how they suggest we handle these changes in 3.x and make them backward compatible..
@lienbacher commented on GitHub (Mar 18, 2021):
yeah i figured so, but that repo here is a great start!
I am still running into problems, just tried the basic example and this is the output:
I have tried scanning networks which works fine, also manually connecting to wifi without wifimanager works just fine. If I disconnect and then run wifimanager it will reconnect to the previous AP just fine, so I guess the radio is working.
@tablatronix commented on GitHub (Mar 18, 2021):
maybe there is a special way to start ap on s2, interesting. It says enable AP first but why is set mode failing ?
@lienbacher commented on GitHub (Mar 18, 2021):
calling
WiFi.mode(WIFI_AP);before starting wifi manager seems to fix this issue and for some extra fun, there's more issues popping up. Here's the output of me connecting to the AP and saving my wifi credentials.I am having trouble reliably connecting to the ap I set, and there is
after I pressed reset the first time it started up, had the credentials saved and connected fine to the wifi, however it is not reliably doing so after every restart. Plus those
request handler not foundmessages are not supposed to be in there 🤔@tablatronix commented on GitHub (Mar 18, 2021):
Yeah those started showing up a while ago, not sure what causes them, it did not seem to affect anything, I need to add debugging to the cpp and see what the request is and where its coming from, could be a bad html asset or image etc
*wm:[2] Connection result: WL_DISCONNECTED
looks like the double connect issue, try adding a retry of 2
Or its not switching wifi modes properly...
@lienbacher commented on GitHub (Mar 18, 2021):
gotcha. makes sense. what's the preferred way of adding a retry? just restart the esp?
@lienbacher commented on GitHub (Mar 18, 2021):
ok I found
setConnectRetries(), felt like i could go for 4 right away and coincidence had it, it took all 4 attempts to finally connect. Not entirely sure why 🤔I'll assemble another prototype and try another wifi to rule out a hardware fault.
thanks a lot for your support so far!
@tablatronix commented on GitHub (Mar 18, 2021):
No I added a setretry function, ahhh you found it
is that a bug ?
*wm:[2] Connection result: WL_CONNECTED
*wm:[1] Connect Wifi, ATTEMPT # 3 of 4
It keeps going..
@tablatronix commented on GitHub (Mar 18, 2021):
Yup bug thanks!
@tablatronix commented on GitHub (Mar 18, 2021):
I fixed that, I think... untested, I also merged master in there were some updates
@lienbacher commented on GitHub (Mar 20, 2021):
Just a quick report, everything in the current ESP32-S2 repo seems to work just fine with two retries.
@marcosmatilla commented on GitHub (Apr 15, 2021):
Hi! I'm having the same problem as lienbacher when I build program. Any solution?
`In file included from .pio\libdeps\esp32doit-devkit-v1\WiFiManager\WiFiManager.cpp:13:0:
.pio\libdeps\esp32doit-devkit-v1\WiFiManager\WiFiManager.h:67:24: fatal error: Update.h: No such file or directory
compilation terminated.
*** [.pio\build\esp32doit-devkit-v1\lib4f5\WiFiManager\WiFiManager.cpp.o] Error 1`
@tablatronix commented on GitHub (Apr 17, 2021):
Sorry I only use platformio, I have not tried this on arduino.
What does your actual code look like?
have you tried including assets?
What does 'not compile' mean ?same errors?
@tablatronix commented on GitHub (Jan 20, 2022):
I am pretty sure this can be closed now