mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-27 09:05:56 +03:00
[GH-ISSUE #1478] ESP32-S2 crashes instantly on autoConnect() ? #1263
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#1263
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 @nullstalgia on GitHub (Aug 20, 2022).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1478
Basic Infos
Hardware
WiFimanager Branch/Release: Master
Esp8266/Esp32: ESP32-S2
Hardware: ESP32-S2 Mini (Wemos/Lolin board)
Core Version: 5.0.0
Description
Chip instantly crashes upon using autoConnect().
Sketch
Platformio.ini:
USB Serial Output:
Output from above sketch:
Since I'm using the CDC, I don't get a stack trace, and I'm actually not sure if the proper UART GPIOs are broken out on this board.
Edit:
Moving some stuff around I was able to get a little more output, but still crashing instantly.
@tablatronix commented on GitHub (Aug 20, 2022):
Enable esp debug, what is cdc? Does it work when you remove it?
@nullstalgia commented on GitHub (Aug 20, 2022):
USB CDC == USB communications device class, basically the technical terms for the USB <-> UART interface.
If I remove it and all other Serial mentions, I don't get any Serial output over USB, and it still crashes.
Adding
-DCORE_DEBUG_LEVEL=5to the build flags gives no extra output over the USB Serial.I may just have to pray and hope that the proper UART pins are broken out and hook up to them to see that extra ESP output + the stack trace.
@tablatronix commented on GitHub (Aug 20, 2022):
hmm, never used it ill test out your basic sketch, I assumed you tried IDF stable and master?
@nullstalgia commented on GitHub (Aug 20, 2022):
Not sure how to switch between those on PlatformIO. I'm just using the supplied ESP32 Arduino core.
I'll gladly test whatever I need to in order to get this working.
Unfortunately, it looks like I may be boned in terms of IO?
The ESP32-S2's UX0 is on GPIOs 44 and 43
But this board lacks these pins. Oh boy.
@nullstalgia commented on GitHub (Aug 20, 2022):
Huh... I had success with the tiny sketch once when using
WiFi.mode(WIFI_STA);at the very start. But this success did not carry over to any future attempts.@tablatronix commented on GitHub (Aug 20, 2022):
I thought the soala did not break out usb unless you move the jumpers? That is why they added 2 usb on the s3
@nullstalgia commented on GitHub (Aug 20, 2022):
Sadly, I don't have a Saola board. I have the one below it, the LOLIN ESP32-S2 Mini. I was just using the picture as a reference for the ESP32-S2's pins.
But looking closely at it, it looks like the Saola doesn't even have jumpers for switching the USB port, just the USB pins broken out on the side.
Edit: Updating my ESP32 Core from 5.0.0 to 5.1.0 did not change anything either.
@nullstalgia commented on GitHub (Aug 21, 2022):
So, after doing some tests and research, I have some stuff to share.
When testing the board's WiFi with a normal
Wifi.begin(), it would also crash!It turns out that the ESP32-S2 board I have is a clone of the Lolin S2 Mini, and has a flaw in the copy: the capacitor on the reset line is missing its connection to GND. Scraping the soldermask of the GND plane directly near it and using a solder blob to connect it to the capacitor works with fixing A crash when Wifi is being used.
Source of image and fix.
I was able to write the rest of my sketch (send a payload to my MQTT server and then go into deep sleep) to make sure it works with the capacitor fix, and it does.
However, this does not fix my issue with the library.
If I try to use autoConnect() still, it does just crash.ok or not anymorei swear im going mad
Now it does work?? But autoConnect() consistently fails until I put
WiFi.mode(WIFI_AP);before autoConnect()By fails, I mean the AP it makes when a connection fails does not appear on my phone. And if it has credentials saved, connection attempts will fail.
@tablatronix commented on GitHub (Aug 22, 2022):
I heard of another issue maybe with this board maybe, not sure, you have to decrease the wifi power or it wont initialize wifi, as there is not enough power or something?
Definitely get your hands on a real dev board or some others when working with this stuff, will save your days of debugging
@nullstalgia commented on GitHub (Aug 24, 2022):
Well, part of the issue is that I already have a PCB made for this footprint in mind 😅
Was working fine in preliminary tests with RGB and deep sleep, and I guess the clone's engineers were also lulled into the false sense of security.
I'll be sure to do more robust testing in the future :P
But, it seems that the capacitor bodge+lowering WiFi power might be my best best to avoid needing to spend more money.
Thank you for bearing with me!
EDIT: But I did grab a Feather S2 Neo while debugging this! So hopefully that can be a good sanity checker.
@tablatronix commented on GitHub (Aug 31, 2022):
Have you tried clearing and reloading the esp lib or platform in pio?
@NightSkySK commented on GitHub (Sep 2, 2022):
I have ESP32-S2-Soala board, and also have problems with WiFi autoConnect(). In my case it doesn't crash, but even if logs show that AccessPoint is created I can't detect it by any device:
The same code works at ESP32-CAM module flawlessly.
@tablatronix commented on GitHub (Sep 2, 2022):
#1482 - see this issue for this specific issue
Crashes are due to bad chips, bad boards, bad power supply, I cannot get them to work with esp lib at all, there does seem to be some fixes in IDF 4.4.2 or 4.4.3 for this, but it is not easy to use.
@Vangreen commented on GitHub (Apr 16, 2023):
Thanks, works for me
@Aggeloz commented on GitHub (Nov 16, 2023):
Funny thing is, my clone board has all its connections correct. I tested with a multimeter and even did the fix and it still gives me the same problem, i even added a capacitor between the reset button and GND and it still has the same issues. I dont understand what else could be causing this.
@tablatronix commented on GitHub (Nov 16, 2023):
What is the exact crash? Could still be bad power, or memory issue, try full erase and power with an actual power supply. There can also be crashes if your flash mode is set wrong
@Aggeloz commented on GitHub (Nov 16, 2023):
I get no messages from the monitor cause im using CDC for console output but its none of those things you mentioned. My boards crash as soon as i get my fingers close to the antenna or i put it on a breadboard, also if its already sitting on a breadboard it either crashes the CDC output or the board basically never boots.
@tablatronix commented on GitHub (Nov 17, 2023):
You will have to use a serial adapter to get logs probably
@Aggeloz commented on GitHub (Nov 17, 2023):
I'll set it up to keep the core dump on flash memory and read it after, it's kind of impossible to connect a serial adapter to it since the rx/tx pins are not broken out.
@Aggeloz commented on GitHub (Nov 17, 2023):
Im getting no errors at all, the chip just hangs and then restarts. Its really weird behavior. Im gonna attempt to attach an external serial to the chip but i doubt im going to manage it because the solder points for the cpu are minuscule.
Edit: I think i managed to get this Core Dump
https://pastebin.com/fUk8zfyj
@tablatronix commented on GitHub (Nov 17, 2023):
Yeah you can output serial on any pins
Do you know which core the exception was throw on ?
Sure looks like that mqttclient stuff is suspect, if it is that thread, could try disabling that or sending static data could be reading from unsafe memory pointer, clientid, hostname, user input?
@VaAndCob commented on GitHub (Nov 28, 2023):
From my experience, ESP32-S2 Lolin have trouble with WiFi, I have more than 10 modules and they have the same behaviour.
I found that you must throttle wifi transmit power down after the first time wifi connected.
default tx power is max, that makes wifi unstable and hot.
Connecting other sensors or modules directly to the Vbus (5V) pin could also make wifi unstable.
@Aggeloz commented on GitHub (Nov 28, 2023):
I know, ive tried setting the tx power alot lower but it didnt help at all.
@PotatoFi commented on GitHub (Apr 15, 2025):
Just adding that in 2025, on some clone S2 minis that I unknowingly ordered from Aliexpress, I ran into this problem and the solder blob fixed it on both units.