mirror of
https://github.com/esphome/esphome.git
synced 2026-10-07 11:26:39 +00:00
[wifi] Keep a second fallback AP start from resetting the LN882x (#20168)
This commit is contained in:
@@ -28,6 +28,11 @@ extern "C" {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef USE_LN882X
|
||||
#include <WiFiPrivate.h>
|
||||
#undef DATA // clashes with setup_priority::DATA
|
||||
#endif
|
||||
|
||||
#include "esphome/core/application.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
@@ -770,6 +775,13 @@ bool WiFiComponent::wifi_start_ap_(const WiFiAP &ap) {
|
||||
|
||||
yield();
|
||||
|
||||
#ifdef USE_LN882X
|
||||
// LibreTiny's LN882H softAP() points ap.bssid at a static array and frees it
|
||||
// on the next call, tripping FreeRTOS's configASSERT until the watchdog
|
||||
// resets the chip. Clear it so that a second AP start frees nothing.
|
||||
static_cast<WiFiData *>(WiFi.data)->ap.bssid = nullptr;
|
||||
#endif
|
||||
|
||||
return WiFi.softAP(ap.ssid_.c_str(), ap.password_.empty() ? NULL : ap.password_.c_str(),
|
||||
ap.has_channel() ? ap.get_channel() : 1, ap.get_hidden());
|
||||
}
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
wifi:
|
||||
networks:
|
||||
- ssid: MySSID
|
||||
password: password1
|
||||
ap:
|
||||
ssid: Fallback Hotspot
|
||||
password: password2
|
||||
|
||||
captive_portal:
|
||||
Reference in New Issue
Block a user