For me, the serial communication breaks off at a point in the program and I don’t know what to do next… I have to find a way to debug my project… without serial communication I don’t know how it works… or I need tips from experienced programmers … as far as I’m concerned, a hardware solution has to be found … but I would like to send you the code snippets … maybe you’ll know more spontaneously.
main.cpp :
//INITIALISIERUNGSDEKLARATIONEN//////////////////////////////////////////////////////////////////////////////////////////////////
#define DEBUG_BAUD_RATE 115200 // Serielle Kommunikation
#define SERIAL_BUFFER_SIZE 256 // Puffergröße für Serielle kommunikation erhöhen
//###############################################################################################################################
//SETUP///INITIALISIERUNG////////////////////////////////////////////////////////////////////////////////////////////////////////
void setup() {
Serial.begin(DEBUG_BAUD_RATE); //Serielle Ausgabe
DFPlayer.cpp :
#include "DFPlayer.h"
//###############################################################################################################################
DFRobotDFPlayerMini myDFPlayer; // Objekt der DFRobotDFPlayerMini-Klasse
/////////////////////////////////DFPLAYER////////////////////////////////////////////////////////////////////////////////////////
// Initialisierungsfunktion
void DFPlayer_Init() {
FPSerial.begin(9600, SERIAL_8N1, /*rx =*/RX, /*tx =*/TX);
Serial.println(F("Initializing DFPlayer")); //DFPLAYER initialisierung
if (!myDFPlayer.begin(FPSerial, /*isACK = */true, /*doReset = */true)) { //Use serial to communicate with mp3.
Serial.println(F("Unable to begin:"));
Serial.println(F("1.Please recheck the connection!"));
Serial.println(F("2.Please insert the SD card!"));
while(true);
}
Serial.println(F("DFPlayer Mini online."));
myDFPlayer.setTimeOut(500); //Set serial communictaion time out 500ms
myDFPlayer.volume(12); //Set volume value (0~30).
}
DFPlayer.h :
//INITIALISIERUNGSDEKLARATIONEN//DFPLAYER////////////////////////////////////////////////////////////////////////////////////////
#define ESP32 // Arbeiten mit ESP32
#define RX (16) // PIN 16
#define TX (17) // PIN 17
#define FPSerial Serial1
extern DFRobotDFPlayerMini myDFPlayer; // Deklaration externe Objekt-Klasse
void printDetail(uint8_t type, int value); // Ausgabe des DFP
void DFPlayer_Init(); // Initialisierungsfunktion
//###############################################################################################################################
#endif
There is also a RTC … all modules function fine but my serial output breaks at this point…
---- Opened the serial port COM6 ----
ets@Jul`29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (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:0x3fff0030,len:1184
load:0x40078000,len:13192
load:0x40080400,len:3028
entry 0x400805e4
Initializing DFPlayer
DFPl