Hallo,
ich habe die Tonuino-Box gestern fertig gebaut und nach dem ersten Testen funktionierten alle Buttons auch einwandfrei. Um die Teile dann in das Gehäuse zu platzieren, musste ich die Schalter noch einmal umlöten. Zuerst hatte ich für die drei Buttons ein durchgeschliffenen Ground, habe dann aber jeden einzelnen mit der Platine verbunden.
Nachdem ich die Box fertig zusammengebaut habe, versagten die Buttons ihren Dienst. Folgende Probleme habe ich nun:
- Wenn ich Karte 1 (bereits zugewiesen) auflege, spielt die Box die Lieder wie gewünscht ab. Drücke ich dann die Leiser-Taste ein Mal kurz, so beginnt das Lied von vorn, oder er springt zu einem anderen Lied. Danach reagiert kein Knopf mehr, egal wie lange und in welcher Kombination ich drücke.
- Wenn ich eine neue Karte auflege, wird dies erkannt, mit „Oh eine neue Karte, […] clicke dich durch das Menü […]“. Die Auswahlmöglichkeiten werden nicht einmal mehr vollständig angesagt. Danach reagiert der Tonuino gar nicht mehr, als hätte er sich aufgehängt. Egal, ob der Strom über Powerbank oder PC kommt.
- Heute nutzte ich das Wenige, was funktioniert und konnte die Playlist hören. Als ich nach ca. 30 Minuten mal eine Taste drückte, stürzte sie ab. Seit dem Neustart werden alle Lieder nur kurz mit unterschiedlicher Länge angespielt, bis zum nächsten Lied gesprungen wird.
Versuchte Problemlösung:
- Das naheliegende Problem, dass die Taster beim erneuten Löten zu heiß wurden und daraufhin kaputtgingen, konnte ich damit ausschließen, dass ich einen Reservebutton anstelle der jeweiligen Tasten angeschlossen habe und das Problem unverändert besteht.
- Alle Lötstellen überprüft, auch dass alles richtig steckt
- Software erneut geflasht mit den Bibliotheken, die hier angegeben sind.
Diese sind:
- jchristensen/JC_Button: 2.1.2
- miguelbalboa/MFRC522: 1.4.10
- makuna/DFPlayer Mini Mp3 by Makuna: 1.2.3
- die drei Taster erneut über einen Ground durchgeschliffen, um das vorherige Set-up zu replizieren.
- zusätzlich habe ich die Jumper-Kabel mit dem Multimeter geprüft. Hier konnte ich feststellen, dass der PIN A1 direkt mit dem Ground verbunden zu sein scheint, da das Multimeter hier ausschlägt.
Ist das richtig so?
Verwendete Hardware:
- AZ-Delivery Tonuino Set
- TonUINO Classic Platine 1.7 (von Leiterkartenpiraten)
- Drucktaster von Amazon
- Powerbank von Amazon
Hier Fotos von meinem Aufbau:
Foto von der TonUINO Classic Platine 1.7. Die Fusseln darauf kommen von einem Wattestäbchen, die ich mit dem Reinigungsallkohol und Zahnbürste nicht wegbekommen habe. Dürfte also keine Einflüsse haben.
Verkabelung des RFID-shields.
Verkabelung der Buttons mit MS Paint nachgezeichnet.
Foto vom Gesamtaufbau Stand jetzt, mit den bestehenden Fehlern.
Foto vom vorübergehenden Aufbau, wo die Buttons noch über den gleichen Ground verbunden waren, dafür aber noch funktionierten.
Zur Software:
- Software Stand 06.01.24 habe ich installiert.
- meine constants.hpp Datei:
#ifndef SRC_CONSTANTS_HPP_
#define SRC_CONSTANTS_HPP_
#include <Arduino.h>
/* 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 ALLinONE
//#define ALLinONE_Plus
/* 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
/* 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
*/
//#define DFMiniMp3_T_CHIP_GD3200B
//#define DFMiniMp3_T_CHIP_MH2024K16SS
//#define DFMiniMp3_T_CHIP_LISP3
#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 (only for AiOplus)
* um den Drehgeber zu unterstützen bitte in der nächste Zeile den Kommentar entfernen (nur für AioPlus)
*/
//#define ROTARY_ENCODER
#ifdef ALLinONE_Plus
// if using Rotary Encoder Buchse
//inline constexpr uint8_t rotaryEncoderClkPin = 31; // PE2
//inline constexpr uint8_t rotaryEncoderDtPin = 32; // PE3
w
// if using Opt Leiste (Male)
inline constexpr uint8_t rotaryEncoderClkPin = 36; // PF2
inline constexpr uint8_t rotaryEncoderDtPin = 37; // PF3
#endif // ALLinONE_Plus
/* 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 ALLinONE_Plus
inline constexpr uint8_t potiPin = A14; // AiO+ PF4
#else
inline constexpr uint8_t potiPin = A5 ; // AiO/Classic A5
#endif // ALLinONE_Plus
/* 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
#ifdef ALLinONE_Plus
inline constexpr uint8_t neoPixelRingPin = 10; // PB2 on AiOplus (Erweiterungsleiste (Female))
#else
inline constexpr uint8_t neoPixelRingPin = 5; // D5 on AiO/Classic
#endif // ALLinONE_Plus
inline constexpr uint8_t neoPixelNumber = 24; // Total Number of Pixels
/* uncomment the below line to enable the Speaker on/off on Pin D6 for Classic to suppress noise
* on startup and shutdown
* um den Lautsprecher ein/aus Schalter über D6 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)
*/
//#define SPKONOFF
/* 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
/* #################################################################################################
* ##### normally, you don't have to edit lines below ############################
* ##### mormalerweise müssen die folgende Zeilen nicht editiert werden ############################
* #################################################################################################
*/
// ####### helper for level ############################
enum class level : uint8_t {
inactive,
active ,
};
enum class levelType : uint8_t {
activeHigh, // normally open
activeLow , // normally closed
};
inline constexpr int getLevel(levelType t, level l) { return (l == level::inactive) ? (t == levelType::activeHigh ? LOW : HIGH)
: (t == levelType::activeHigh ? HIGH : LOW); }
// ####### rules for buttons ############################
#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;
#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)
// ####### 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 #########################################
#define DFPlayerUsesSoftwareSerial
inline constexpr uint8_t maxTracksInFolder = 255;
inline constexpr uint8_t dfPlayer_receivePin = 2;
inline constexpr uint8_t dfPlayer_transmitPin = 3;
inline constexpr uint8_t dfPlayer_busyPin = 4;
inline constexpr levelType dfPlayer_busyPinType = levelType::activeHigh;
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1000;
// ####### tonuino #####################################
inline constexpr uint8_t shutdownPin = 7;
inline constexpr levelType shutdownPinType = levelType::activeHigh;
inline constexpr uint8_t ampEnablePin = 6;
inline constexpr levelType ampEnablePinType = levelType::activeHigh;
inline constexpr uint8_t openAnalogPin = A7;
inline constexpr unsigned long cycleTime = 50;
#endif /* TonUINO_Classic or TonUINO_Every */
/***************************************************************************
** AiO plus ***************************************************************
***************************************************************************/
#ifdef ALLinONE_Plus
// ####### buttons #####################################
#if not defined(THREEBUTTONS) and not defined(BUTTONS3X3)
#define FIVEBUTTONS
#endif
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 uint8_t maxTracksInFolder = 255;
// inline constexpr uint8_t dfPlayer_receivePin = 2;
// inline constexpr uint8_t dfPlayer_transmitPin = 3;
inline constexpr uint8_t dfPlayer_busyPin = 13;
inline constexpr levelType dfPlayer_busyPinType = levelType::activeHigh;
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1000;
inline constexpr HardwareSerial &dfPlayer_serial = Serial3;
// ####### 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 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
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 #########################################
#define DFPlayerUsesSoftwareSerial
inline constexpr uint8_t maxTracksInFolder = 255;
inline constexpr uint8_t dfPlayer_receivePin = 2;
inline constexpr uint8_t dfPlayer_transmitPin = 3;
inline constexpr uint8_t dfPlayer_busyPin = 4;
inline constexpr levelType dfPlayer_busyPinType = levelType::activeHigh;
inline constexpr unsigned long dfPlayer_timeUntilStarts = 1000;
// ####### 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 */
// ####### some helper fuctions #####################################
template <typename T> void PROGMEM_read(const T * sce, T& dest)
{
memcpy_P (&dest, sce, sizeof (T));
}
#endif /* SRC_CONSTANTS_HPP_ */
Und zu guter Letzt meine Logs mit Anmerkungen:
17:47:02.871 -> V3.1.5 12.12.23
17:47:02.871 ->
17:47:02.935 -> Ver:2
17:47:02.935 -> Vol:25 5 15
17:47:02.935 -> EQ:1
17:47:02.935 -> ST:0
17:47:02.935 -> IB:1
17:47:02.935 -> AL:0
17:47:02.935 -> AP:1111
17:47:02.935 -> PCR:0
17:47:05.427 -> Volume: 15
17:47:05.556 -> MFRC522:146
17:47:05.556 -> enter Idle
17:47:05.556 -> Command: 6
17:47:05.556 -> enqueue mp3 262 0
17:47:05.556 -> play mp3 262
------------------------
ohne etwas zu machen:
17:47:54.920 -> Command: 4
17:48:07.691 -> Command: 4
17:48:20.501 -> Command: 4
17:48:33.304 -> Command: 4
17:48:46.076 -> Command: 4
---------------------
Karte 1 (fertig programmiert auf Ordner) 01 aufgelegt:
17:49:23.838 -> Card Inserted
17:49:23.838 -> CardData: 31 73 3b 74 02 01 01 00 00
17:49:23.838 -> enter StartPlay
17:49:23.838 -> enqueue mp3 262 0
17:49:23.872 -> play mp3 262
17:49:26.197 -> 11 tr in folder 1
17:49:26.197 -> enqueue 1-10
17:49:26.230 -> play 1-10
17:49:27.232 -> enter Play
---------------------
Karte 1 entfernt:
17:49:38.159 -> Command: 14
17:49:47.885 -> Card Removed
17:49:50.960 -> Command: 14
17:50:03.763 -> Command: 14
------------------------
ohne etwas zu machen:
17:50:16.583 -> Command: 14
17:50:29.381 -> Command: 14
------------------------------
Karte 2 (ohne Zuweisung) aufgelegt
17:50:53.630 -> Card Inserted
17:50:53.630 -> CardData: 00 00 00 00 00 00 00 00 00
17:50:53.630 -> enqueue mp3 300 0
17:50:53.630 -> enter AdmNewCard
17:50:53.693 -> play mp3 300
17:50:55.824 -> enter ChMode
17:50:55.824 -> enqueue mp3 310 0
17:50:55.888 -> play mp3 310
17:51:07.815 -> Command: 15
17:51:07.815 -> enqueue mp3 320 0
17:51:07.880 -> play mp3 320
17:51:20.623 -> Command: 15
17:51:20.623 -> enqueue mp3 321 0
17:51:20.687 -> play mp3 321
--------------------------
Karte entfernt:
17:52:24.335 -> Card Removed
---------------------
Karte 1 (fertig programmiert auf Ordner) 01 aufgelegt:
17:53:17.845 -> Card Inserted
17:53:18.231 -> Card Removed
17:53:18.262 -> Card Inserted
17:53:18.618 -> Card Removed
17:53:18.748 -> Card Inserted
-------------------------
Neuer Ablauf:
19:27:38.444 ->
19:27:38.444 -> _____ _____ _____ _____ _____
19:27:38.476 -> |_ _|___ ___| | | | | | |
19:27:38.476 -> | | | . | | | |- -| | | | | |
19:27:38.476 -> |_| |___|_|_|_____|_____|_|___|_____|
19:27:38.476 -> TonUINO Version 3.1 - refactored by Boerge1
19:27:38.476 ->
19:27:38.476 -> created by Thorsten Voß and licensed under GNU/GPL.
19:27:38.476 -> Information and contribution at https://tonuino.de.
19:27:38.476 ->
19:27:38.476 -> V3.1.5 12.12.23
19:27:38.476 ->
19:27:38.542 -> Ver:2
19:27:38.542 -> Vol:25 5 15
19:27:38.542 -> EQ:1
19:27:38.542 -> ST:0
19:27:38.542 -> IB:1
19:27:38.542 -> AL:0
19:27:38.542 -> AP:1111
19:27:38.542 -> PCR:0
19:27:40.615 -> Volume: 15
19:27:40.745 -> MFRC522:146
19:27:40.745 -> enter Idle
19:27:40.745 -> Command: 6
19:27:40.745 -> enqueue mp3 262 0
19:27:40.745 -> play mp3 262
---------------------
Karte 1 (fertig programmiert auf Ordner) 01 aufgelegt:
19:28:30.542 -> Command: 4
19:28:43.340 -> Command: 4
19:28:56.131 -> Command: 4
19:29:08.914 -> Command: 4
19:29:12.093 -> Card Inserted
19:29:12.126 -> CardData: 31 73 3b 74 02 01 01 00 00
19:29:12.126 -> enter StartPlay
19:29:12.126 -> enqueue mp3 262 0
19:29:12.158 -> play mp3 262
19:29:14.485 -> 11 tr in folder 1
19:29:14.485 -> enqueue 1-11
19:29:14.518 -> play 1-11
19:29:15.518 -> enter Play
----------------------------
ohne etwas zu drücken:
19:29:22.606 -> Command: 14
19:29:35.381 -> Command: 14
------------------------
Leisertaste einmal kurz gedrückt. Lied startet von vorn anstatt die Lautstärke zu ändern:
19:29:55.846 -> Command: 13
19:29:55.846 -> play 1-11
--------------------------
Karte entfernt, vermutlich zu langsam, sodass es nochmal erkannt wurde:
19:30:18.508 -> Card Removed
19:30:18.541 -> Card Inserted
19:30:18.573 -> CardData: 31 73 3b 74 02 01 01 00 00
19:30:18.737 -> Card Removed
Ich hoffe ich habe keine Infromationen vergessen.
Vorab vielen Dank für eure Hilfe!