# Neustartschleife nach gescheitertem Anschluss eines Bluetoothkopfhörers

**URL:** <https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886>\
**Category:** Software\
**Created:** [3. April 2023 um 13:51 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886 "2023-04-03T13:51:51Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![physicist](https://forum.espuino.de/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@physicist](https://forum.espuino.de/u/physicist)\
**Post date:** [3. April 2023 um 13:51 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/1 "2023-04-03T13:51:51Z")

</div>

Hallo,  
ich bin etwas ratlos und frage mich gerade ob ich etwas Offensichtliches übersehe. Ich habe versucht einen Bluetoothkopfhörer zu koppeln. Ich habe dazu den angezeigten Namen in der settings.h eingetragen und eine Moduskarte erstellt. Leider hat das koppeln nicht funktioniert und der ESPuino ist eine Neustartschleife geraten aus der ich nicht mehr durch erneutes Kartenauflegen hinaus komme.  
Ist diese Scheife so gewollt? Ich habe bereits mehrfach versucht die Software neu aufzuspielen aber das scheint nicht zu helfen. Gibt es eine Möglichkeit wie man den Modus wieder „manuell“ auf Wlan stellen kann?

Hier mal ein Auszug aus dem Serial monitor:

> * * *
> 
> | _**| / | | \_ \ \_ \_ () \_ \_\_ \_\_\_  
> | | \_ \ | |) | | | | | | | | ’ \ / \_   
> | |**) | | \_\_/ | || | | | | | | | | () |  
> |\_\_\_\_| |__/ || \_,_| |_| |_| |\_| \_\_\_/  
> Rfid-controlled musicplayer
> 
> [292] Software-revision: 20230214-1  
> [295] Git-revision: c578f88-dirty  
> [298] ESP-IDF version: v3.3.5-1-g85c43024c  
> [303] Wakeup was not caused by deepsleep: 0  
> [307] Versuche SD-Karte wird im SD\_MMC-Modus (1 Bit) zu mounten…  
> [313] SD card type: [315] SDHC  
> [316] SD-Kartengr��e / freier Speicherplatz: 30528 MB / 27038 MB  
> [323] FTP-User wurde aus NVS geladen: esp32  
> [327] FTP-Passwort wurde aus NVS geladen: esp32  
> [432] RFID-Tags koennen jetzt gescannt werden…  
> [E][Preferences.cpp:472] getString(): nvs\_get\_str len fail: btDeviceName NOT\_FOUND  
> [1010] Bluetooth source started, connect to device: ‚My POGS Wireless Headphone‘  
> [1013] Freier Heap-Speicher nach Setup-Routine: 27700  
> [1018] PSRAM: 0 bytes  
> [1020] Flash-size: 16777216 bytes  
> [1030] Neue Lautst�rke empfangen via Queue: 3  
> assertion „btc\_av\_cb.sm\_handle != NULL“ failed: file „/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/bt/bluedroid/btc/profile/std/a2dp/btc\_av.c“, line 1512, function: btc\_a2d\_src\_connect  
> abort() was called at PC 0x4012aec7 on core 0
> 
> ELF file SHA256: 0000000000000000
> 
> Backtrace: 0x40091a38:0x3ffef360 0x40091cb5:0x3ffef380 0x4012aec7:0x3ffef3a0 0x40159fb6:0x3ffef3d0 0x4015a494:0x3ffef3f0 0x40151861:0x3ffef420 0x40093842:0x3ffef450
> 
> Rebooting…  
> [62] Maximale Inaktivit�tszeit wurde aus NVS geladen: 10  
> [113] RFID-Tags koennen jetzt gescannt werden…  
> [113] Port-expander gefunden  
> [115] Interrupt f�r Port-Expander aktiviert  
> [116] Zyklus f�r Batteriemessung fuer Neopixel-Anzeige aus NVS geladen: 10 Minuten  
> [123] Unterer Spannungslevel (Batterie) fuer Neopixel-Anzeige aus NVS geladen: 3.00 V  
> [130] Oberer Spannungslevel (Batterie) fuer Neopixel-Anzeige aus NVS geladen: 3.30 V  
> [138] Spannungslevel (Batterie) fuer Niedrig-Warnung via Neopixel aus NVS geladen: 3.10 V  
> [146] Spannungslevel (Batterie) fuer Kritisch-Warnung via Neopixel aus NVS geladen: 3.10 V  
> [153] Initiale Lautst�rke wurde aus NVS geladen: 3  
> [158] Maximale Lautst��rke f�r Lautsprecher wurde aus NVS geladen: 9  
> [164] Maximale Lautst�rke f�r Kopfh�rer wurde aus NVS geladen: 6  
> [170] Lautsprecher eingeschaltet  
> [174] Maximale Lautst�rke wurde gesetzt auf: 9  
> [231] Initiale LED-Helligkeit wurde aus NVS geladen: 126  
> [232] LED-Helligkeit f�r Nachtmodus wurde aus NVS geladen: 1
> 
> * * *
> 
> | _**| / | | \_ \ \_ \_ () \_ \_\_ \_\_\_  
> | | \_ \ | |) | | | | | | | | ’ \ / \_   
> | |**) | | \_\_/ | || | | | | | | | | () |  
> |\_\_\_\_| |__/ || \_,_| |_| |_| |\_| \_\_\_/  
> Rfid-controlled musicplayer
> 
> [292] Software-revision: 20230214-1  
> [295] Git-revision: c578f88-dirty  
> [298] ESP-IDF version: v3.3.5-1-g85c43024c  
> [303] Wakeup was not caused by deepsleep: 0  
> [307] Versuche SD-Karte wird im SD\_MMC-Modus (1 Bit) zu mounten…  
> [313] SD card type: [315] SDHC  
> [316] SD-Kartengr��e / freier Speicherplatz: 30528 MB / 27038 MB  
> [323] FTP-User wurde aus NVS geladen: esp32  
> [327] FTP-Passwort wurde aus NVS geladen: esp32  
> [432] RFID-Tags koennen jetzt gescannt werden…  
> [E][Preferences.cpp:472] getString(): nvs\_get\_str len fail: btDeviceName NOT\_FOUND  
> [963] Bluetooth source started, connect to device: ‚My POGS Wireless Headphone‘  
> [967] Freier Heap-Speicher nach Setup-Routine: 27724  
> [971] PSRAM: 0 bytes  
> [974] Flash-size: 16777216 bytes  
> [979] Neue Lautst�rke empfangen via Queue: 3  
> assertion „btc\_av\_cb.sm\_handle != NULL“ failed: file „/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/bt/bluedroid/btc/profile/std/a2dp/btc\_av.c“, line 1512, function: btc\_a2d\_src\_connect  
> abort() was called at PC 0x4012aec7 on core 0
> 
> ELF file SHA256: 0000000000000000
> 
> Backtrace: 0x40091a38:0x3ffef360 0x40091cb5:0x3ffef380 0x4012aec7:0x3ffef3a0 0x40159fb6:0x3ffef3d0 0x4015a494:0x3ffef3f0 0x40151861:0x3ffef420 0x40093842:0x3ffef450
> 
> Rebooting…

Danke schonmal!

---

<div class="post-metadata">

**Author:** ![tueddy](https://forum.espuino.de/user_avatar/forum.espuino.de/tueddy/32/22_2.png) [@tueddy](https://forum.espuino.de/u/tueddy)\
**Post date:** [3. April 2023 um 14:51 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/2 "2023-04-03T14:51:07Z")

</div>

Das ist ein Crash in der BT Bibliothek und so sicher nicht gewollt!  
Um den ESPuino wieder startfähig zu bekommen gibt es diese Möglichkeiten:

- Erase Flash durchführen. Damit wird der Startmodus wieder auf Normal gebracht. Dann sind aber alle Kartenzuordnungen weg und Du müsstest sie über die Web Oberfläche neu importieren (NVS Import vom Backup)
- In main.cpp in der Setup Routine den Modus mit `System_SetOperationMode(OPMODE_NORMAL);` einmal neu setzen, starten und danach wieder rausnehmen
- Du könntest einmal den DEV-Branch ausprobieren ob da das Problem auch auftritt. Der DEV-Branch verwendet ein neueres BT Framework mit vielen Bugfixes…

Frage wie das passieren kann. Ist Dein Kopfhörer „My POGS Wireless Headphone“? Weil den habe ich auch hier und er funktioniert einwandfrei…

---

<div class="post-metadata">

**Author:** ![physicist](https://forum.espuino.de/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@physicist](https://forum.espuino.de/u/physicist)\
**Post date:** [3. April 2023 um 15:01 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/3 "2023-04-03T15:01:18Z")

</div>

Danke für die Hilfe, ich werde es bei nächstmöglicher Gelegenheit ausprobieren.

Es handelt sich um diesen Kopfhörer hier:

[iClever BTH](https://www.amazon.de/gp/product/B0871YTSV3/ref=ppx_yo_dt_b_search_asin_title?tag=espuino0c-21)

„My POGS Wireless Headphone“ steht nur drin weil ich alle Änderungen wieder zurückgesetzt hatte.

---

<div class="post-metadata">

**Author:** ![physicist](https://forum.espuino.de/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@physicist](https://forum.espuino.de/u/physicist)\
**Post date:** [4. April 2023 um 12:54 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/4 "2023-04-04T12:54:21Z")

</div>

Erase Flash ( **pio run --target erase** im Terminal) hat schonmal funktioniert. Das mit der main.cpp habe ich nicht ausprobiert aber dafür mal den DEV-Branch geflashed. Sieht gut aus. Werde es die Tage nocheinmal mit den Kopfhörern versuchen.  
Vielen Dank tueddy!

---

<div class="post-metadata">

**Author:** ![physicist](https://forum.espuino.de/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@physicist](https://forum.espuino.de/u/physicist)\
**Post date:** [5. April 2023 um 09:52 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/5 "2023-04-05T09:52:23Z")

</div>

So habe inzwischen 3 verschiedene Bluetooth Geräte ausprobiert. Zum iClever-BTH02 noch EarFun free Pro und SMSL SA-36A plus. Leider alle ohne Erfolg. Bei letzterem ist der ESPuino wieder in die Neustartschleife geraten, ist aber nach ein paar Durchgängen wieder im BT Modus gelandet. Ich habe den Kopfhörer an und aus gemacht, vielleicht lag es daran. Ich habe auch den ESPuino und Kopfhörer im Kühlschrank geparkt und die Zeile leer gelassen, damit er sich mit dem erstbesten Gerät verbindet . Hat natürlich nicht funktioniert 😃.  
Ich habe versucht nachzuvollziehen wie ich das erweiterte Logging aktivieren kann, steige aber nicht ganz durch. Ich werde versuchen mich bei Gelegenheit etwas tiefer einzuarbeiten.

> * * *
> 
> | _**| / | | \_ \ \_ \_ () \_ \_\_ \_\_\_  
> | | \_ \ | |) | | | | | | | | ’ \ / \_   
> | |**) | | \_\_/ | || | | | | | | | | () |  
> |\_\_\_\_| |__/ || \_,_| |_| |_| |\_| \_\_\_/  
> Rfid-controlled musicplayer
> 
> [341] Software-revision: 20230214-1  
> [344] Git-revision: 1c6bc88-dirty  
> [348] ESP-IDF version: v3.3.5-1-g85c43024c  
> [352] Wakeup was not caused by deepsleep: 0  
> [356] Versuche SD-Karte wird im SD\_MMC-Modus (1 Bit) zu mounten…  
> [362] SD card type: [364] SDHC  
> [365] SD-Kartengr��e / freier Speicherplatz: 30528 MB / 27038 MB  
> [372] FTP-User wurde aus NVS geladen: esp32  
> [376] FTP-Passwort wurde aus NVS geladen: esp32  
> [481] RFID-Tags koennen jetzt gescannt werden…  
> [E][Preferences.cpp:472] getString(): nvs\_get\_str len fail: btDeviceName NOT\_FOUND  
> [1028] Bluetooth source started, connect to device: ‚SMSL SA-36A plus‘  
> [1056] Freier Heap-Speicher nach Setup-Routine: 25588  
> [1056] PSRAM: 0 bytes  
> [1056] Flash-size: 16777216 bytes  
> /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:706 (xQueueCreateCountingSemaphore)- assert failed!  
> abort() was called at PC 0x40092fd3 on core 0
> 
> ELF file SHA256: 0000000000000000
> 
> Backtrace: 0x40091950:0x3fff1ba0 0x40091bcd:0x3fff1bc0 0x40092fd3:0x3fff1be0 0x401534cd:0x3fff1c00 0x40181e09:0x3fff1c20 0x401752c4:0x3fff1c40 0x40179ba4:0x3fff1c70 0x40179c4c:0x3fff1c90 0x4017abf5:0x3fff1cb0 0x401a85b1:0x3fff1cd0 0x40181319:0x3fff1cf0 0x401926b5:0x3fff1d40 0x401b2ad2:0x3fff1d80 0x40191e30:0x3fff1da0 0x4019499e:0x3fff1dc0 0x401692e2:0x3fff1de0 0x40093702:0x3fff1e10
> 
> Rebooting…  
> ets Jul 29 2019 12:21:46
> 
> rst:0xc (SW\_CPU\_RESET),boot:0x17 (SPI\_FAST\_FLASH\_BOOT)  
> configsip: 0, SPIWP:0xee  
> clk\_drv:0x00,q\_drv:0x00,d\_drv:0x00,cs0\_drv:0x00,hd\_drv:0x00,wp\_drv:0x00  
> mode:DIO, clock div:2  
> load:0x3fff0018,len:4  
> load:0x3fff001c,len:1216  
> ho 0 tail 12 room 4  
> load:0x40078000,len:10944  
> load:0x40080400,len:6360  
> entry 0x400806b4  
> [110] Maximale Inaktivit�tszeit wurde aus NVS geladen: 10  
> [161] RFID-Tags koennen jetzt gescannt werden…  
> [161] Port-expander gefunden  
> [163] Interrupt f�r Port-Expander aktiviert  
> [163] Zyklus f�r Batteriemessung fuer Neopixel-Anzeige aus NVS geladen: 10 Minuten  
> [170] Unterer Spannungslevel (Batterie) fuer Neopixel-Anzeige aus NVS geladen: 3.00 V  
> [178] Oberer Spannungslevel (Batterie) fuer Neopixel-Anzeige aus NVS geladen: 4.20 V  
> [185] Spannungslevel (Batterie) fuer Niedrig-Warnung via Neopixel aus NVS geladen: 3.40 V  
> [194] Spannungslevel (Batterie) fuer Kritisch-Warnung via Neopixel aus NVS geladen: 3.10 V  
> [203] Initiale Lautst�rke wurde aus NVS geladen: 3  
> [208] Maximale Lautst��rke f�r Lautsprecher wurde ins NVS geschrieben.  
> [214] Maximale Lautst�rke f�r Kopfh�rer wurde ins NVS geschrieben.  
> [219] Lautsprecher eingeschaltet  
> [222] Maximale Lautst�rke wurde gesetzt auf: 21  
> [279] Initiale LED-Helligkeit wurde aus NVS geladen: 16  
> [279] LED-Helligkeit f�r Nachtmodus wurde aus NVS geladen: 2
> 
> * * *
> 
> | _**| / | | \_ \ \_ \_ () \_ \_\_ \_\_\_  
> | | \_ \ | |) | | | | | | | | ’ \ / \_   
> | |**) | | \_\_/ | || | | | | | | | | () |  
> |\_\_\_\_| |__/ || \_,_| |_| |_| |\_| \_\_\_/  
> Rfid-controlled musicplayer
> 
> [341] Software-revision: 20230214-1  
> [344] Git-revision: 1c6bc88-dirty  
> [348] ESP-IDF version: v3.3.5-1-g85c43024c  
> [352] Wakeup was not caused by deepsleep: 0  
> [356] Versuche SD-Karte wird im SD\_MMC-Modus (1 Bit) zu mounten…  
> [362] SD card type: [364] SDHC  
> [365] SD-Kartengr��e / freier Speicherplatz: 30528 MB / 27038 MB  
> [372] FTP-User wurde aus NVS geladen: esp32  
> [376] FTP-Passwort wurde aus NVS geladen: esp32  
> [481] RFID-Tags koennen jetzt gescannt werden…  
> [E][Preferences.cpp:472] getString(): nvs\_get\_str len fail: btDeviceName NOT\_FOUND  
> [1058] Bluetooth source started, connect to device: ‚SMSL SA-36A plus‘  
> [1060] Freier Heap-Speicher nach Setup-Routine: 26096  
> [1065] PSRAM: 0 bytes  
> [1067] Flash-size: 16777216 bytes  
> /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c:706 (xQueueCreateCountingSemaphore)- assert failed!  
> abort() was called at PC 0x40092fd3 on core 0
> 
> ELF file SHA256: 0000000000000000
> 
> Backtrace: 0x40091950:0x3fff1ba0 0x40091bcd:0x3fff1bc0 0x40092fd3:0x3fff1be0 0x401534cd:0x3fff1c00 0x40181e09:0x3fff1c20 0x401752c4:0x3fff1c40 0x40179ba4:0x3fff1c70 0x40179c4c:0x3fff1c90 0x4017abf5:0x3fff1cb0 0x401a85b1:0x3fff1cd0 0x40181319:0x3fff1cf0 0x401926b5:0x3fff1d40 0x401b2ad2:0x3fff1d80 0x40191e30:0x3fff1da0 0x4019499e:0x3fff1dc0 0x401692e2:0x3fff1de0 0x40093702:0x3fff1e10
> 
> Rebooting…

---

<div class="post-metadata">

**Author:** ![laszloh](https://forum.espuino.de/user_avatar/forum.espuino.de/laszloh/32/1975_2.png) [@laszloh](https://forum.espuino.de/u/laszloh)\
**Post date:** [5. April 2023 um 12:33 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/6 "2023-04-05T12:33:03Z")

</div>

Was mir bei deinem Log auffällt, ist, dass sehr wenig Heap nach dem Setup verfügbar ist: `[1060] Freier Heap-Speicher nach Setup-Routine: 26096`. Wenn der Heap ausgeht, kann es schon passieren, dass die Erstellung der Queue fehl schlägt.

26k sind knapp 1/3 von dem, was ohne Bluetooth Device verfügbar sein müsste. Ich werde zu Hause mal probieren, wie die Speicherauslastung mit einem Verbundenem Bluetooth Headset aussieht. Kannst du sagen, welche Defines in deiner settings.h sich zu dem Defaults unterscheiden?

  

Bei einem Stack Trace wäre es immer gut, diesen Dekodiert zu haben. Dann würden wir wissen, woher wir gekommen sind bevor die Erstellung der Queue gescheitert ist. Kannst du schauen, ob du in VSCode `monitor_filters = esp32_exception_decoder` in deinem platformio.ini hast?

---

<div class="post-metadata">

**Author:** ![physicist](https://forum.espuino.de/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@physicist](https://forum.espuino.de/u/physicist)\
**Post date:** [5. April 2023 um 15:34 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/7 "2023-04-05T15:34:13Z")

</div>

Danke laszloh für die Hilfe!

Änderungen settings.h:

> #define PORT\_EXPANDER\_ENABLE  
> #define SHUTDOWN\_ON\_BAT\_CRITICAL  
> #define BUTTON\_3\_SHORT CMD\_PLAYPAUSE  
> #define NUM\_LEDS 36

Änderung settings-d32-lolin\_d32\_sdmmc\_pe.h

> #define REVERSE\_ROTARY

Hier der Anfang meiner platformio.ini: `monitor_filters = esp32_exception_decoder` steht drin.

> ; PlatformIO Project Configuration File  
> ;  
> ; Build options: build flags, source filter  
> ; Upload options: custom upload port, speed and extra flags  
> ; Library options: dependencies, extra library storages  
> ; Advanced options: extra scripting  
> ;  
> ; Please visit documentation for the other options and examples  
> ; [Redirecting...](https://docs.platformio.org/page/projectconf.html)
> 
> [platformio]  
> extra\_configs = platformio-override.ini  
> default\_envs = lolin\_d32\_pro\_sdmmc\_pe
> 
> [env]  
> board\_build.flash\_mode = qio  
> board\_build.bootloader = dio  
> board\_build.partitions = custom\_4mb\_noota.csv  
> platform = espressif32@\<=3.5.0  
> ;platform = espressif32@^6.1.0  
> ;platform = espressif32  
> ;platform = [GitHub - platformio/platform-espressif32: Espressif 32: development platform for PlatformIO](https://github.com/platformio/platform-espressif32.git#feature/arduino-upstream)  
> framework = arduino  
> monitor\_speed = 115200  
> monitor\_filters = esp32\_exception\_decoder  
> ;monitor\_port = /dev/cu.SLAB\_USBtoUART  
> ;upload\_port = /dev/cu.SLAB\_USBtoUART  
> ;upload\_speed = 115200  
> extra\_scripts =  
> pre:gitVersion.py  
> pre:processHtml.py  
> lib\_deps =  
> [GitHub - schreibfaul1/ESP32-audioI2S: Play mp3 files from SD via I2S](https://github.com/schreibfaul1/ESP32-audioI2S.git)  
> [GitHub - madhephaestus/ESP32Encoder: A Quadrature and half quadrature PCNT peripheral driven encoder library supporting 8 encoders](https://github.com/madhephaestus/ESP32Encoder.git#61aef9c)  
> [GitHub - knolleary/pubsubclient: A client library for the Arduino Ethernet Shield that provides support for MQTT.](https://github.com/knolleary/pubsubclient.git#2d228f2)  
> [GitHub - biologist79/ESP32FTPServer: Simple FTP Server for Espressif's ESP32](https://github.com/biologist79/ESP32FTPServer)  
> [https://github.com/FastLED/FastLED.git@3.5.0](https://github.com/FastLED/FastLED.git@3.5.0)  
> [GitHub - me-no-dev/ESPAsyncWebServer: Async Web Server for ESP8266 and ESP32](https://github.com/me-no-dev/ESPAsyncWebServer.git#1d46269)  
> [GitHub - me-no-dev/AsyncTCP: Async TCP Library for ESP32](https://github.com/me-no-dev/AsyncTCP.git#ca8ac5f)  
> [GitHub - bblanchon/ArduinoJson: 📟 JSON library for Arduino and embedded C++. Simple and efficient.](https://github.com/bblanchon/ArduinoJson.git#7abf875)  
> [GitHub - pschatzmann/ESP32-A2DP: A Simple ESP32 Bluetooth A2DP Library (to implement a Music Receiver or Sender) that supports Arduino, PlatformIO and Espressif IDF](https://github.com/pschatzmann/ESP32-A2DP.git#07550a3)  
> [GitHub - Arduino-IRremote/Arduino-IRremote: Infrared remote library for Arduino: send and receive infrared signals with multiple protocols](https://github.com/Arduino-IRremote/Arduino-IRremote.git#ed94895)  
> [GitHub - kkloesener/MFRC522\_I2C](https://github.com/kkloesener/MFRC522_I2C.git#121a27e)  
> [GitHub - miguelbalboa/rfid: Arduino RFID Library for MFRC522](https://github.com/miguelbalboa/rfid.git#ba72b92)  
> [GitHub - tuniii/LogRingBuffer](https://github.com/tuniii/LogRingBuffer.git#89d7d3e)  
> [GitHub - tueddy/PN5180-Library: PN5180 library for Arduino](https://github.com/tueddy/PN5180-Library.git#f776e66)  
> [GitHub - SZenglein/Arduino-MAX17055\_Driver: Driver library for MAX17055 Fuel Gauge Sensor](https://github.com/SZenglein/Arduino-MAX17055_Driver#a0a5418)  
> platform\_packages =  
> platformio/framework-arduinoespressif32 @ [GitHub - espressif/arduino-esp32: Arduino core for the ESP32](https://github.com/espressif/arduino-esp32.git#1.0.6)  
> ;platformio/framework-arduinoespressif32 @ [GitHub - tuniii/arduino-esp32-v1.0.6-wt](https://github.com/tuniii/arduino-esp32-v1.0.6-wt#v1.0.6-patched)  
> ;platformio/tool-esptoolpy @ ~1.30100  
> ;framework-arduinoespressif32 @ [GitHub - espressif/arduino-esp32: Arduino core for the ESP32](https://github.com/espressif/arduino-esp32.git#2.0.1-RC1)

geändert habe ich hier folgende Auskommentierungen:

> platform = espressif32@\<=3.5.0  
> ;platform = espressif32@^6.1.0
> 
> platformio/framework-arduinoespressif32 @ [GitHub - espressif/arduino-esp32: Arduino core for the ESP32](https://github.com/espressif/arduino-esp32.git#1.0.6)

---

<div class="post-metadata">

**Author:** ![tueddy](https://forum.espuino.de/user_avatar/forum.espuino.de/tueddy/32/22_2.png) [@tueddy](https://forum.espuino.de/u/tueddy)\
**Post date:** [5. April 2023 um 19:22 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/8 "2023-04-05T19:22:59Z")

</div>

Ich habe gerade BT Kopfhörer mit dem aktuellen DEV-Branch getestet und kann keinen Fehler feststellen:

```auto
[976] Bluetooth source started, connect to device: 'ACT-BHP-JR'
[986] Freier Heap-Speicher nach Setup-Routine: 52020
[987] PSRAM: 4191915 bytes
..
[6200] Bluetooth source => connection state: Disconnected
[7822] Bluetooth source => connection state: Connecting
..
[10021] Bluetooth source => connection state: Connected
[11283] Bluetooth source => audio state: Started

```

@physicist Ich teile die Vermutung von @laszloh das nicht bei Dir nicht genügend Speicher zur Verfügung steht. Ich verwende den Lolin D32 Pro (Profil „lolin\_d32\_pro\_sdmmc\_pe“). Evt. macht der PSRAM den Unterschied? Auf jeden Fall mache ich mal ein Issue beim Autor der Bibliothek auf um diese Bootschleife zu verhindern…

---

<div class="post-metadata">

**Author:** ![biologist](https://forum.espuino.de/user_avatar/forum.espuino.de/biologist/32/66_2.png) [@biologist](https://forum.espuino.de/u/biologist)\
**Post date:** [5. April 2023 um 19:36 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/9 "2023-04-05T19:36:24Z")

</div>

@physicist Setze mal die Anzahl der LEDs wieder runter auf 24. Vielleicht ist das ein Speicherproblem.

---

<div class="post-metadata">

**Author:** ![laszloh](https://forum.espuino.de/user_avatar/forum.espuino.de/laszloh/32/1975_2.png) [@laszloh](https://forum.espuino.de/u/laszloh)\
**Post date:** [5. April 2023 um 19:56 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/10 "2023-04-05T19:56:12Z")

</div>

Ich habe mich gerade eine Stunde mit einem WROOM ESPuino und einem BT Headset herumgespielt. Bei mir schaut es mit Arduino 2.0.7 Core noch schlimmer aus:

```txt
[1035] Bluetooth source started, connect to device: 'First device found'
[1045] Freier Heap-Speicher nach Setup-Routine: 7112
[1046] PSRAM: 0 bytes
[1046] Flash-size: 4194304 bytes

```

Ich denke ein WROOM hat einfach zu wenig Speicher. Ohne PSRAM wird BT Source nichts reißen können. Wenn bei mir einmal das Verbinden geht, crasht der ESP mit den unterschiedlichsten Stack Traces (was auf OOM, bzw Memory Corruption hinweißt) ← bei 7k freiem HEAP nicht verwunderlich.

@physicist Bei Arduuno 1 schaut es ein wenig besser aus mit dem Heap, aber auch nciht genug um sauber Arbeiten zu können. Aber da bin ich auch am Pairing gescheiter. Scheinbar mag mich mein BT Headset nicht 🫤

Wieso deine Stack Traces nicht gehen kann ich aber nicht nachvollziehen. Bei mir dekodiert er sauber sowohl mit 3.5.0 als auch 6.1.0. Sehr, sehr verwunderlich. Hast du dein ESPuino neu geflasht vor dem Monitor (bzw, sagt er so etwas wie „firmware at […] does not exist, rebuild the project“)?

---

<div class="post-metadata">

**Author:** ![tueddy](https://forum.espuino.de/user_avatar/forum.espuino.de/tueddy/32/22_2.png) [@tueddy](https://forum.espuino.de/u/tueddy)\
**Post date:** [5. April 2023 um 20:12 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/11 "2023-04-05T20:12:44Z")

</div>

> [@laszloh](#):
>
> Aber da bin ich auch am Pairing gescheiter. Scheinbar mag mich mein BT Headset nicht 🫤

Ja das erste Pairing ist hakelig. Der Device-Name muss zu 100% passen & wir hatten ja neulich den Kopfhörer mit dem super-duper geheimen Pairing-Code „0000“. Man kann mit [diesen Einstellungen](https://github.com/biologist79/ESPuino/blob/a260e05e41ce4e978882669012f9782d6d1b0866/src/Bluetooth.cpp#L202) spielen. Wenn der Kopfhörer einmal gekoppelt ist funktioniert das aber.

Speicherproblem bleibt natürlich, der ESP-32 ist da ziemlich am Anschlag…

Ansonsten frage ich in die Gemeinde:  
Wie kann man dem BT-Modus noch entkommen ohne komplettes Zurücksetzen? Weil ich habe es auch geschafft den BT-Modus über die Weboberfläche zu starten ohne zuvor eine entsprechende Modifierkarte angelernt zu haben.  
Evt. eine besondere Tastenkombi Reset + Taste 10 Sek. drücken?

---

<div class="post-metadata">

**Author:** ![laszloh](https://forum.espuino.de/user_avatar/forum.espuino.de/laszloh/32/1975_2.png) [@laszloh](https://forum.espuino.de/u/laszloh)\
**Post date:** [5. April 2023 um 21:55 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/12 "2023-04-05T21:55:44Z")

</div>

Wir könnten eine Bootloop detection einbauen (bzw. die schon drin ist aktivieren): [ESPuino/main.cpp at c578f88a3e8009ca17f07dc2f4df3aa775960db3 · biologist79/ESPuino · GitHub](https://github.com/biologist79/ESPuino/blob/c578f88a3e8009ca17f07dc2f4df3aa775960db3/src/main.cpp#L61)

Die aktuelle Implementation verwendet den NVS um ein Zähler über die Reset zu haben und sobald 3 Resets erkannt werden, wo der ESP \< 30s aktiv war, wird ein Bootloop deklariert. Hier könnten wir dann zB den Operation Mode auf Normal zurücksetzten.

Wenn wir nicht den NVS mit dem Zähler belasten wollen, kann alternativ auch der RTC-Speicher für ein solches System verwendet werden:

```diff
diff --git a/src/main.cpp b/src/main.cpp
index 69625e0..a716f90 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -43,6 +43,12 @@ bool testSPIRAM(void) {
        uint32_t bootCount = 0;
 #endif

+struct RtcState{
+ uint32_t rstCounter;
+};
+
+RTC_NOINIT_ATTR RtcState state;
+
 ////////////

 #if (HAL == 2)
@@ -133,6 +139,17 @@ void setup() {
         gHallEffectSensor.init();
     #endif

+ if(state.rstCounter > 999) {
+ state.rstCounter = 0;
+ } else if(state.rstCounter > 3) {
+ log_n("Bootloop detected!");
+ }
+ log_n("Reset Counter: %d", state.rstCounter);
+ Serial.flush();
+ state.rstCounter++;
+ delay(1000);
+ assert(0);
+
        // Needs i2c first if port-expander is used
        Port_Init();

```

Dieser gibt nach dem 4. reset `[143][E][main.cpp:145] setup(): Bootloop detected!` aus. Aber wie gesagt, PoC, der ESP ist so lange der Patch drin ist nicht verwendbar, da es nach der Ausgabe, wie viele reboots erkant wurden sich zurücksetzt (durch ein assert(0) → `SW_CPU_RESET`). Natürlich brauchen wir noch sowas wie ein CRC um zu erkennen, dass die Daten im RTC-Speicher valide sind.

**Vorteile** : RTC-Memory ist schnell zum Lesen und Schreiben (sozusagen vom Start da) und belastet den NVS nicht durch schreibzyklen

**Nachteil (wie man es sieht)**: ein `POWERON_RESET` (der ausgelöst wird, wenn man den RST auf dem ESP-Board drückt) wird durch den RTC-RAM nicht als ein Bootloop erkannt, da bei diesem der RTC-Speicher zurückgesetzt wird. Damit kann nicht manuell eine Bootloop-Erkennung ausgelöst werden, indem man schnell den Reset-Knopf drückt.

Die NVS Variante kann das erkennen, dafür braucht die Variante ein wenig länger, da sie erst laufen kann, sobal NVS aktiv ist und das Lesen & Schreibe braucht auch mehr Zeit. Könnte also passieren, dass wir a) ein wenig langsamer Booten müssen oder b) uns Bootloops entgehen.

Ein anderer Vorteil ist natürlich, es ist schon da und (hoffentlich) getestet 😆

---

<div class="post-metadata">

**Author:** ![biologist](https://forum.espuino.de/user_avatar/forum.espuino.de/biologist/32/66_2.png) [@biologist](https://forum.espuino.de/u/biologist)\
**Post date:** [6. April 2023 um 07:23 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/13 "2023-04-06T07:23:33Z")

</div>

> [@laszloh](#):
>
> Die aktuelle Implementation verwendet den NVS um ein Zähler über die Reset zu haben und sobald 3 Resets erkannt werden, wo der ESP \< 30s aktiv war, wird ein Bootloop deklariert. Hier könnten wir dann zB den Operation Mode auf Normal zurücksetzten.

Ja, aber es löst in diesem Falle nur das Problem mit dem Bootloop. Für sich erstmal ok.  
Es gibt jetzt aber noch ein weiteres Problem:

> [@tueddy](#):
>
> Wie kann man dem BT-Modus noch entkommen ohne komplettes Zurücksetzen? Weil ich habe es auch geschafft den BT-Modus über die Weboberfläche zu starten ohne zuvor eine entsprechende Modifierkarte angelernt zu haben.

Seit kurzem kann man über die WebGUI sämtliche Modifier starten. Das ist natürlich eine praktische Sache, aber im Falle von BT hockt man dann in der Falle, wenn man vorher die passende Karte nicht angelernt hat (und auch keine Tastenkombination definiert hat), um das wieder zu deaktivieren. Da habe ich gestern drüber nachgedacht und letztlich ist es so, dass das in universell gar nicht so einfach zu lösen ist. D.h. es gibt Leute, die verwenden ESPuino auch komplett ohne Tasten.  
Denkbar halte ich, dass wenn man z.B. sagt, dass man im BT-Modus den ESPuino in millis() \<= 10000 ausschaltet, dass man dann den Modus im NVS umsetzt. Ich weiß nur nicht, ob das in Kombination mit LPCD doof ist.

---

<div class="post-metadata">

**Author:** ![tueddy](https://forum.espuino.de/user_avatar/forum.espuino.de/tueddy/32/22_2.png) [@tueddy](https://forum.espuino.de/u/tueddy)\
**Post date:** [6. April 2023 um 07:59 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/14 "2023-04-06T07:59:04Z")

</div>

Zum Crash habe ich Rückmeldung vom Autor:

> Since this is not crashing in my code, this is rather a question for Espressif.  
> You could try to check how much RAM is available and not start A2DP if there is not enough, but this will be quite a nightmare, because this will be dependent on the ADF version.

Tja, fraglich ob sich das lösen lässt. Also Crash mit Lolin D32 (WROOM), kein Crash mit Lolin D32 Pro (WROVER mit 4MB PSRAM) - Ist das so richtig? Evt. könnte man den BT Modus verhindern wenn kein PSRAM zur Verfügung steht?

Gefangen ist im BT-Modus:  
Wir haben ja keine universelle Taste aber immer einen RFID-Leser, wie wäre es den BT-Modus zu verlassen wenn man eine unbekannte Karte auflegt?

---

<div class="post-metadata">

**Author:** ![physicist](https://forum.espuino.de/letter_avatar_proxy/v4/letter/p/dbc845/32.png) [@physicist](https://forum.espuino.de/u/physicist)\
**Post date:** [6. April 2023 um 08:07 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/15 "2023-04-06T08:07:12Z")

</div>

@laszloh Nach dem Erase flash habe ihn mehrfach neu geflasht, ich bekomme dabei ein paar Warnings (s.u.). Den Erase Flash habe ich nur einmal durchführen müssen. Der ESPuino war danach noch zweimal in die Neustartschleife geraten, konnte sich aber nach ein paar Durchläufen selbst wieder befreien (oder es lag daran dass ich das BT device an und ausgeschlatet habe). Dann konnte ich wieder die Karte benutzen um in den WLAN Modus zu wechseln.  
Wenn der ESPuino nicht in der Neustartschleife war, dann ist die Verbindung gescheitert, der Monitor sah dann so aus:

> [31223] Bluetooth source =\> connection state: Connecting  
> [31224] Bluetooth source =\> connection state: Disconnected  
> [41223] Bluetooth source =\> connection state: Connecting  
> [41223] Bluetooth source =\> connection state: Disconnected  
> [51223] Bluetooth source =\> connection state: Connecting  
> [51223] Bluetooth source =\> connection state: Disconnected  
> [61223] Bluetooth source =\> connection state: Connecting  
> [61224] Bluetooth source =\> connection state: Disconnected  
> [71223] Bluetooth source =\> connection state: Connecting  
> [71223] Bluetooth source =\> connection state: Disconnected  
> [81223] Bluetooth source =\> connection state: Connecting  
> [81224] Bluetooth source =\> connection state: Disconnected  
> [91223] Bluetooth source =\> connection state: Connecting  
> [91224] Bluetooth source =\> connection state: Disconnected  
> [101223] Bluetooth source =\> connection state: Connecting  
> [101224] Bluetooth source =\> connection state: Disconnected

Hier der Terminal Output den ich beim flashen bekomme:

> Processing lolin\_d32\_sdmmc\_pe (board: lolin\_d32; platform: espressif32@  
> ----------------------------------------------------------------------- be enabled via `-v, --verbose` option  
> GENERATING GIT REVISION HEADER FILE  
> „1c6bc88-dirty“ → C:\Users\admin\ESPuino\dev\ESPuino.pio\build\loli  
> GENERATING HTML HEADER FILES  
> C:\Users\admin\ESPuino\dev\ESPuino\html\management.html → C:\Users\a  
> C:\Users\admin\ESPuino\dev\ESPuino\html\accesspoint.html → C:\Users  
> C:\Users\admin\ESPuino\dev\ESPuino\html\js\i18next.min.js → C:\Users  
> C:\Users\admin\ESPuino\dev\ESPuino\html\js\i18nextHttpBackend.min.js  
> C:\Users\admin\ESPuino\dev\ESPuino\html\js\loc\_i18next.min.js → C:\U  
> C:\Users\admin\ESPuino\dev\ESPuino\html\locales\de.json → C:\Users\a  
> C:\Users\admin\ESPuino\dev\ESPuino\html\locales\en.json → C:\Users\a  
> CONFIGURATION: [https://docs.platformio.org/page/boards/espressif32/loli](https://docs.platformio.org/page/boards/espressif32/loli)  
> PLATFORM: Espressif 32 (3.5.0) \> WEMOS LOLIN D32  
> HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash  
> DEBUG: Current (esp-prog) External (esp-prog, iot-bus-jtag, jlink, minia)  
> PACKAGES:
> 
> - framework-arduinoespressif32 @ 0.0.0+sha.46d5afb
> - tool-esptoolpy @ 1.30100.210531 (3.1.0)
> - tool-mkspiffs @ 2.230.0 (2.30)
> - toolchain-xtensa32 @ 2.50200.97 (5.2.0)  
> LDF: Library Dependency Finder → [Library Dependency Finder (LDF) — PlatformIO latest documentation](https://bit.ly/configure-pio-ldf)  
> LDF Modes: Finder ~ chain, Compatibility ~ soft  
> Found 45 compatible libraries  
> Scanning dependencies…  
> Dependency Graph  
> |-- ESP32-audioI2S-master @ 2.0.0+sha.e2db546  
> | |-- FFat @ 1.0  
> | | |-- FS @ 1.0  
> | |-- FS @ 1.0  
> | |-- SD(esp32) @ 1.0.5  
> | | |-- FS @ 1.0  
> | | |-- SPI @ 1.0  
> | |-- SD\_MMC @ 1.0  
> | | |-- FS @ 1.0  
> | |-- SPI @ 1.0  
> | |-- SPIFFS @ 1.0  
> | | |-- FS @ 1.0  
> | |-- WiFi @ 1.0  
> | |-- WiFiClientSecure @ 1.0  
> | | |-- WiFi @ 1.0  
> |-- ESP32Encoder @ 0.9.2+sha.61aef9c  
> |-- PubSubClient @ 2.8.0+sha.2d228f2  
> |-- ESP32FTPServer @ 0.0.1+sha.8b95637  
> | |-- SD(esp32) @ 1.0.5  
> | | |-- FS @ 1.0  
> | | |-- SPI @ 1.0  
> | |-- FS @ 1.0  
> | |-- WiFi @ 1.0  
> |-- FastLED @ 3.5.0+sha.3d2ab78  
> | |-- SPI @ 1.0  
> |-- ESP Async WebServer @ 1.2.3+sha.1d46269  
> | |-- AsyncTCP @ 1.1.1+sha.ca8ac5f  
> | |-- FS @ 1.0  
> | |-- WiFi @ 1.0  
> |-- AsyncTCP @ 1.1.1+sha.ca8ac5f  
> |-- ArduinoJson @ 6.19.3+sha.7abf8750  
> |-- ESP32-A2DP @ 1.7.1+sha.07550a3  
> |-- IRremote @ 3.4.0+sha.ed94895  
> |-- MFRC522\_I2C @ 1.0.0+sha.121a27e  
> | |-- Wire @ 1.0.1  
> |-- MFRC522 @ 1.4.9+sha.ba72b92  
> | |-- SPI @ 1.0  
> |-- LogRingBuffer @ 0.0.0+20230404101610.sha.89d7d3e  
> |-- PN5180 Library @ 1.1.0+sha.f776e66  
> | |-- SPI @ 1.0  
> |-- Arduino-MAX17055\_Driver @ 1.0.1+sha.a0a5418  
> | |-- Wire @ 1.0.1  
> |-- Wire @ 1.0.1  
> |-- WiFi @ 1.0  
> |-- nvsdump  
> |-- Update @ 1.0  
> |-- DNSServer @ 1.1.0  
> | |-- WiFi @ 1.0  
> |-- ESPmDNS @ 1.0  
> | |-- WiFi @ 1.0  
> |-- SD(esp32) @ 1.0.5  
> | |-- FS @ 1.0  
> | |-- SPI @ 1.0  
> |-- SD\_MMC @ 1.0  
> | |-- FS @ 1.0  
> |-- Preferences @ 1.0  
> Building in release mode  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\AudioPlayer.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Battery.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\BatteryMax17055.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\BatteryMeasureVoltage.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Bluetooth.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Button.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Cmd.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Ftp.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\HallEffectSensor.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\IrReceiver.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Led.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Log.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\LogMessages\_DE.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\LogMessages\_EN.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Mqtt.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Port.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Power.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Queues.cpp.o  
> src/Port.cpp: In function ‚void Port\_Write(uint8\_t, bool, bool)‘:  
> src/Port.cpp:100:16: warning: comparison is always true due to limited  
> if (\_channel \>= 0 && \_channel \<= MAX\_GPIO) {  
> ^  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\RfidCommon.cpp.o  
> src/Mqtt.cpp:289:6: warning: 'void Mqtt\_ClientCallback(const char\*, con  
> void Mqtt\_ClientCallback(const char \*topic, const byte \*payload, uint3  
> ^  
> src/Mqtt.cpp:203:6: warning: ‚bool Mqtt\_Reconnect()‘ defined but not us  
> bool Mqtt\_Reconnect() {  
> ^  
> src/Mqtt.cpp:189:6: warning: ‚void Mqtt\_PostWiFiRssi()‘ defined but not  
> void Mqtt\_PostWiFiRssi(void) {  
> ^  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\RfidMfrc522.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\RfidPn5180.cpp.o  
> In file included from .pio/libdeps/lolin\_d32\_sdmmc\_pe/FastLED/src/FastL  
> from src/Led.cpp:16:  
> .pio/libdeps/lolin\_d32\_sdmmc\_pe/FastLED/src/fastspi.h:157:23: note: #pr
> 
> # pragma message "No hardware SPI pins defined. All SPI access w
> 
> ```
> ^
> 
> ```
> 
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\RotaryEncoder.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\SdCard.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\System.cpp.o  
> src/RfidMfrc522.cpp: In function ‚void Rfid\_Task(void\*)‘:  
> src/RfidMfrc522.cpp:61:11: warning: unused variable ‚control‘ [-Wunused  
> uint8\_t control = 0x00;  
> ^  
> src/SdCard.cpp: In function 'char\*\* SdCard\_ReturnPlaylist(const char\*,  
> src/SdCard.cpp:292:83: warning: comparison of unsigned expression \>= 0  
> if (fileOrDirectory && !fileOrDirectory.isDirectory() && fileOrDirec
> 
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Web.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\Wlan.cpp.o  
> Compiling .pio\build\lolin\_d32\_sdmmc\_pe\src\main.cpp.o  
> Linking .pio\build\lolin\_d32\_sdmmc\_pe\firmware.elf  
> Retrieving maximum program size .pio\build\lolin\_d32\_sdmmc\_pe\firmware.  
> Checking size .pio\build\lolin\_d32\_sdmmc\_pe\firmware.elf  
> Advanced Memory Usage is available via "PlatformIO Home \> Project Inspe  
> RAM: [==] 19.9% (used 65352 bytes from 327680 bytes)  
> Flash: [======] 55.6% (used 2150092 bytes from 3866624 bytes)  
> Building .pio\build\lolin\_d32\_sdmmc\_pe\firmware.bin  
> esptool.py v3.1  
> Merged 1 ELF section  
> Configuring upload protocol…  
> AVAILABLE: esp-prog, espota, esptool, iot-bus-jtag, jlink, minimodule,  
> CURRENT: upload\_protocol = esptool  
> Looking for upload port…  
> Using manually specified: COM10  
> Uploading .pio\build\lolin\_d32\_sdmmc\_pe\firmware.bin  
> esptool.py v3.1  
> Serial port COM10  
> Connecting…  
> Chip is ESP32-D0WD-V3 (revision 3)  
> Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Codin  
> Crystal is 40MHz  
> MAC: b4:8a:0a:31:56:98  
> Uploading stub…  
> Running stub…  
> Stub running…  
> Changing baud rate to 460800  
> Changed.  
> Configuring flash size…  
> Auto-detected Flash size: 16MB  
> Flash will be erased from 0x00001000 to 0x00005fff…  
> Flash will be erased from 0x00008000 to 0x00008fff…  
> Flash will be erased from 0x0000e000 to 0x0000ffff…  
> Flash will be erased from 0x00010000 to 0x0021cfff…  
> Flash params set to 0x0240  
> Compressed 18624 bytes to 12073…  
> Writing at 0x00001000… (100 %)  
> Wrote 18624 bytes (12073 compressed) at 0x00001000 in 0.6 seconds (effe  
> Hash of data verified.  
> Compressed 3072 bytes to 83…  
> Writing at 0x00008000… (100 %)  
> Wrote 3072 bytes (83 compressed) at 0x00008000 in 0.0 seconds (effectiv  
> Hash of data verified.  
> Compressed 8192 bytes to 47…  
> Writing at 0x0000e000… (100 %)  
> Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effectiv  
> Hash of data verified.  
> Compressed 2150320 bytes to 1294920…  
> Writing at 0x00010000… (1 %)  
> Writing at 0x000160f3… (2 %)  
> Writing at 0x00019f9d… (3 %)  
> Writing at 0x000287ea… (5 %)  
> Writing at 0x0002e090… (6 %)  
> Writing at 0x00034924… (7 %)  
> Writing at 0x0003b0b6… (8 %)  
> Writing at 0x00046c9b… (10 %)  
> Writing at 0x00050378… (11 %)  
> Writing at 0x00060550… (12 %)  
> Writing at 0x0006b188… (13 %)  
> Writing at 0x000756ea… (15 %)  
> Writing at 0x0008e2d9… (16 %)  
> Writing at 0x00094b8d… (17 %)  
> Writing at 0x0009a3c4… (18 %)  
> Writing at 0x000a03db… (20 %)  
> Writing at 0x000a5d3a… (21 %)  
> Writing at 0x000aafce… (22 %)  
> Writing at 0x000b00bd… (23 %)  
> Writing at 0x000b4f0b… (25 %)  
> Writing at 0x000b9b3b… (26 %)  
> Writing at 0x000bec3b… (27 %)  
> Writing at 0x000c529c… (28 %)  
> Writing at 0x000cb3c7… (30 %)  
> Writing at 0x000d0f99… (31 %)  
> Writing at 0x000d6229… (32 %)  
> Writing at 0x000db3e6… (33 %)  
> Writing at 0x000e08a0… (35 %)  
> Writing at 0x000e5e6b… (36 %)  
> Writing at 0x000eb30c… (37 %)  
> Writing at 0x000f1f5d… (38 %)  
> Writing at 0x000fc632… (40 %)  
> Writing at 0x00101f30… (41 %)  
> Writing at 0x00107651… (42 %)  
> Writing at 0x0010d03a… (43 %)  
> Writing at 0x00113b67… (45 %)  
> Writing at 0x0011a582… (46 %)  
> Writing at 0x00120988… (47 %)  
> Writing at 0x00126659… (48 %)  
> Writing at 0x0012c3f9… (50 %)  
> Writing at 0x001336ff… (51 %)  
> Writing at 0x00139795… (52 %)  
> Writing at 0x0013f8ea… (53 %)  
> Writing at 0x00145aef… (55 %)  
> Writing at 0x0014b6ed… (56 %)  
> Writing at 0x001518fc… (57 %)  
> Writing at 0x00157cb5… (58 %)  
> Writing at 0x0015d93e… (60 %)  
> Writing at 0x001636c1… (61 %)  
> Writing at 0x0016945e… (62 %)  
> Writing at 0x0016faf8… (63 %)  
> Writing at 0x001758e4… (65 %)  
> Writing at 0x0017b53a… (66 %)  
> Writing at 0x001808a0… (67 %)  
> Writing at 0x001863d5… (68 %)  
> Writing at 0x0018be3f… (70 %)  
> Writing at 0x00191e77… (71 %)  
> Writing at 0x00197939… (72 %)  
> Writing at 0x0019d6e5… (73 %)  
> Writing at 0x001a35a3… (75 %)  
> Writing at 0x001a9169… (76 %)  
> Writing at 0x001af19d… (77 %)  
> Writing at 0x001b5b6c… (78 %)  
> Writing at 0x001bc794… (80 %)  
> Writing at 0x001c25c1… (81 %)  
> Writing at 0x001c8941… (82 %)  
> Writing at 0x001ce82d… (83 %)  
> Writing at 0x001d46e7… (85 %)  
> Writing at 0x001da410… (86 %)  
> Writing at 0x001e076f… (87 %)  
> Writing at 0x001e6061… (88 %)  
> Writing at 0x001ebdc0… (90 %)  
> Writing at 0x001f173f… (91 %)  
> Writing at 0x001f87b3… (92 %)  
> Writing at 0x001fec3b… (93 %)  
> Writing at 0x00205447… (95 %)  
> Writing at 0x0020b1fc… (96 %)  
> Writing at 0x002108c1… (97 %)  
> Writing at 0x0021665a… (98 %)  
> Writing at 0x0021cb76… (100 %)  
> Wrote 2150320 bytes (1294920 compressed) at 0x00010000 in 30.0 seconds  
> Hash of data verified.
> 
> Leaving…  
> Hard resetting via RTS pin…  
> ==================================================================== [S  
> Environment Status Duration
> 
> * * *
> 
> lolin\_d32\_sdmmc\_pe SUCCESS 00:01:18.631  
> ==================================================================== 1
> 
> - Terminal will be reused by tasks, press any key to close it.

@biologist ich werde das mit den LEDs bei Gelegenheit mal ausprobieren. Evtl. sollte ich aber auch auf eine ESP version mit genügend Speicher umstellen. Bin ja tendenziell auch an den https streams interessiert.

---

<div class="post-metadata">

**Author:** ![biologist](https://forum.espuino.de/user_avatar/forum.espuino.de/biologist/32/66_2.png) [@biologist](https://forum.espuino.de/u/biologist)\
**Post date:** [6. April 2023 um 08:25 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/16 "2023-04-06T08:25:19Z")

</div>

> [@physicist](#):
>
> Evtl. sollte ich aber auch auf eine ESP version mit genügend Speicher umstellen. Bin ja tendenziell auch an den https streams interessiert.

Develboards für FePo hätte ich hier. Nur aktuell für LiPo nicht - die werden inzwischen auch selten nachgefragt.

---

<div class="post-metadata">

**Author:** ![biologist](https://forum.espuino.de/user_avatar/forum.espuino.de/biologist/32/66_2.png) [@biologist](https://forum.espuino.de/u/biologist)\
**Post date:** [6. April 2023 um 12:29 UTC](https://forum.espuino.de/t/neustartschleife-nach-gescheitertem-anschluss-eines-bluetoothkopfhoerers/1886/17 "2023-04-06T12:29:29Z")

</div>

> [@tueddy](#):
>
> Gefangen ist im BT-Modus:  
> Wir haben ja keine universelle Taste aber immer einen RFID-Leser, wie wäre es den BT-Modus zu verlassen wenn man eine unbekannte Karte auflegt?

Das klingt doch auch fein 👍.
