enjoyneering / dfplayer Goto Github PK
View Code? Open in Web Editor NEWSmall and fast Arduino library for DFPlayer Mini MP3 Player
License: GNU General Public License v3.0
Small and fast Arduino library for DFPlayer Mini MP3 Player
License: GNU General Public License v3.0
Hi!
I've a DFPlayer Mini HW-247A. I've tryed the DFPlayer_ESP8266_Basic example and it seems to work fine except by the setVolume(x) function which does nothing.
I'm initializing the DFPlayer object as follows:
mp3.begin(mp3Serial, MP3_SERIAL_TIMEOUT, DFPLAYER_MINI, false);
If I use the DFPLAYER_HW_247A option insted of DFPLAYER_MINI, the code doesn't work.
What am I doing wrong?
Thanks in advance!
Mario
Hello all.
I'm trying to compile the 'DFPlayer_ESP8266_HW_Serial.ino' example, but Arduino IDE 2.2.1 fails with tthe following output:
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino: In function 'void setup()':
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:72:44: error: no matching function for call to 'USBCDC::begin(int, SerialConfig)'
Serial.begin(MP3_SERIAL_SPEED, SERIAL_8N1); //hardware serial on GPIO01(TX) & GPIO03(RX) after boot
^
In file included from C:\Users\kvark\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.13\cores\esp32/USB.h:21,
from C:\Users\kvark\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.13\cores\esp32/HardwareSerial.h:201,
from C:\Users\kvark\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.13\cores\esp32/Arduino.h:184,
from C:\Users\kvark\AppData\Local\Temp\arduino\sketches\39004B9F2A7C6CE6203C16BE7839C87D\sketch\DFPlayer_ESP8266_HW_Serial.ino.cpp:1:
C:\Users\kvark\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.13\cores\esp32/USBCDC.h:70:10: note: candidate: 'void USBCDC::begin(long unsigned int)'
void begin(unsigned long baud=0);
^~~~~
C:\Users\kvark\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.13\cores\esp32/USBCDC.h:70:10: note: candidate expects 1 argument, 2 provided
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:76:10: error: 'class USBCDC' has no member named 'swap'
Serial.swap(); //now hardware serial on GPIO15(TX) & GPIO13(RX)
^~~~
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:89:10: error: 'class USBCDC' has no member named 'swap'
Serial.swap(); //now hardware serial on GPIO01(TX) & GPIO03(RX)
^~~~
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino: In function 'void loop()':
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:103:10: error: 'class USBCDC' has no member named 'swap'
Serial.swap(); //now hardware serial on GPIO15(TX) & GPIO13(RX)
^~~~
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:112:7: error: 'class DFPlayer' has no member named 'setResponse'; did you mean '_getResponse'?
mp3.setResponse(true); //enable=request feedback to return not only errors but also OK statuses
^~~~~~~~~~~
_getResponse
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:116:10: error: 'class USBCDC' has no member named 'swap'
Serial.swap(); //now hardware serial on GPIO01(TX) & GPIO03(RX)
^~~~
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:121:10: error: 'class USBCDC' has no member named 'swap'
Serial.swap(); //now hardware serial on GPIO15(TX) & GPIO13(RX)
^~~~
C:\Users\kvark\OneDrive\Arduino\libraries\DFPlayer-ESP\examples\DFPlayer_ESP8266_HW_Serial\DFPlayer_ESP8266_HW_Serial.ino:129:10: error: 'class USBCDC' has no member named 'swap'
Serial.swap(); //now hardware serial on GPIO01(TX) & GPIO03(RX)
^~~~
exit status 1
Compilation error: no matching function for call to 'USBCDC::begin(int, SerialConfig)'
Is there a way to play folder and have it loop after the last track in the folder, ive called it with a random number to start with and it rolls onto the next folder after the last track. Ive tried repeat folder but in the function is supposed to be a 10sec delay with millis and the repeat folder function just goes with no gap between tracks.
Hi! I have a DFPlayer Mini with a MH2024K-24SS which doesn't work with the library. I was wondering if the code can be adapted to work by figuring out what the proper checksum is?
Thanks!
Hi, I received a GD3800D chip (similar to GD3200D) but it doesn't work with this library. I should fix What parts of this library can be improved?
Thanks!
(The link above is the datasheet of the GD3800D.)
Did anyone tried to use micro sd card module to replace a dfplayer?
Thanks for creating this library! I've been unable to get the official DF Robot library to work but this one does. I did run into an issue initially with not being able to control the volume but found a fix for it.
In the .h and .cpp files the setVolume command is defined as:
void setVolume(uint8_t volume);
whereas the DF Robot library defines it as:
void setVolume(uint16_t volume);
Changing the setVolume to be uin16_t in the .h and .cpp files for this library allowed me to control the volume.
Hi,
I can't get HW-247A with 3200D chip modules to work with your DF_Player_ESP8266_Basic sample code.
The (good) documentation refers to the 3200B and this has 3200D printed on it, and I am wondering if that may be the cause.
Using a Wemos D1 mini (ESP8266) with D1 ---> RX and D2 ---> TX.
mp3.getStatus() returns: 4=communication error
I have increased MP3_SERIAL_TIMEOUT to 800
Tried 3.3V and 5V power. (Red LED on DFPlayer comes on for a short while after powering up)
Great library - thank you :)
I have it up and running, however I am unable to detect when a track has finished. I thought I could use:
while(mp3.getStatus() == 1){
delay(50);
}
But I always get 0 for mp3.getStatus() even when a track is playing - any suggestions?
I should add - I have the "df player HW-247A" version with the GD3200B chip
Hi,
Thanks for your work ... but unfortunately it doesn't work for me
I just buy on AliE some "DF Player mini" labelled HW-247A with the GB3200B chip.
It doesn't lool exactly as the one shown on your page (no STBY->BUSY nor STBY->GND solder points)
On ESP32, I've tryied the different module types, with timeout up to 2000ms ... still having communication error (#4)
Any suggestion or ideas to test ?
I can provide one module for testing if you want ...
the AE url is : https://www.aliexpress.com/item/1005001417104130.html?spm=a2g0o.order_list.0.0.30ba5e5bVI3RBV
thanks for your help
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.