Arduino library for DFPlayer Mini
I downloaded the dfplayer arduino library and installed in my Arduino IDE. When trying to compile any of the example sketches for my Arduino UNO I get the following error codes:
DFPlayer_sample.ino: In function 'void setup()':
DFPlayer_sample:45: error: no matching function for call to 'mp3_set_serial(HardwareSerial&)'
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:75: note: candidates are: void mp3_set_serial(HardwareSerial*)
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:78: note: void mp3_set_serial(SoftwareSerial*)
What am I missing?
Fred Miller
DFPlayer_sample.ino: In function 'void setup()':
DFPlayer_sample:45: error: no matching function for call to 'mp3_set_serial(HardwareSerial&)'
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:75: note: candidates are: void mp3_set_serial(HardwareSerial*)
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:78: note: void mp3_set_serial(SoftwareSerial*)
What am I missing?
Fred Miller
2014-12-11 10:32:37 Problem solved... I had loaded the DFPlayer library into the Arduino (core) library folder (as I have done with others). But I moved it to the Arduino (user docs) folder and compilation errors on Examples went away. Don't know why, but it works...
Also by the way, I do NOT have the DFRobot library anywhere on my PC so NOT necessary for DFPlayer.
In the meantime I had developed my own code for building and sending commands through the software serial connection. Seems to work pretty well ALONG WITH the hardware serial connection (for using the IDE monitor in a sketch). Whereas using BOTH software and hardware serial and the supplied DFPlayer_Mini library doesn't seem to work very well. DFPlayer gets locked up on occasion.
Still lot's of unknowns on the behavior of the sound module and the serial communication with an Arduino UNO, e.g. timing on certain commands, format and content of "replies" to query commands, etc. Not covered in the docs.
Fred Miller
tractionfan
Also by the way, I do NOT have the DFRobot library anywhere on my PC so NOT necessary for DFPlayer.
In the meantime I had developed my own code for building and sending commands through the software serial connection. Seems to work pretty well ALONG WITH the hardware serial connection (for using the IDE monitor in a sketch). Whereas using BOTH software and hardware serial and the supplied DFPlayer_Mini library doesn't seem to work very well. DFPlayer gets locked up on occasion.
Still lot's of unknowns on the behavior of the sound module and the serial communication with an Arduino UNO, e.g. timing on certain commands, format and content of "replies" to query commands, etc. Not covered in the docs.
Fred Miller
tractionfan
2014-12-10 07:13:23 Including the DFRobot library didn't do a thing for my problem. (By the way I could not find any references in the DFPlayer files back to DFRobot so I don't know why that would even be necessary).
The DFPlayer_Mini_Mp3 library is just NOT handling the pass off of either the hardware or software serials. It should be possible to do the following on my UNO.
#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>
SoftwareSerial mySerial(10,11); //use for RX and TX pins
void setup () {
mySerial.begin (9600);
mp3_set_serial (mySerial); //set Serial for DFPlayer-mini mp3 module
... etc., but the library cannot deal with the software serial. I should point out that use of the this software serial works just fine when coding outside of the provided DFPlayer_Mini_Mp3 library.
If there is anyone out there who either really KNOWS the DFPlayer_Mini_Mp3 library, or, has been successful running the examples on a Arduino UNO, I sure would like some help.
Fred Miller
tractionfan
The DFPlayer_Mini_Mp3 library is just NOT handling the pass off of either the hardware or software serials. It should be possible to do the following on my UNO.
#include <SoftwareSerial.h>
#include <DFPlayer_Mini_Mp3.h>
SoftwareSerial mySerial(10,11); //use for RX and TX pins
void setup () {
mySerial.begin (9600);
mp3_set_serial (mySerial); //set Serial for DFPlayer-mini mp3 module
... etc., but the library cannot deal with the software serial. I should point out that use of the this software serial works just fine when coding outside of the provided DFPlayer_Mini_Mp3 library.
If there is anyone out there who either really KNOWS the DFPlayer_Mini_Mp3 library, or, has been successful running the examples on a Arduino UNO, I sure would like some help.
Fred Miller
tractionfan
2014-12-08 19:30:29 hi to use this code need install the library https://github.com/DFRobot/DFRobot_utility
and Uno have no Serial1, so best is use leonardo which have Serial1 connect to mp3 module and Serial connect to PC adrian
and Uno have no Serial1, so best is use leonardo which have Serial1 connect to mp3 module and Serial connect to PC adrian
2014-12-08 19:21:36 Hello Traction,
Seems like in order to use the library, you will need to install these utilities as well:
https://github.com/DFRobot/DFRobot_utility
Cheers Jose
Seems like in order to use the library, you will need to install these utilities as well:
https://github.com/DFRobot/DFRobot_utility
Cheers Jose
2014-12-08 11:48:52 I deleted all files, zips, etc. referencing the DFPlayer from my Windows 7 PC. At this point Arduino IDE could not find and reference to the DFPlayer. I closed the Arduino IDE and then downloaded a new copy of the zipped library. I then moved the contained "DFPlayer_Mini-Mp3" folder into my Arduino library at(c:\Program Files(x86)\Arduino\libraries\.)
That folder contained: the two DFPlayer_Mini-Mp3 files (.h and .cpp) as well as the keyword and license text files and a folder "examples" with the 3 example sketches.
Starting up Arduino's IDE, using the "examples" menu, I see the three example sketches. When trying to compile the sketches I get the following errors:
Errors found compiling "DFPlayer_Mini_Test.ino" from Examples
DFPlayer_Mini_Test.ino: In function 'void setup()':
DFPlayer_Mini_Test:66: error: 'Serial1' was not declared in this scope
DFPlayer_Mini_Test.ino: In function 'void print_info()':
DFPlayer_Mini_Test:78: error: 'printHex' was not declared in this scope
DFPlayer_Mini_Test:80: error: 'Serial1' was not declared in this scope
DFPlayer_Mini_Test:80: error: 'serialRead' was not declared in this scope
DFPlayer_Mini_Test.ino: In function 'void loop()':
DFPlayer_Mini_Test:90: error: 'Serial1' was not declared in this scope
DFPlayer_Mini_Test:90: error: 'serialRead' was not declared in this scope
DFPlayer_Mini_Test:93: error: 'printHex' was not declared in this scope
DFPlayer_Mini_Test:99: error: 'split' was not declared in this scope
Errors found compiling "DFPlayer_sample.ino" from Examples
DFPlayer_sample.ino: In function 'void setup()':
DFPlayer_sample:45: error: no matching function for call to 'mp3_set_serial(HardwareSerial&)'
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:75: note: candidates are: void mp3_set_serial(HardwareSerial*)
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:78: note: void mp3_set_serial(SoftwareSerial*)
Errors found compiling "DFPlayer_SoftwareSerial.ino" from Examples
DFPlayer_SoftwareSerial.ino: In function 'void setup()':
DFPlayer_SoftwareSerial:47: error: no matching function for call to 'mp3_set_serial(SoftwareSerial&)'
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:75: note: candidates are: void mp3_set_serial(HardwareSerial*)
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:78: note: void mp3_set_serial(SoftwareSerial*)
If this is a library problem, can you decipher which library is not being made available in the sketch compilations? Or what else is going on.
Fred Miller tractionfan
That folder contained: the two DFPlayer_Mini-Mp3 files (.h and .cpp) as well as the keyword and license text files and a folder "examples" with the 3 example sketches.
Starting up Arduino's IDE, using the "examples" menu, I see the three example sketches. When trying to compile the sketches I get the following errors:
Errors found compiling "DFPlayer_Mini_Test.ino" from Examples
DFPlayer_Mini_Test.ino: In function 'void setup()':
DFPlayer_Mini_Test:66: error: 'Serial1' was not declared in this scope
DFPlayer_Mini_Test.ino: In function 'void print_info()':
DFPlayer_Mini_Test:78: error: 'printHex' was not declared in this scope
DFPlayer_Mini_Test:80: error: 'Serial1' was not declared in this scope
DFPlayer_Mini_Test:80: error: 'serialRead' was not declared in this scope
DFPlayer_Mini_Test.ino: In function 'void loop()':
DFPlayer_Mini_Test:90: error: 'Serial1' was not declared in this scope
DFPlayer_Mini_Test:90: error: 'serialRead' was not declared in this scope
DFPlayer_Mini_Test:93: error: 'printHex' was not declared in this scope
DFPlayer_Mini_Test:99: error: 'split' was not declared in this scope
Errors found compiling "DFPlayer_sample.ino" from Examples
DFPlayer_sample.ino: In function 'void setup()':
DFPlayer_sample:45: error: no matching function for call to 'mp3_set_serial(HardwareSerial&)'
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:75: note: candidates are: void mp3_set_serial(HardwareSerial*)
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:78: note: void mp3_set_serial(SoftwareSerial*)
Errors found compiling "DFPlayer_SoftwareSerial.ino" from Examples
DFPlayer_SoftwareSerial.ino: In function 'void setup()':
DFPlayer_SoftwareSerial:47: error: no matching function for call to 'mp3_set_serial(SoftwareSerial&)'
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:75: note: candidates are: void mp3_set_serial(HardwareSerial*)
C:\Program Files (x86)\Arduino\libraries\DFPlayer_Mini_Mp3/DFPlayer_Mini_Mp3.h:78: note: void mp3_set_serial(SoftwareSerial*)
If this is a library problem, can you decipher which library is not being made available in the sketch compilations? Or what else is going on.
Fred Miller tractionfan
2014-12-08 08:19:03 Hello tractionfan,
It seems that there is something wrong with the library. Could you install the library again?
And after install the library, please close the Arduino IDE, and open it again. Grey.CC
It seems that there is something wrong with the library. Could you install the library again?
And after install the library, please close the Arduino IDE, and open it again. Grey.CC