Fix SoftAP boot abort: stop DHCP before setting static AP IP; drop RC522 SPI clock to 1 MHz; order RFID before display init

This commit is contained in:
2026-09-10 07:01:57 +02:00
parent aff5d1477f
commit 05d8012c8b
3 changed files with 18 additions and 8 deletions

View File

@@ -19,16 +19,17 @@ void app_main(void)
ESP_ERROR_CHECK(spi_bus_manager_init());
ESP_ERROR_CHECK(storage_manager_init());
ESP_ERROR_CHECK(display_manager_init());
/* RFID is not fatal: the reader may be unpowered, unwired, or a clone
* that needs a slower SPI clock. Continue booting so the display, SoftAP
* and web pairing all stay usable; scanning is simply unavailable. */
/* RFID comes BEFORE the display: the panel's init traffic plus the strap
* load on GPIO15/GPIO2 can glitch the shared SPI bus and make the MFRC522
* self-test flake. Starting the reader on a quiet bus yields a clean test. */
esp_err_t ret = rfid_manager_init();
if (ret != ESP_OK || rfid_manager_start() != ESP_OK) {
ESP_LOGW(TAG, "RFID unavailable (%s) - continuing without card scanning", esp_err_to_name(ret));
}
ESP_ERROR_CHECK(display_manager_init());
/* Networking is not fatal either: without it the device runs offline
* (cached cards + AP pairing). Init failures are logged, boot continues. */
ret = wifi_manager_init();