DFPlayer - What Is a Segment?

If you ground ADKEY1 with zero ohms, it means "Play Segment 1". Every time I try it, my player starts to play the track "mp3\0069.mp3" from the beginning.
If you ground ADKEY2 with zero ohms, it means "Play Segment 5". When I try it, my player starts to play the track "mp3\0073.mp3" from the beginning.

Why those specific tracks? I don't see any logic. What exactly does "segment" stand for?

Come on 68 posts and you don’t know how to ask a question. What hardware do you have and what software is running.
Please provide a schematic and post your code correctly.

SimLego:
Why those specific tracks?

I have used DFPlayer with several projects and I guess that track "mp3\0069.mp3" was the first one that has been written to your sd card and track "mp3\0073.mp3" was the 5th. When you bulk copy files from pc to sd card, the copying process does not always start with "track 1".
These players have a pretty simple "file system". Files are not sorted by name (like the operating system on our pcs does). So often the copying sequence is important.

If you use an empty sd card and copy some files one by one in this sequence:

mp3\0001.mp3
mp3\0002.mp3
mp3\0003.mp3
mp3\0004.mp3
mp3\0005.mp3
mp3\0006.mp3

you may find out that pulling ADKEY1 to GND will play "0001.mp3" and pulling ADKEY2 to GND will play "0005.mp3".

You can find a tutorial for DFPlayer here: DFPlayer_Mini_SKU_DFR0299-DFRobot

Somebody’s a bit extra grumpy, eh? :wink:
Hardware is DFPlayer and - nothing more. I don’t think they come in that many variants(?)
Software is - exactly none.
And now that Dropbox changed the terms of usage, I don’t know how to provide pictures any longer. But that’s another subject.

Thanks, uxomm. Sounds very likely. I had hoped that ‘segments’ could mean chunks of files, or tracks, but it appears it means just files.

I find the linked tutorial quite messy and flooded with excessive information, although the English is better than most other documentation on DFPlayer I found online. But, for example, under “Information derections - Serial Mode”, we find: “Command 0x14 - Support 15 folder” Say what??? Sentences like this one just don’t compute. At all. Somebody should write a comprehensive tutorial, somebody who’s Technical English knowledge is better than mine, not even worse than mine.

I spent some hours peeling away all extra garbage from all the examples I found, and what remains to make the Arduino control a DFPlayer is only one function containing just a very few lines. No need to chase down the correct version of any include file!

// DFPlayerTE03test.ino
//
///              MP3 PLAYER PROJECT
/// http://educ8s.tv/arduino-mp3-player/
//////////////////////////////////////////



#include "SoftwareSerial.h"
SoftwareSerial mySerial(10, 11);
# define Start_Byte 0x7E
# define Version_Byte 0xFF
# define Command_Length 0x06
# define End_Byte 0xEF
# define Acknowledge 0x00 //Returns info with command 0x41 [0x01: info, 0x00: no info]

int DFPlayer_busy = 5; // connect to DFPlayer (not) BUSY pin

void setup () {

pinMode(DFPlayer_busy, INPUT);
pinMode(6, INPUT_PULLUP);
pinMode(13, OUTPUT);

mySerial.begin (9600);
delay(1000);

  execute_CMD(0x3F, 0, 0); // Initialize
  delay(50); // tesing init without playing any track

  execute_CMD(0x06, 0, 30); // Set the volume (0~30)
  delay(50);
}

void loop () { 

  if (digitalRead(6) == LOW)
  {
    execute_CMD(0x12, 0, 1); //testing play selected file - works!
    delay(200);
  }

}


void execute_CMD(byte CMD, byte Par1, byte Par2)
  // Excecute the command and parameters
{
  // Calculate the checksum (2 bytes)
  word checksum = -(Version_Byte + Command_Length + CMD + Acknowledge + Par1 + Par2);
  // Build the command line
  byte Command_line[10] = { Start_Byte, Version_Byte, Command_Length, CMD, Acknowledge,
  Par1, Par2, highByte(checksum), lowByte(checksum), End_Byte};
  //Send the command line to the module
  for (byte k=0; k<10; k++)
  {
    mySerial.write( Command_line[k]);
  }
}

"And now that Dropbox changed the terms of usage, I don't know how to provide pictures any longer."
Use Reply, click Attachments and other options, browse locally and select. Click Post.
Then right-click the attached picture, select Copy Shortcut.
Select Modify, paste the link in with image tags, the monitor looking type button Or just type img and /img with square braces.

Testing (sorry for being extremely off-topic. It won’t happen again 'til next time…)
testing....jpg

I'm resurrecting this because I've got a DFPlayer with exactly two tracks on the SD card - uploaded one at a time. If I ground ADKEY2, it plays the second file I uploaded (which apparently counts as segment 5?)... but if I ground ADKEY1 it plays the first file followed by the second file... So it seems that "segment" does not correspond directly to "file".

I'm playing with it right now. After many tries, the 001,002...nnn.mp3 filename notation works. The file must be copied with the correct order and no gaps between files are allowed, meaning that if you want to use only Segment 1 and Segment 6, you have to create 001.mp3, 002.mp3, ..., 006.mp3. All the six of them. I've created a blank MP3 file that I use as a dummy file to fill the gaps. Let me know if it worked for you.

Its referring to the AD Key mode -or- I/O mode for the DFPlayer

(why didnt anyone post a fricken’ image?)

AD Key:

I/O: