Troubleshooting

The DFPlayer Pro DFR0768 is buggy. Are there any firmware updates?

userHead Joe.Goldthwaite 2023-12-11 03:17:25 233 Views1 Replies

I've been working on a musical clock that's had an on-going problem. I use the serial connection to start playing a song. I send AT+PLAYFILE=/XXXXXX.mp3\r\n". That normally plays the song. Sometimes instead it just emits a loud pop and goes silent. 

 

I assumed it was a timing issue so I've worked on that but it made no difference.  I wanted to detect when it happens and re-try playing the song but I've discovered that when it does the pop, it thinks it's playing the song I requested. That is sending AT+QUERY=5\r\n returns the song number I told it to play but nothing is coming from the speakers.

 

This problem has cost me a LOT of time and I'm kind of pissed of at DFRobot for sending out a buggy  product. I've tried two different DFPlayer Pro's and had the same issue with both of them. At this point I'm going to have to switch to a different MP3 player because I cannot tell from the device if it's playing correctly or not.

 

Does anyone know if they're doing any bug fixes for this? Is there any source code available so that I can figure it out myself?  

 

Thanks.

2023-12-18 09:04:32

Here's the code I ended up using to work around this bug. 

 

In my case, I have a relay that powers up the DFPlayer pro and a separate relay that connects or disconnects the speakers. I found that the player takes around 360 milliseconds to power up and start responding to commands. Since the bug seems to screw up on the first or second song after the initial power up, I send a silent mp3 file two times with a ¾ second delay after each. That's a total 2 second delay required between the power up and being able to play the first real file.

 

void dfplayerPowerUp() {    
   
   // This function turns off the speakers to the dfplayer pro
   speakersOff();

   // This section switches the relay to the dfplayer pro on. This
   // powers the player up.
   debugPrint("Switching the power relay on\n");
   digitalWrite(DFP_ON_PIN, HIGH);
   delay(RELAY_PULSE_MILLISECONDS);
   digitalWrite(DFP_ON_PIN, LOW);

   //Give it 1/2 second to fire up
   debugPrint("Waiting .5 seconds\n");
   delay(500);

   // The MP3 player pro sometimes emits a loud pop the first time it gets
   // the AT+PLAYFILE command after power up. If you query the player it
   // thinks it's playing the song but there's nothing but silents. The
   // second PLAYFILE command seems to work most of the time but sometimes
   // it does the same thing.

   // This code tells it to play a blank or silent MP3 file. It does this
   // twice waiting 3/4 seconds after each. Once all that's done, it turns
   // on the speaker and is ready to play the real song.
   
   // Sent the blank file twice with a one 3/4 second delay.
   for (int i=0; i<2; i++) {
       debugPrint("AT+PLAYFILE=/blank2s.mp3\r\n");
       dfpSerial.printf("AT+PLAYFILE=/blank2s.mp3\r\n");
       delay(750);
   }

   speakersOn();
}
 

 

 

userHeadPic Joe.Goldthwaite