Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32-S2-Mini constantly reboots #4392

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

da-markson
Copy link

Soultion addresses problem where SOME of the ESP-S2-Mini's would constanly reboot itself, thus never allowing the Access Point to initialize

…stanly reboot itself, thus never

allowing the Access Point to initialize
DEBUG_PRINT(F("Opening access point "));
DEBUG_PRINTLN(apSSID);
WiFi.softAPConfig(IPAddress(4, 3, 2, 1), IPAddress(4, 3, 2, 1), IPAddress(255, 255, 255, 0));
WiFi.softAP(apSSID, apPass, apChannel, apHide);
#ifdef ARDUINO_ARCH_ESP32
WiFi.setTxPower(wifi_power_t(txPower));
Copy link
Collaborator

@softhack007 softhack007 Dec 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 the "solution" basicially disables WiFi.setTxPower(wifi_power_t(txPower)), because trying to set TX power before AP is started will be ignored.

https://github.com/espressif/arduino-esp32/blob/1f038677eb2eaf5e9ca6b6074486803c15468bed/libraries/WiFi/src/WiFiGeneric.cpp#L1407-L1410

I don't think this can be a general solution, because some boards require setting a reduced tx power otherwise wifi will not work.

Its interesting that this solves any problem ... maybe the default TX power is too high.

Copy link
Collaborator

@softhack007 softhack007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As explained (see above) I don't agree with the "solution" because it's just making the TX power feature useless in AP mode.

I think we need a different solution, maybe by only setting TX power when it's different from the default value. Or an extra option in wifi settings, like "default" or "no change".

@da-markson
Copy link
Author

da-markson commented Dec 14, 2024 via email

@blazoncek
Copy link
Collaborator

@da-markson can you provide crash dump using exception decoder?
Without it this change makes little sense.

@da-markson
Copy link
Author

da-markson commented Dec 14, 2024 via email

@DedeHai
Copy link
Collaborator

DedeHai commented Dec 14, 2024

the IDF has an option to "reduce TX power on brown out", but I am not sure this is enabled in WLED and also I did not check on how that is implemented and setting TX power manually will probably overrule that anyway.
what could be a solution to this: enable a timer that persists between reboots (RTC peripheral has something like that, at least I saw it in an IDF example). It could be used to detect boot-loops and reduce TX power level-by-level to a defined minimum. It is more of a hack though than a real solution, as the real solution would be to fix the hardware with a capacitor to avoid brownout.

@softhack007
Copy link
Collaborator

softhack007 commented Dec 14, 2024

Unfortunately I don't have an external JTAG debugger

@da-markson could you check if your S2 board still works when you just comment out the line with WiFi.setTxPower(wifi_power_t(txPower)) ?
This way we could verify that setTxPower has no other side-effects that we did not consider yet (like reducing TX power of STA which might still scan for networks).

@blazoncek
Copy link
Collaborator

@da-markson you do not need JTAG to get crash dumps. connect USB serial, add -D WLED_DEBUG, add monitor_filters = esp32_exception_decoder and monior serial output using PIO

@blazoncek
Copy link
Collaborator

BTW I have several Lolin S2 Mini and all of them work as expected. Perhaps there is a HW issue with your boards.

@da-markson
Copy link
Author

da-markson commented Dec 15, 2024 via email

@blazoncek blazoncek added the waiting for feedback addition information needed to better understand the issue label Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
waiting for feedback addition information needed to better understand the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants