Hello!
I have an Arduino Nano ESP32 project, quite simple, involving a DFPlayer Mini.
I struggled many hours before to post here my issue.
The DFPlayer Mini: it is working as a standalone. It is powered by a 4.2V lab powersupply; I inserted a 32Gb SDCard with a single 0001.wav file; it is connected to a 2Ohm speaker. When I set GPIO1 to low with a Dupond cable, I have the music played. It took me ages to realize I could test it as a standalone
The Nano32: The board is powered by USB which allows me to read the Serial. It is grounded to the lab powersupply to get it consistent with the DFPlayer. I SoftSerialized A2 and A3 pins, both resistored with 1kOhm:
#define PIN_RX A2
#define PIN_TX A3
SoftwareSerial mySerial(PIN_RX, PIN_TX); // RX, TX
I'm using the DFRobotDFPlayer_Mini library. And I run the first Example provided with it.
On the setup, I try to Begin the player with my softSerial (set to 9600) and debug set to true, as well as reset. But that fails with the classical message "check connection, check card":
if (!myDFPlayer.begin(mySerial, /*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!"));
}
else
Serial.println(F("DFPlayer Mini online."));
I tried several pins, by theie name, GPIO index, Secret Arcanic Names, switched then several time. I tried hardware secondary RX/TX pins and try to swithed them also.
Begin never worked.
Actually, in my Loop(), I request the DFPlayer state as this:
if (myDFPlayer.available())
{
printDetail(myDFPlayer.readType(), myDFPlayer.read());
}
And in the best configuration, I can read on Serial a lot of DFPlayerError: Get Wrong Stack. That makes me raise an eyebrow: Begin failed, but the player is available?!?
If I add a call to play at this point, after the printDetail... Everything hang. Dead. I've read another thread where someone has an issue with play() doing nothing, but next() doing the job. I tested that: it hangs the same.
The funny part is that when I remove and insert back the SDCard, I have a reading on Serial: "Card Removed!" and "Card online!":
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
Card Removed!
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
Card Inserted!
DFPlayerError:Get Wrong Stack
DFPlayerError:Get Wrong Stack
I expect this to prove to me I did not make inconsistent pins connections.
Well. In the end: the player can play when I Low GPOI1 but I always have Wrong Stack error message.
Can someone have an idea to make me go further?
(You noticed I'm bad at making pictures )