ESP32 + DY SV8F (MP3 player)

hello,
i have connected it on serial2 (16,17) rx->tx and tx->rx.
i can't get it to play a specific mp3.
all mp3 are in root named 00001.mp3 00002.mp3 etc.

is there something wrong with my code?
(i try 2 ways to get it to play the files .. both fail)

#include <Arduino.h>
#include "DYPlayerArduino.h"

// Initialise the player, it defaults to using Serial.
//DY::Player player;

// Alternatively initialise on another serial port.
DY::Player player(&Serial2);

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


  player.begin();
  player.setVolume(15);  // 50% Volume
                         //  player.setCycleMode(DY::PlayMode::Random); // Play all randomly and repeat.
  player.setCycleMode(DY::PlayMode::OneOff);

  player.play();
}

void loop() {
  Serial.println(" 0x01   playing 1");
  player.playSpecified(0x01);
  delay(3000);
  Serial.println("    playing 1");
  player.playSpecified(1);
  delay(3000);


  Serial.println(" 0x02   playing 2");
  player.playSpecified(0x02);
  delay(3000);
  Serial.println("    playing 2");
  player.playSpecified(2);
  delay(3000);

  Serial.println(" 0x03   playing 3");
  player.playSpecified(0x03);
  delay(3000);
  Serial.println("    playing 3");
  player.playSpecified(3);
  delay(3000);

  Serial.println(" 0x04   playing 4");
  player.playSpecified(0x04);
  delay(3000);
  Serial.println("    playing 4");
  player.playSpecified(4);
  delay(3000);

  Serial.println(" 0x05   playing 5");
  player.playSpecified(0x05);
  delay(3000);
  Serial.println("    playing 5");
  player.playSpecified(5);
  delay(3000);

}

How is this wired?
Does it play anything?

i power the mp3 from the esp.
mp3 TX -> G16
mp3RX->G17
it plays randomly mp3 00002.mp3
the dip switch :
1 = on
2=off
3=off

That might be doubtful. Please make and post a wiring showing the entire powering of the project.

for now is powered by usb!

How, from what esp output?

Please tell in a schematic.

Those useless Fritzings only show geographical positions on the circuits. Not using nor having that controller the picture brings no useful information.
Sorry but I quit this question for other doings.

I don’t have that board or player module, and I’m using iPad so cannot even test with Uno or Mega and my DFR Player. But don’t you need some delays in setup()?

Does this run?

void setup()
{
  Serial.begin(115200);
  delay(200);
  Serial2.begin(9600);
  delay(200);

  player.begin();
  delay(1000);
  player.setVolume(15);  // 50% Volume
                              player.setCycleMode(DY::PlayMode::Random);
// Play all randomly and repeat.
  player.setCycleMode(DY::PlayMode::OneOff);

  player.play(1);
}

Found the problem!
It's ither I don't pay attention to what I read or that the manual was made by Arabic speaking person :joy:

The pins are mentioned from right to left!

Problem solved and now works like a charm!

P.s I shall add the delays you suggested.

Pleased to hear it!

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.