Serial MP3 Player and nodeMCU V3 Tutorial

Hi,

I would like to know if somebody has successfully setup a simple program in order to play one sound
or know if an interesting and working tutorial exists ?

with these kind of parts:

DFPlayer Mini
or
YX6300 YX5300 UART Control Serial Module MP3 Music Player

and

V3 Nodemcu-CH340

I notice that with cannot use software serial base library but
we have to use

I try and have no specific errors but even simples examples are not working.
With arduino uno boards no issues.

I use ports RX(D5/GPIO14) AND TX(D6/GPIO12)

If some peoples are interested I'll post code samples when I will make it work.

Best Regards,

guillaumebertrand52:
If some peoples are interested I'll post code samples when I will make it work.

Wouldn't it be better to post your code that isn't working so people can see what you have attempted and possibly help?

Ok; you are right.

I (try) use this

SerialMp3PlayerControl.ino

==> with an arduino uno it is working.
==> with a nodemcu with espsoftwareserial it is not working

I use version 6.8.0 of espsoftwareserial

The only change I made here
are the ports (with arduino uno no issues)
and due to the usage of espsoftware serial (I put the files in src of the library (espsoftwareserial/src at main · plerup/espsoftwareserial · GitHub)) at the root with the ino file) I change the first line
from
#include <SoftwareSerial.h>
to
#include "SoftwareSerial.h"

No compilation erros but seems to have execution errors (I am a beginner in arduino).

If you're using an ESP32, why not use the extra hardware UART serial ports?

If you want to use the DFPlayerMini, I suggest using the easy to implement library DFPlayerMini_Fast.h. It is installable via the Arduino IDE's Libraries Manager and comes with the following example:

#include <SoftwareSerial.h>
#include <DFPlayerMini_Fast.h>

SoftwareSerial mySerial(10, 11); // RX, TX
DFPlayerMini_Fast myMP3;

void setup()
{
  Serial.begin(115200);
  mySerial.begin(9600);

  myMP3.begin(mySerial);
  
  Serial.println("Setting volume to max");
  myMP3.volume(30);
  delay(20);
  
  Serial.println("Playing track 1 for 5 sec");
  myMP3.play(1);
  delay(5000);

  Serial.println("Sleeping for 5 sec");
  myMP3.sleep();
  delay(5000);

  Serial.println("Waking up");
  myMP3.wakeUp();

  Serial.println("Looping track 1");
  myMP3.loop(1);
}

void loop()
{
  //do nothing
}

The example uses a software serial port, but you can use Serial1 instead.

Hi,
Thanks I will try.

Have a nice day.

I will respond when this as been solved.