Spezialkarte für temporäre Dauerschleife im Hörbuchmodus (Nachtbetrieb)

Hallo zusammen

Ich möchte eine Idee für eine neue Spezialkarte bzw. Funktion einbringen – vielleicht ist das auch für andere Eltern interessant.

Ausgangslage:
Mein Sohn hört abends bzw. nachts Hörbücher mit dem TonUINO. Aktuell ist es so, dass das Hörbuch am Ende stoppt (wie im Hörbuchmodus oder Spezilmodus Hörbuch von/bis vorgesehen). Dadurch wacht er nachts mindestens einmal auf und ruft mich, damit ich das Hörbuch wieder starte.

Tagsüber ist dieses Verhalten völlig in Ordnung und auch gewünscht. Für die Nacht wäre jedoch eine automatische Lösung sehr hilfreich.

Wunsch / Feature-Idee:
Eine Spezialkarte, die eine temporäre Dauerschleife für Hörbücher aktiviert.

Gewünschtes Verhalten:

  • Das Hörbuch läuft im gewählten Modus (z. B. Hörbuchmodus)

  • Nach dem letzten Track beginnt das Hörbuch automatisch wieder von vorne (Loop)

  • Die Dauerschleife ist nur temporär aktiv

Deaktivierung der Dauerschleife (eine der folgenden Varianten wäre ausreichend):

  • automatisch beim Auflegen einer anderen Karte
    oder

  • nach einem Neustart der Box
    oder

  • durch eine separate „Loop aus“-Spezialkarte

Warum das sinnvoll wäre:

  • Ruhigere Nächte für Kind und Eltern

  • Kein manuelles Neustarten mehr nötig

  • Tagsüber bleibt das gewohnte Verhalten unverändert

  • Passt gut zum bestehenden Konzept der Spezialkarten

Ich könnte mir vorstellen, dass dies ein häufiger Anwendungsfall ist, insbesondere bei jüngeren Kindern.

Gibt es dazu bereits Ansätze oder bestehende Erweiterungen?

Liebe Grüsse

Ich denke, dass die gewünschte Funktion mit der Modifikationskarte „Titel wiederholen“ zu realisieren ist. Schau dazu einmal bei "Einstellungen Admin Menü" für Details.
Sorry, habe Hörbuch und Hörspiel verwechselt. Beim Hörbuchmodus wird oben vorgeschlagene Karte leider nicht funktionieren.
Man sollte doch genau lesen, auch wenn es schon spät ist🤔

Ich überlege mir da was.

1 „Gefällt mir“

Na dann versuche mal den Branch issue_328

Die neue Modifikationskarte schaltet den Endlos Modus an und wieder aus. Ansonsten ist das Verhalten wie oben beschrieben.
Achtung: Bei den beiden Ordnern advert und mp3 auf der SD Karte sind Dateien hinzugekommen.

1 „Gefällt mir“

Wow, danke viel Mal für das schnelle Umsetzten. Ich werde es am Wochenende gerne testen.

1 „Gefällt mir“

Was mir aufgefallen ist:

  1. Neue SD mit Testdaten:
    Wenn ich nach dem Start die Endlos-Karte auflege, dann wird zuerst die Ansage vom Starten aufgerufen. Diese hatte ich mal als Shortcut aktiviert, wird aber nicht mehr benutzt. Nicht sicher ob es einfach vom ersten Ordner einfach ein paar Sekunden abspielt.
    Wenn zuerst das Hörbuch läuft und dazwischen die Karte aufgelegt wird, dann stimmen die Ansagen beim de- und aktivieren.
  2. SD die im Tonuino drinn ist mit neuen Advert und Mp3
    Ganz komisches verhalten hier. Gleicher Fehler wie oben, wenn die Box gestartet wird. Wenn die Modifikationskarte während dem Hörspiel aufgelegt wird, dann kommt die Ansage für den Endlosmodus erst, wenn die Hörbuchkarte wieder aufgelegt wird.
  3. Aktuell ist es so, dass der Endlosmodus, wenn er läuft, den Ordner nur ein zweites Mal wiedergibt.

Unten der Log mit neuer SD.

H~
 _____         _____ _____ _____ _____ 
|_   _|___ ___|  |  |     |   | |     |
  | | | . |   |  |  |-   -| | | |  |  |

  |_| |___|_|_|_____|_____|_|___|_____|
TonUINO Version 3.x - refactored by Boerge1

created by Thorsten Voß and licensed under GNU/GPL.
Information and contribution at https://tonuino.de.

V3.3.3 06.05.26
C 3
Ver:2
Vol:25 1 10 25 5 15
EQ:1
ST:5
IB:1
AL:0
AP:1111
PCR:1
MFRC522:178
Volume: 10
track_count: 661
enter Idle
timer started

btn/cmd: start/start

enqueue mp3 262 0

play mp3 262
isPlaying: 1
isPlaying: 0
Track end: 531
Track end: 531
Card Ins
CardData: 13 37 b3 47 02 00 0b 00 00 

toggle endless from 0

play adv: 326
DfPl Err: 6
DfPl Err: 7
Card Rem
Card Ins
CardData: 13 37 b3 47 02 03 0a 03 08 
enter StartPlay
enqueue mp3 262 0
play mp3 262

isPlaying: 1
isPlaying: 0
Track end: 531
Track end: 531
2 tr in folder 3
enqueue 3-1 2  
play 3-1
isPlaying: 1
enter Play
timer stopped
isPlaying: 0
Track end: 660
play 3-2
isPlaying: 1
Card Rem
enter Pause
timer started
isPlaying: 0
Card Ins
CardData: 13 37 b3 47 02 00 0b 00 00 

toggle endless from 0

play adv: 326
isPlaying: 1

isPlaying: 0
isPlaying: 1
isPlaying: 0
Card Rem
Card Ins
CardData: 13 37 b3 47 02 03 0a 03 08 
enter StartPlay
enqueue mp3 262 0
play mp3 262

isPlaying: 1
isPlaying: 0
Track end: 531
Track end: 531
2 tr in folder 3
enqueue 3-1 2  
play 3-2
isPlaying: 1
enter Play
timer stopped
isPlaying: 0
Track end: 661
enter Idle
timer started

Card Rem
Card Ins
CardData: 13 37 b3 47 02 03 0a 03 08 
enter StartPlay
enqueue mp3 262 0
play mp3 262

isPlaying: 1
isPlaying: 0
Track end: 531
Track end: 531
2 tr in folder 3
enqueue 3-1 2  
play 3-1
isPlaying: 1
enter Play
timer stopped

isPlaying: 0
Track end: 660
play 3-2

isPlaying: 1
isPlaying: 0
Track end: 661
enter Idle
timer started
Card Rem
Card Ins
CardData: 13 37 b3 47 02 03 0a 03 08 
enter StartPlay
enqueue mp3 262 0
play mp3 262
isPlaying: 1
isPlaying: 0
Track end: 531
Track end: 531
2 tr in folder 3
enqueue 3-1 2  
play 3-1
isPlaying: 1
enter Play
timer stopped
Card Rem
enter Pause
timer started
isPlaying: 0
Card Ins
CardData: 13 37 b3 47 02 00 0b 00 00 

toggle endless from 0

play adv: 326
isPlaying: 1

isPlaying: 0
isPlaying: 1
isPlaying: 0
Card Rem
Card Ins
CardData: 13 37 b3 47 02 03 0a 03 08 
enter Play
timer stopped
isPlaying: 1
isPlaying: 0
Track end: 660
play 3-2
isPlaying: 1
isPlaying: 0
Track end: 661
play 3-1
isPlaying: 1
isPlaying: 0
Track end: 660
play 3-2
isPlaying: 1
isPlaying: 0
Track end: 661
enter Idle
timer started

Log mit „alter“ SD

@~~|

 _____         _____ _____ _____ _____ 
|_   _|___ ___|  |  |     |   | |     |
  | | | . |   |  |  |-   -| | | |  |  |

  |_| |___|_|_|_____|_____|_|___|_____|
TonUINO Version 3.x - refactored by Boerge1

created by Thorsten Voß and licensed under GNU/GPL.
Information and contribution at https://tonuino.de.

V3.3.3 06.05.26
C 3
Ver:2
Vol:25 1 10 25 5 15
EQ:1
ST:5
IB:1
AL:0
AP:1111
PCR:1
MFRC522:178

Volume: 10

track_count: 3522
enter Idle
timer started
btn/cmd: start/start

enqueue mp3 262 0

play mp3 262
isPlaying: 1
isPlaying: 0
Track end: 3396
Track end: 3396
Card Ins
CardData: 13 37 b3 47 02 25 05 00 00 
enter StartPlay
enqueue mp3 262 0
play mp3 262

isPlaying: 1
isPlaying: 0
Track end: 3396
Track end: 3396
30 tr in folder 37
enqueue 37-1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30  
play 37-25

isPlaying: 1
enter Play
timer stopped
Card Rem
enter Pause
timer started
isPlaying: 0
Card Ins
CardData: 13 37 b3 47 02 00 0b 00 00 

toggle endless from 0

play adv: 326
isPlaying: 1
isPlaying: 0
isPlaying: 1
isPlaying: 0
Card Rem
Card Ins
MIFARE_Read  failed: 7
Card Rem
Card Ins
CardData: 13 37 b3 47 02 25 05 00 00 

enter Play
timer stopped
isPlaying: 1
isPlaying: 0
Track end: 3140
play 37-26
isPlaying: 1
Card Rem
enter Pause
timer started
isPlaying: 0
Card Ins
CardData: 13 37 b3 47 02 00 0b 00 00 

toggle endless from 1

play adv: 325
isPlaying: 1

isPlaying: 0
isPlaying: 1
isPlaying: 0
Card Rem
Card Ins
CardData: 13 37 b3 47 02 25 05 00 00 
enter Play
timer stopped
isPlaying: 1
isPlaying: 0
Track end: 3139
play 37-27
isPlaying: 1
Card Rem
enter Pause
timer started
isPlaying: 0

Generell: Bei mir muss die Karte vom immer aufliegen, damit die Box etwas abspielt.

Habe 3 Buttons, hier noch meine constants.hpp

#ifndef SRC_CONSTANTS_HPP_
#define SRC_CONSTANTS_HPP_

#include <Arduino.h>

// ######################################################################
// ####### default pins #################################################
// ######################################################################

/* #### Classic/Every/Esp32-Nano ###########################################################
 *                         | A0| A1| A2| A3| A4| A5| A6| A7| D0| D1| D2| D3| D5| D6| D7| D8|
 * ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
 * Com to DF Player        |   |   |   |   |   |   |   |   |RX*|TX*| RX| TX|   |   |   |   |
 * 3 Button                | P | U | D |   |   |   |   |   |   |   |   |   |   |   |   |   |
 * 5 Button                | P | V+| V-| U | D |   |   |   |   |   |   |   |   |   |   |   |
 * 3x3 Button Board        | P | U | D | A |   |   |   |   |   |   |   |   |   |   |   |   |
 * Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |
 * Rotary encoder          |   |   |   |CLK| DT|   |   |   |   |   |   |   |   |   |   |   |
 * Poti                    |   |   |   | x |   |   |   |   |   |   |   |   |   |   |   |   |
 * Neo Ring/LED animat.    |   |   |   |   |   |   |   |   |   |   |(x)|   | x |   |   |   |
 * Speaker off             |   |   |   |   |   |   |   |   |   |   |   |   |   | x |   |   |
 * Shutdown                |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |   |
 * headphone jack detection|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |
 * special start shortcut  |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |
 * bat voltage measurement |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |   |
 * Bluetooth ON/OFF        |   |   |   |   |   |   |   |   |   |   | x*|   |   | x |   |   |
 * Bluetooth Pairing       |   |   |   |   |   |   |   |   |   |   |   | x*|   |   |   | x |
 * Button LED Pins         |   |   |   |   |   | P |   |   |   |   |   |   | D | U |   |   |
 * #########################################################################################
 *
 * (*) Hardware Serial on Every/Esp32-Nano
 */

/* ### AiOplus #########################################################################################
 *                         | A0| A1| A2| A3| A4| A5| A6| A7|D10|D14|D19|D21|D27|D31|D32|D33|D36|D37|A14|
 *                         |   |   |   |   |   |   |   |   |PB2|PC0|PC5|PC7|PD5|PE1|PE2|PE3|PF2|PF3|PF4|
 * ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
 * 3 Button                | P | D | U |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
 * 5 Button                | P | D | U | V-| V+|   |   |   |   |   |   |   |   |   |   |   |   |   |   |
 * 3x3 Button Board        | P |   | A | D | U |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
 * Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |   |   |
 * Rotary encoder          |   |   |   |   |   |   |   |   |   |   |   |   |   |CLK| DT|   |CLK| DT|   |
 * Poti                    |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |
 * Neo Ring/LED animat.    |   |   |   |   |   |   |   |   | x |(x)|   |   |   |   |   |   |   |   |   |
 * Speaker off             |   |   |   |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |
 * Shutdown                |   |   |   |   |   |   |   |   |   |   |   |   | x |   |   |   |   |   |   |
 * headphone jack detection|   |   |   |   |   |   |   |   |   |   |   | x |   |   |   |   |   |   |   |
 * special start shortcut  |   |   |   |   |   |   |   |   |   |   |   |   |   |   |   | x |   |   |   |
 * bat voltage measurement |   |   |   |   |   |   | x |   |   |   |   |   |   |   |   |   |   |   |   |
 * #####################################################################################################
 */

/* ### AiO #################################################################
 *                         | A0| A1| A2| A3| A4| A5| A6| A7| D5| D6| D7| D8|
 * ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+
 * 3 Button                | P | D | U |   |   |   |   |   |   |   |   |   |
 * 5 Button                | P | D | U | V-| V+|   |   |   |   |   |   |   |
 * 3x3 Button Board        | P |   | A | D | U |   |   |   |   |   |   |   |
 * Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |
 * Rotary encoder          |   |   |   |CLK| DT|   |   |   |   |   |   |   |
 * Poti                    |   |   |   | x |   |   |   |   |   |   |   |   |
 * Neo Ring/LED animat.    |   |   |   |   |   |   |   |   | x |   |   |   |
 * Speaker off             |   |   |   |   |   |   |   |   |   |   |   | x |
 * Shutdown                |   |   |   |   |   |   |   |   |   |   | x |   |
 * special start shortcut  |   |   |   |   |   |   | x |   |   |   |   |   |
 * #########################################################################
 */

/* #### Esp32-Wroom32 ##############################################################
 * GPIO                    | 33| 25| 26| 27| 44| 35| 12| 39| 16| 17|  2| 15| 13| 34|
 * Pin                     |D33|D25|D26|D27|D14|D35|D12| VN|RX2|TX2| D2|D15|D13|D34|
 * ------------------------+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
 * Com to DF Player        |   |   |   |   |   |   |   |   | RX| TX|   |   |   |   |
 * 3 Button                | P | U | D |   |   |   |   |   |   |   |   |   |   |   |
 * 5 Button                | P | V+| V-| U | D |   |   |   |   |   |   |   |   |   |
 * 3x3 Button Board        | P | U | D | A |   |   |   |   |   |   |   |   |   |   |
 * Open pin for random     |   |   |   |   |   |   |   | x |   |   |   |   |   |   |
 * Rotary encoder          |   |   |   |CLK| DT|   |   |   |   |   |   |   |   |   |
 * Poti                    |   |   |   | x |   |   |   |   |   |   |   |   |   |   |
 * Neo Ring/LED animat.    |   |   |   |   |   |   |   |   |   |   | x |   |   |   |
 * Speaker off             |   |   |   |   |   |   |   |   |   |   |   | x |   |   |
 * Shutdown                |   |   |   |   |   |   |   |   |   |   |   |   | x |   |
 * headphone jack detection|   |   |   |   |   |   |   |   |   |   |   |   |   | x |
 * special start shortcut  |   |   |   |   |   |   | x |   |   |   |   |   |   |   |
 * bat voltage measurement |   |   |   |   |   | x |   |   |   |   |   |   |   |   |
 * #################################################################################
 */

// ######################################################################
// ####### variant and feature configuration ############################
// ######################################################################

/* Select the right PCB by uncommenting one of the following lines
 * Bitte die passende Platine durch entfernen der Kommentare in einer der folgenden Zeilen auswählen
 */
#define TonUINO_Classic
//#define TonUINO_Every
//#define TonUINO_Every_4808
//#define ALLinONE
//#define ALLinONE_Plus
//#define TonUINO_Esp32 100 // Esp32 Nano
//#define TonUINO_Esp32 200 // Esp32 Wroom 32

#include "gpioHelper.hpp"

#if defined(TonUINO_Classic)
DECL_PCB(1)
#endif
#if defined(TonUINO_Every)
DECL_PCB(2)
#endif
#if defined(TonUINO_Every_4808)
DECL_PCB(3)
#endif
#if defined(ALLinONE)
DECL_PCB(4)
#endif
#if defined(ALLinONE_Plus)
DECL_PCB(5)
#endif
#if defined(TonUINO_Esp32)
DECL_PCB(6)
#endif
static_assert(SUM_PCB == 1 , "Please uncomment exactly one of the PCB lines (TonUINO_Classic, TonUINO_Every, etc.). Bitte genau eine der Zeilen zur Definition einer Platine einkommentieren (TonUINO_Classic, TonUINO_Every, etc.).");

// ######################################################################

/* uncomment one of the below lines to enable special button support
 * um die Tasten zu konfigurieren, bitte eine der nächsten Zeilen auskommentieren
 * default: THREEBUTTONS for classic/every
 *          FIVEBUTTONS  for AiO and AiO+
 */
#define THREEBUTTONS
//#define FIVEBUTTONS
//#define BUTTONS3X3

// ######################################################################

/* If using Nano Every with connected DfPlayer Rx/Tx to D0/D1 uncomment the following lines
 * Wenn der Nano Every verwendet wird und Rx/Tx vom DfPlayer mit D0/D1 verbunden ist, den Kommentare der folgenden Zeile entfernen
 */
//#define DFPlayerUsesHardwareSerial

// ######################################################################

/* uncomment the below line to enable serial input as additional command source
 * um den Serial Monitor als zusätzliche Kommandoquelle zu haben bitte in der nächste Zeile den Kommentar entfernen
 * -7:             -8: up         -9: upLong
 * -4: allLong     -5: pause      -6: pauseLong
 * -1: up/downLong -2: down       -3: downLong
 * number n > 0: Springe im Voice Menü zum n-ten Eintrag und selektiere ihn
 */
//#define SerialInputAsCommand

// ######################################################################

/* uncomment one of the below lines to support a special chip on the DfMiniMp3 player
 * um einen speziellen Chip auf dem DfMiniMp3 Player zu ünterstützen bitte in eine der nächste Zeilen den Kommentar entfernen
 *
 * GD3200B:     bad behavior of getFolderTrackCount() - ignores the parameter folder
 *              bad behavior of callback OnPlayFinished - it is also called on advertise tracks
 * MH2024K16SS: no checksums
 * LISP3:       bad behavior of callback OnPlayFinished - it is also called on advertise tracks
 * MP3-TF-16P V3.0 with MH2024K24SS:
 *              very slow
 *              bad behavior of callback OnPlayFinished - it is also called on advertise tracks
 * LKP Player:  no ACK for requests (use Mp3ChipIncongruousNoAck for them)
 */
//#define DFMiniMp3_T_CHIP_GD3200B
//#define DFMiniMp3_T_CHIP_MH2024K16SS
//#define DFMiniMp3_T_CHIP_LISP3
//#define DFMiniMp3_T_CHIP_MH2024K24SS_MP3_TF_16P_V3_0
#define DFMiniMp3_T_CHIP_Mp3ChipIncongruousNoAck

// ######################################################################

/* uncomment the below line to disable shutdown via button (long press play/pause)
 * um ein Shutdown via Taste (long press Play/Pause) zu unterdrücken bitte in der nächste Zeile den Kommentar entfernen
 */
//#define DISABLE_SHUTDOWN_VIA_BUTTON

// ######################################################################

/* uncomment the below line to enable the rotary encoder for volume setting
 * um den Drehgeber zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
 */
//#define ROTARY_ENCODER
/* uncomment the below line to enable the rotary encoder also for next and previous (only one click in one second)
 * um den Drehgeber auch für vor und zurück zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
 */
//#define ROTARY_ENCODER_LONGPRESS

#ifdef ROTARY_ENCODER
#ifdef ALLinONE_Plus
// if using Rotary Encoder Buchse
//inline constexpr uint8_t   rotaryEncoderClkPin    = 31; // PE1
//inline constexpr uint8_t   rotaryEncoderDtPin     = 32; // PE2

// if using Opt Leiste (Male)
inline constexpr uint8_t   rotaryEncoderClkPin    = 36; // PF2
inline constexpr uint8_t   rotaryEncoderDtPin     = 37; // PF3

#elif TonUINO_Esp32 == 200
inline constexpr uint8_t   rotaryEncoderClkPin    = 27; // (D27)
inline constexpr uint8_t   rotaryEncoderDtPin     = 14; // (D14)

#else
inline constexpr uint8_t   rotaryEncoderClkPin    = A3; // A3
inline constexpr uint8_t   rotaryEncoderDtPin     = A4; // A4
#endif // ALLinONE_Plus

inline constexpr uint8_t   rotaryEncoderDebounce  = 75; // ms
inline constexpr bool      rotaryEncoderPullUp    = false;
#endif // ROTARY_ENCODER

// ######################################################################

/* uncomment the below line to enable the poti for volume setting
 * um den Poti zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
 */
//#define POTI

#ifdef POTI
#ifdef ALLinONE_Plus
inline constexpr uint8_t   potiPin    = A14; // AiO+ PF4

#elif TonUINO_Esp32 == 200
inline constexpr uint8_t   potiPin    = 27 ; // (D27)

#else
inline constexpr uint8_t   potiPin    = A3 ; // AiO/Classic A3
#endif // ALLinONE_Plus
#endif // POTI

// ######################################################################

/* uncomment the below line to enable the neo ring
 * To have more features (show volume setting) uncomment also NEO_RING_EXT
 * um den Neo Ring zu unterstützen bitte in der nächste Zeile den Kommentar entfernen
 * um weitere Features einzuschalten, auch den Kommentar für NEO_RING_EXT entfernen
 */
//#define NEO_RING
//#define NEO_RING_EXT
//#define NEO_RING_2

#ifdef NEO_RING
#ifdef ALLinONE_Plus
inline constexpr uint8_t neoPixelRingPin = 10; // PB2 on AiOplus (Erweiterungsleiste (Female))

#elif TonUINO_Esp32 == 200
inline constexpr uint8_t neoPixelRingPin =  2; // GPIO02 (D2) on ESP32 Wroom 32

#else
inline constexpr uint8_t neoPixelRingPin = D5; // D5 on AiO/Classic
#endif // ALLinONE_Plus

inline constexpr uint8_t neoPixelNumber  = 24; // Total Number of Pixels

#ifdef NEO_RING_2
#ifdef ALLinONE_Plus
inline constexpr uint8_t neoPixelRingPin2= 14; // PC0 on AiOplus (Erweiterungsleiste (Female))

#else
inline constexpr uint8_t neoPixelRingPin2= D2; // D2 on AiO/Classic (only Every)
#endif // ALLinONE_Plus
inline constexpr uint8_t neoPixelNumber2 = 24; // Total Number of Pixels
#endif // NEO_RING_2

#endif // NEO_RING

// ######################################################################

/* uncomment the below line to enable the Speaker on/off for Classic to suppress noise
 * on startup and shutdown (automatically enabled on AiO and AiOplus)
 * um den Lautsprecher ein/aus Schalter für die Classic Variante zu unterstützen bitte
 * in der nächste Zeile den Kommentar entfernen (zur Unterdrückung der Ein- und Ausschaltgeräusche)
 * (automatisch eingeschaltet für AiO und AiOplus)
 */
//#define SPKONOFF

#ifdef SPKONOFF
#if not defined(ALLinONE_Plus) and not defined(ALLinONE) and not (TonUINO_Esp32 == 200)
inline constexpr uint8_t       ampEnablePin     = D6;
inline constexpr levelType     ampEnablePinType = levelType::activeHigh;

#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t       ampEnablePin     = 15; // (D15)
inline constexpr levelType     ampEnablePinType = levelType::activeLow;
#endif
#endif // SPKONOFF

// ######################################################################

/* uncomment the below line to enable the Headphone Jack detection (automatically enabled on AiOplus)
 * um die Kopfhörer Erkennung einzuschalten bitte in der nächste Zeile den Kommentar entfernen
 * (automatisch eingeschaltet für AiOplus)
 */
//#define HPJACKDETECT

#ifdef HPJACKDETECT
#if not defined(ALLinONE_Plus)  and not (TonUINO_Esp32 == 200)
inline constexpr uint8_t       dfPlayer_noHeadphoneJackDetect     = D8;
inline constexpr levelType     dfPlayer_noHeadphoneJackDetectType = levelType::activeLow;

#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t        dfPlayer_noHeadphoneJackDetect     = 34; // (D34)
inline constexpr levelType      dfPlayer_noHeadphoneJackDetectType = levelType::activeLow;
#endif
#endif // HPJACKDETECT

// ######################################################################

/* uncomment the below line to ignore the RFID if it is already playing
 * um die selbe RFID zu ignorieren, wenn die bereits spielt, in der nächste
 * Zeile den Kommentar entfernen
 */
//#define DONT_ACCEPT_SAME_RFID_TWICE

/* uncomment the below line to resume playback if the RFID that started the
 * playback is detected again
 * um die Wiedergabe fortzusetzen, wenn die selbe RFID erkannt wird, die bereits
 * abgespielt wird, in der nächste Zeile den Kommentar entfernen
 */
//#define RESUME_ON_SAME_RFID

/* uncomment the below line to replay the last card or short cut if pressed play/pause
 * in Idle state
 * um die letzte Karte oder den letzten Short Cut wieder abzuspielen, wenn die Play/Pause Taste
 * im Idle State gedrückt wird, in der nächste Zeile den Kommentar entfernen
 */
//#define REPLAY_ON_PLAY_BUTTON

// ######################################################################

/* uncomment the below line(s) to enable the quiz, memory teapot game
 * um das Quiz, Memory oder Teekesselchen Spiel zu aktivieren, in der nächste Zeile(n) den Kommentar entfernen
 */
//#define QUIZ_GAME
//#define MEMORY_GAME
//#define TEAPOT_GAME

// ######################################################################

/* uncomment the below line to store the last played card in EEPROM
 * um die letzte Karte im EEPROM zu speichern, in der nächste Zeile den Kommentar entfernen
 */
#define STORE_LAST_CARD

// ######################################################################

/* uncomment the below line to enable special shortcut on startup via GPIO
 * um den spezial Shortcut beim Start via GPIO zu aktivieren, in der nächste Zeile den Kommentar entfernen
 */
//#define SPECIAL_START_SHORTCUT

#ifdef SPECIAL_START_SHORTCUT
#ifdef ALLinONE_Plus
inline constexpr uint8_t   specialStartShortcutPin     = 33; // PE3

#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t   specialStartShortcutPin     = 12; // D12

#else
inline constexpr uint8_t   specialStartShortcutPin     = A6; // A6 on AiO/Classic
#endif // ALLinONE_Plus

inline constexpr levelType specialStartShortcutPinType = levelType::activeHigh;
inline constexpr uint8_t   specialStartShortcutFolder  = 1;
inline constexpr uint8_t   specialStartShortcutTrack   = 1;
#endif // SPECIAL_START_SHORTCUT

// ######################################################################

/* uncomment the below line to enable support for BT module
 * um die Unterstützung des BT Modules zu aktivieren, in der nächste Zeile den Kommentar entfernen
 */
//#define BT_MODULE

#ifdef BT_MODULE
#ifdef DFPlayerUsesHardwareSerial
inline constexpr uint8_t   btModuleOnPin               =  D2; // D2
inline constexpr uint8_t   btModulePairingPin          =  D3; // D3

#else
inline constexpr uint8_t   btModuleOnPin               =  D6; // D6
inline constexpr uint8_t   btModulePairingPin          =  D8; // D8
#endif

inline constexpr levelType btModuleOnPinType           = levelType::activeHigh;
inline constexpr levelType btModulePairingPinType      = levelType::activeHigh;
inline constexpr unsigned long btModulePairingPulse    = 500;
#endif // BT_MODULE

// ######################################################################

/* uncomment the below line to enable battery voltage measurement (not for ALLinONE, not recommended for TonUINO_Classic)
 * um die Batterie Spannungsmessung zu aktivieren, in der nächste Zeile den Kommentar entfernen
 * (nicht für ALLinONE, nicht empfohlen für TonUINO_Classic)
 */
//#define BAT_VOLTAGE_MEASUREMENT

#ifdef BAT_VOLTAGE_MEASUREMENT
#if not defined(ALLinONE_Plus) and not defined(ALLinONE) and not (TonUINO_Esp32 == 200)
inline constexpr uint8_t voltageMeasurementPin         = A5;

#elif (TonUINO_Esp32 == 200)
inline constexpr uint8_t voltageMeasurementPin         = 35; // (D35)
#endif // ALLinONE_Plus

#ifdef ALLinONE_Plus
inline constexpr float   voltageMeasurementCorrection  = 2.075; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Classic
inline constexpr float   voltageMeasurementCorrection  = 1.960; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Every
inline constexpr float   voltageMeasurementCorrection  = 2.007; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Every_4808
inline constexpr float   voltageMeasurementCorrection  = 2.007; // Spannungsteiler 100k/100k
#endif
#ifdef TonUINO_Esp32
inline constexpr float   voltageMeasurementCorrection  = 0.710; // Spannungsteiler 100k/100k
#endif

// for Li-Ion
inline constexpr float   batVoltageLow                 = 2.95;
inline constexpr float   batVoltageEmpty               = 2.90;
// for Li-PO
//inline constexpr float   batVoltageLow                 = 3.40;
//inline constexpr float   batVoltageEmpty               = 3.20;
#endif // BAT_VOLTAGE_MEASUREMENT

// ######################################################################

/* uncomment the below lines if you use Pololu Powerswitch or Traeger Platine for shutdown
 * wenn der Pololu Powerswitch oder die Traeger Platine für das Shutdown verwendet wird, in den nächsten Zeile den Kommentar entfernen
 */
#define USE_POLOLU_SHUTDOWN
//#define USE_TRAEGER_PLATINE_SHUTDOWN

// ######################################################################

/* uncomment one of the below lines if you want to change the antenna gain of the MFRC522 module
 * wenn die Antennenverstärkung des MFRC522 Modules verändert werden soll, in der nächsten Zeilen einen Kommentar entfernen
 */
//#define MRFC522_RX_GAIN RxGain_18dB
//#define MRFC522_RX_GAIN RxGain_23dB
//#define MRFC522_RX_GAIN RxGain_33dB // default
//#define MRFC522_RX_GAIN RxGain_38dB
//#define MRFC522_RX_GAIN RxGain_43dB
//#define MRFC522_RX_GAIN RxGain_48dB
//#define MRFC522_RX_GAIN RxGain_min  // 18dB
//#define MRFC522_RX_GAIN RxGain_avg  // 33dB
//#define MRFC522_RX_GAIN RxGain_max  // 48dB

// ######################################################################

/* uncomment the below lines if you want to have the Jukebox modification card
 * wenn du die Jukebox haben willst, in den nächsten Zeile den Kommentar entfernen
 */
//#define MODIFICATION_CARD_JUKEBOX

#ifdef MODIFICATION_CARD_JUKEBOX
inline constexpr uint8_t jukebox_max_cards  = 10;
#endif

// ######################################################################

/* uncomment the below lines if you want to have the Pause after Track modification card
 * wenn du die Pause nach jedem Track Modifikationskarte haben willst, in den nächsten Zeile den Kommentar entfernen
 */
//#define MODIFICATION_CARD_PAUSE_AFTER_TRACK

// ######################################################################

/* Enable this definition to activate animated LED button support via the LedManager.
 *
 * LED behavior:
 * - Startup:        All LEDs blink one after another.
 * - Awaiting input: All LEDs blink synchronously.
 * - Playing:        All LEDs stay on continuously.
 * - Paused:         Only the Play/Pause LED blinks.
 * - Shutdown:       All LEDs are turned off.
 * - On a valid button press, all LEDs blink once by toggling their current state.
 *
 * Use a series resistor (e.g. 1KΩ) per LED to limit current.
 *
 * ----------------------------------------------------------------------
 *
 * Nachfolgenden Kommentar entfernen, um animierte LED-Tasten über den LedManager zu nutzen.
 *
 * LED-Verhalten:
 * - Beim Start:          Alle LEDs blinken nacheinander.
 * - Wartet auf Eingabe:  Alle LEDs blinken synchron.
 * - Wiedergabe läuft:    Alle LEDs leuchten dauerhaft.
 * - Wiedergabe pausiert: Nur die Play/Pause-LED blinkt.
 * - Abschaltung:         Alle LEDs werden ausgeschalten.
 * - Bei einem gültigen Tastendruck blinken alle LEDs einmal, indem ihr aktueller Zustand invertiert wird.
 *
 * Verwende einen Widerstand (z.B. 1KΩ) in Reihe zu jeder LED zur Strombegrenzung.
 */

//#define USE_LED_BUTTONS

#ifdef USE_LED_BUTTONS
inline constexpr uint8_t led_play_pin = A5;
inline constexpr uint8_t led_up_pin   = D6;
inline constexpr uint8_t led_down_pin = D5;

inline constexpr unsigned long led_update_interval = 800; // ms
inline constexpr unsigned long led_short_blink     = 400; // ms
#endif // USE_LED_BUTTONS

//#define POWER_HOLD_READY

#ifdef POWER_HOLD_READY
inline constexpr uint8_t power_hold_ready_pin        = D2;
inline constexpr levelType power_hold_ready_pin_type = levelType::activeHigh;
#endif

/* #################################################################################################
 * ##### normally, you don't have to edit lines below                   ############################
 * ##### mormalerweise müssen die folgende Zeilen nicht editiert werden ############################
 * #################################################################################################
 */

// ####### rules for buttons ############################

inline constexpr uint8_t lastSortCut         =  24;
#ifdef BUTTONS3X3
#ifdef FIVEBUTTONS
static_assert(false, "The 3x3 Button board doesn't have 5 Buttons");
#endif
inline constexpr uint8_t buttonExtSC_begin   = 101;
inline constexpr uint8_t buttonExtSC_buttons =  18; // <= lastSortCut
#endif // BUTTONS3X3

inline constexpr uint32_t  buttonLongPress       = 1000; // timeout for long press button in ms
inline constexpr uint32_t  buttonLongPressRepeat =  200; // timeout for long press button repeat in ms

/***************************************************************************
 ** Classic ****************************************************************
 ***************************************************************************/

#if defined(TonUINO_Classic) or defined(TonUINO_Every) or defined(TonUINO_Every_4808)
// ####### buttons #####################################

inline constexpr uint8_t   buttonPausePin  = A0;

#if defined(BUTTONS3X3)
inline constexpr uint8_t   button3x3Pin    = A3;
inline constexpr uint8_t   buttonUpPin     = A1;
inline constexpr uint8_t   buttonDownPin   = A2;
inline constexpr uint32_t  button3x3DbTime = 50; // Debounce time in milliseconds (default 50ms)
#elif defined(FIVEBUTTONS)
inline constexpr uint8_t   buttonUpPin     = A3;
inline constexpr uint8_t   buttonDownPin   = A4;
inline constexpr uint8_t   buttonFourPin   = A1;
inline constexpr uint8_t   buttonFivePin   = A2;
#else
inline constexpr uint8_t   buttonUpPin     = A1;
inline constexpr uint8_t   buttonDownPin   = A2;
#endif

inline constexpr levelType buttonPinType   = levelType::activeLow;
inline constexpr uint32_t  buttonDbTime    = 25; // Debounce time in milliseconds (default 25ms)

// ####### chip_card ###################################

inline constexpr uint32_t cardCookie      = 0x1337b347;
inline constexpr uint8_t  cardVersion     = 0x02;
inline constexpr byte     mfrc522_RSTPin  =  9;
inline constexpr byte     mfrc522_SSPin   = 10;
inline constexpr uint8_t  cardRemoveDelay =  3;

// ####### mp3 #########################################

#ifdef DFPlayerUsesHardwareSerial
inline constexpr HardwareSerial &dfPlayer_serial         = Serial1; // D0 RX, D1 TX (Every)
#else
inline constexpr uint8_t       dfPlayer_receivePin      = 2;
inline constexpr uint8_t       dfPlayer_transmitPin     = 3;
#endif

inline constexpr uint8_t       maxTracksInFolder        = 255;
inline constexpr uint8_t       dfPlayer_busyPin         = 4;
inline constexpr levelType     dfPlayer_busyPinType     = levelType::activeLow;
#if defined(DFMiniMp3_T_CHIP_MH2024K24SS_MP3_TF_16P_V3_0)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;
#elif defined(DFMiniMp3_T_CHIP_GD3200B)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;
#else
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1200;
#endif

// ####### tonuino #####################################

inline constexpr uint8_t       shutdownPin      = 7;
#ifdef USE_TRAEGER_PLATINE_SHUTDOWN
inline constexpr levelType     shutdownPinType  = levelType::activeLow;
#else
inline constexpr levelType     shutdownPinType  = levelType::activeHigh;
#endif
inline constexpr uint8_t       openAnalogPin    = A7;
inline constexpr unsigned long cycleTime        = 50;
#endif /* TonUINO_Classic or TonUINO_Every or TonUINO_Every_4808 */

/***************************************************************************
 ** AiO plus ***************************************************************
 ***************************************************************************/

#ifdef ALLinONE_Plus
// ####### buttons #####################################

#if not defined(THREEBUTTONS) and not defined(BUTTONS3X3)
#define FIVEBUTTONS
#endif

#define SPKONOFF
#define HPJACKDETECT

inline constexpr uint8_t   buttonPausePin  = A0;

#ifdef BUTTONS3X3
inline constexpr uint8_t   button3x3Pin    = A2;
inline constexpr uint8_t   buttonUpPin     = A4;
inline constexpr uint8_t   buttonDownPin   = A3;
inline constexpr uint32_t  button3x3DbTime = 50; // Debounce time in milliseconds (default 50ms)
#else
inline constexpr uint8_t   buttonUpPin     = A2;
inline constexpr uint8_t   buttonDownPin   = A1;
#endif

#ifdef FIVEBUTTONS
inline constexpr uint8_t   buttonFourPin   = A4;
inline constexpr uint8_t   buttonFivePin   = A3;
#endif

inline constexpr levelType buttonPinType   = levelType::activeLow;
inline constexpr uint32_t  buttonDbTime    = 25; // Debounce time in milliseconds (default 25ms)

// ####### chip_card ###################################

inline constexpr uint32_t cardCookie      = 0x1337b347;
inline constexpr uint8_t  cardVersion     = 0x02;
inline constexpr byte     mfrc522_RSTPin  = 11;
inline constexpr byte     mfrc522_SSPin   =  7;
inline constexpr uint8_t  cardRemoveDelay =  3;

// ####### mp3 #########################################

#define DFPlayerUsesHardwareSerial
inline constexpr HardwareSerial &dfPlayer_serial         = Serial3;

inline constexpr uint8_t        maxTracksInFolder        = 255;
inline constexpr uint8_t        dfPlayer_busyPin         = 13;
inline constexpr levelType      dfPlayer_busyPinType     = levelType::activeLow;
inline constexpr unsigned long  dfPlayer_timeUntilStarts = 1200;
inline constexpr uint8_t        dfPlayer_noHeadphoneJackDetect     = 21;
inline constexpr levelType      dfPlayer_noHeadphoneJackDetectType = levelType::activeLow;

// ####### tonuino #####################################

inline constexpr uint8_t       shutdownPin           = 27;
inline constexpr levelType     shutdownPinType       = levelType::activeLow;
inline constexpr uint8_t       ampEnablePin          = 19;
inline constexpr levelType     ampEnablePinType      = levelType::activeLow;
inline constexpr uint8_t       usbAccessPin          = 20;
inline constexpr levelType     usbAccessPinType      = levelType::activeHigh;
inline constexpr uint8_t       voltageMeasurementPin = A6;
inline constexpr uint8_t       openAnalogPin         = A7;
inline constexpr unsigned long cycleTime             = 50;
#endif /* ALLinONE_Plus */

/***************************************************************************
 ** AiO ********************************************************************
 ***************************************************************************/

#ifdef ALLinONE
// ####### buttons #####################################

#if not defined(THREEBUTTONS) and not defined(BUTTONS3X3)
#define FIVEBUTTONS
#endif

#define SPKONOFF

inline constexpr uint8_t   buttonPausePin  = A0;

#ifdef BUTTONS3X3
inline constexpr uint8_t   button3x3Pin    = A2;
inline constexpr uint8_t   buttonUpPin     = A4;
inline constexpr uint8_t   buttonDownPin   = A3;
inline constexpr uint32_t  button3x3DbTime = 50; // Debounce time in milliseconds (default 50ms)
#else
inline constexpr uint8_t   buttonUpPin     = A2;
inline constexpr uint8_t   buttonDownPin   = A1;
#endif

#ifdef FIVEBUTTONS
inline constexpr uint8_t   buttonFourPin   = A4;
inline constexpr uint8_t   buttonFivePin   = A3;
#endif

inline constexpr levelType buttonPinType   = levelType::activeLow;
inline constexpr uint32_t  buttonDbTime    = 25; // Debounce time in milliseconds (default 25ms)

// ####### chip_card ###################################

inline constexpr uint32_t cardCookie      = 0x1337b347;
inline constexpr uint8_t  cardVersion     = 0x02;
inline constexpr byte     mfrc522_RSTPin  =  9;
inline constexpr byte     mfrc522_SSPin   = 10;
inline constexpr uint8_t  cardRemoveDelay =  3;

// ####### mp3 #########################################

inline constexpr uint8_t       dfPlayer_receivePin      = 2;
inline constexpr uint8_t       dfPlayer_transmitPin     = 3;

inline constexpr uint8_t       maxTracksInFolder        = 255;
inline constexpr uint8_t       dfPlayer_busyPin         = 4;
inline constexpr levelType     dfPlayer_busyPinType     = levelType::activeLow;
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1200;

// ####### tonuino #####################################

inline constexpr uint8_t       shutdownPin      = 7;
inline constexpr levelType     shutdownPinType  = levelType::activeLow;
inline constexpr uint8_t       ampEnablePin     = 8;
inline constexpr levelType     ampEnablePinType = levelType::activeLow;
inline constexpr uint8_t       usbAccessPin     = A5;
inline constexpr levelType     usbAccessPinType = levelType::activeHigh;
inline constexpr uint8_t       openAnalogPin    = A7;
inline constexpr unsigned long cycleTime        = 50;
#endif /* ALLinONE */

/***************************************************************************
 ** Esp32 ******************************************************************
 ***************************************************************************/

#if defined(TonUINO_Esp32)

/***************************************************************************
 ** Esp32 Nano *************************************************************
 ***************************************************************************/

#if TonUINO_Esp32 == 100
// ####### buttons #####################################

inline constexpr uint8_t   buttonPausePin  = A0;

#if defined(BUTTONS3X3)
inline constexpr uint8_t   button3x3Pin    = A3;
inline constexpr uint8_t   buttonUpPin     = A1;
inline constexpr uint8_t   buttonDownPin   = A2;
inline constexpr uint32_t  button3x3DbTime = 50; // Debounce time in milliseconds (default 50ms)
#elif defined(FIVEBUTTONS)
inline constexpr uint8_t   buttonUpPin     = A3;
inline constexpr uint8_t   buttonDownPin   = A4;
inline constexpr uint8_t   buttonFourPin   = A1;
inline constexpr uint8_t   buttonFivePin   = A2;
#else
inline constexpr uint8_t   buttonUpPin     = A1;
inline constexpr uint8_t   buttonDownPin   = A2;
#endif

inline constexpr levelType buttonPinType   = levelType::activeLow;
inline constexpr uint32_t  buttonDbTime    = 25; // Debounce time in milliseconds (default 25ms)

// ####### chip_card ###################################

inline constexpr uint32_t cardCookie      = 0x1337b347;
inline constexpr uint8_t  cardVersion     = 0x02;
inline constexpr byte     mfrc522_RSTPin  =  D9;
inline constexpr byte     mfrc522_SSPin   = D10;
inline constexpr uint8_t  cardRemoveDelay =   3;

// ####### mp3 #########################################

#ifdef DFPlayerUsesHardwareSerial
inline constexpr HardwareSerial &dfPlayer_serial         = Serial0; // D0 RX, D1 TX (Esp32)
#else
inline constexpr uint8_t       dfPlayer_receivePin      = D2;
inline constexpr uint8_t       dfPlayer_transmitPin     = D3;
#endif

inline constexpr uint8_t       maxTracksInFolder        = 255;
inline constexpr uint8_t       dfPlayer_busyPin         = D4;
inline constexpr levelType     dfPlayer_busyPinType     = levelType::activeLow;
#if defined(DFMiniMp3_T_CHIP_MH2024K24SS_MP3_TF_16P_V3_0)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;
#elif defined(DFMiniMp3_T_CHIP_GD3200B)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;
#else
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1200;
#endif

// ####### tonuino #####################################

inline constexpr uint8_t       shutdownPin      = D7;
#ifdef USE_TRAEGER_PLATINE_SHUTDOWN
inline constexpr levelType     shutdownPinType  = levelType::activeLow;
#else
inline constexpr levelType     shutdownPinType  = levelType::activeHigh;
#endif
inline constexpr uint8_t       openAnalogPin    = A7;
inline constexpr unsigned long cycleTime        = 50;


/***************************************************************************
 ** Esp32-Core Development Board *******************************************
 ***************************************************************************/

#elif TonUINO_Esp32 == 200
// ####### buttons #####################################

inline constexpr uint8_t   buttonPausePin  = 33; // (D33)

#if defined(BUTTONS3X3)
inline constexpr uint8_t   button3x3Pin    = 27; // ADC2_7(D27)
inline constexpr uint8_t   buttonUpPin     = 25; // (D25)
inline constexpr uint8_t   buttonDownPin   = 26; // (D26)
inline constexpr uint32_t  button3x3DbTime = 50; // Debounce time in milliseconds (default 50ms)
#elif defined(FIVEBUTTONS)
inline constexpr uint8_t   buttonUpPin     = 27; // (D27)
inline constexpr uint8_t   buttonDownPin   = 14; // (D14)
inline constexpr uint8_t   buttonFourPin   = 25; // (D25)
inline constexpr uint8_t   buttonFivePin   = 26; // (D26)
#else
inline constexpr uint8_t   buttonUpPin     = 25; // (D25)
inline constexpr uint8_t   buttonDownPin   = 26; // (D26)
#endif

inline constexpr levelType buttonPinType   = levelType::activeLow;
inline constexpr uint32_t  buttonDbTime    = 25; // Debounce time in milliseconds (default 25ms)

// ####### chip_card ###################################

inline constexpr uint32_t cardCookie      = 0x1337b347;
inline constexpr uint8_t  cardVersion     = 0x02;
inline constexpr byte     mfrc522_RSTPin  =  22; // (D22)
inline constexpr byte     mfrc522_SSPin   =   5; // (D5)
inline constexpr uint8_t  cardRemoveDelay =   3;

// ####### mp3 #########################################

#ifdef DFPlayerUsesHardwareSerial
inline constexpr HardwareSerial &dfPlayer_serial         = Serial2; // GPIO16 (6) RX, GPIO17 (7) TX (Esp32 Wroom)
#else
inline constexpr uint8_t       dfPlayer_receivePin      =  16; // (RX2)
inline constexpr uint8_t       dfPlayer_transmitPin     =  17; // (TX2)
#endif

inline constexpr uint8_t       maxTracksInFolder        = 255;
inline constexpr uint8_t       dfPlayer_busyPin         =   4; // (D4)
inline constexpr levelType     dfPlayer_busyPinType     = levelType::activeLow;
#if defined(DFMiniMp3_T_CHIP_MH2024K24SS_MP3_TF_16P_V3_0)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;
#elif defined(DFMiniMp3_T_CHIP_GD3200B)
inline constexpr unsigned long dfPlayer_timeUntilStarts = 2500;
#else
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1200;
#endif

// ####### tonuino #####################################

inline constexpr uint8_t       shutdownPin      = 13; // (D13)
#ifdef USE_POLOLU_SHUTDOWN
inline constexpr levelType     shutdownPinType  = levelType::activeHigh;
#else
inline constexpr levelType     shutdownPinType  = levelType::activeLow;
#endif
inline constexpr uint8_t       openAnalogPin    = 39; // (VN)
inline constexpr unsigned long cycleTime        = 50;

#else //  TonUINO_Esp32 == *
static_assert(false, "Not supported Esp32 HW type");
#endif  //  TonUINO_Esp32 == *

#endif /* TonUINO_Esp32 */


// ####### some helper fuctions #####################################

template <typename T> void PROGMEM_read(const T * sce, T& dest)
{
  memcpy_P (&dest, sce, sizeof (T));
}



#endif /* SRC_CONSTANTS_HPP_ */

Wenn eine Modifikationskarte aufgelegt wird, ohne dass eine Wiedergabe läuft, wendet @Boerge1 einen Trick an, um den Ansage - Advert-Track abspielen zu können. Der Trick ist ein kurzes Anspielen von 001.mp3 aus dem Ordner 01.
Im Idealfall ist dieses Anspielen nicht hörbar. Bei einigen Playern kommt es jedoch zu Timing Problemen, so dass die ersten Takte hörbar werden

Die Error Codes 6 und 7 im Log für die Test-SD-Karte könnte darauf hinweisen, dass im Ordner 01 keine abspielbare Datei 001.mp3 vorhanden ist oder ein allgemeines Formatierungsproblem mit der Karte besteht.
Hast Du alle Hinweise aus „Befüllen der SD-Karte“ beachtet?

Zu den anderen Punkten müssen wir die Analyse von @Boerge1 abwarten.

Wie du oben in den Anforderungen beschrieben hast, endet der Endlos Zustand, wenn eine neue Abspielkarte aufgelegt wird. Also musst du die neue Modifikationskarte auflegen, wenn schon etwas abgespielt wird (oder Pause ist).

In der Praxis habe ich festegstellt, dass der aktuelle Workflow beim Ins-Bett-Bringen etwas unpraktisch ist: Erst die Hörbuchkarte, dann die Modifikationskarte und anschliessend nochmal die Hörbuchkarte aufzulegen, ist im Halbdunkeln ein Handgriff zu viel.

Viel intuitiver wäre folgender Ablauf:

  1. Box einschalten.
  2. Modifikationskarte auflegen (um den „Nachtmodus“ scharf zu schalten).
  3. Hörbuchkarte auflegen → Hörbuch startet direkt im Nachtmodus/Dauerschleife.
  4. Aussachaltern vom Modus durch abschalten der Box oder wieder auflegen der Modifikationskarte, unabhängig ob mein Sohn zwischendurch selbst die Hörbuchkarte wechselt (Er hat eine ganze Box mit Karten neben dem Bett)

Bei den Logs in hier wird in beiden fällen die gleiche Hörbuchkarte aufgelegt, ohne wechsel.
Das der Endlosmodus den Ordner nur ein zweites Mal abspielt ist ein fehler, oder?

Vielen Dank für euere sehr schnellen Rückmeldungen :slight_smile:, euer Support ist TOP!

Ok, das kann ich noch ändern.

Ja, das wäre ein Fehler. Aber ich kann das in keinem Log so sehen. Du hast in jedem Fall die Endloskarte zuerst aufgelegt, so dass der Endlosmodus beim Auflegen der Abspielkarte wieder beendet wurde. Die Ordner wurden damit immer einmal abgespielt.

Was für einen DFPlayer hast du eigentlich?

Zum DFPlayer, da musste ich erst mal die Box auseinanderbauen, um zu schauen was drin ist. Hatte beim Bau einfach mal drei verschiedene bei Ali bestellt und der Erste hat gleich funktioniert, ohne was spezielles zu machen.

Seit Wochen wollte heute Abend mein Junior wieder mal Musik zum einschlafen hören.

Daher, gern eine Erweiterung zu Punkt 3: Bitte für alle gängigen Modi, das wäre echt super :slight_smile: . Nicht nur Hörbücher.

Ggf. noch ein wichtiger Punkt: Meine Hörbücher sind alle mehrteilig.

Ja, das war auch so gedacht.
Komme aber erst zum Wochenende dazu.