DFPlayer Mini

The DFPlayer Mini is a small (cheap!) and flexible mp3 player unit that can be controlled via an Arduino. Unless you have a specific need for a 'trigger' function (where individual tracks are tripped using specific linked buttons) it's a nifty alternative to the larger and more expensive Sparkfun mp3 trigger.

Full details here: https://wiki.dfrobot.com/DFPlayer_Mini_SKU_DFR0299

Preparing files

Like the Sparkfun Mp3 trigger, some preparatory steps are required to have files play reliably from the SD card. The files you use should be in mp3 format, and their names should be numbered from 1 (e.g. 1.mp3, 2.mp3, 3.mp3... and so on).

Macs do a weird thing where every time you use a SD card or memory stick, it creates a bunch of hidden files, which can cause some strange errors.

These hidden files and folders can't be easily removed in Finder, and instead need to be removed by opening up the volume using the terminal. You will need to repeat this step EVERY TIME you plug the SD card in (though you might only have to remove 1 or 2 files).

Once you have finished copying your .mp3 files to the SD card, open up a mac terminal and type in the following (change '<SDVolumeName>' with the name of your SD card):

dot_clean /Volumes/<SDVolumeName>

If that doesn't work, IE your MP3s don't play, we will have to do it manually like so:

$ cd /Volumes/<name-of-volume>	# this navigates to the correct volume
$ ls -a				# verify what's in the output of this
$ rm ._*.mp3			# this removes all of the thumbnails
$ rm -r .Spotlight-V100 	# deletes the .Spotlight-V100 folder
$ rm -r .fseventsd   		# deletes the .fseventsd folder
$ rm -r .Trashes     		# deletes the .Trashes folder
$ ls -a				# this shows all the files you have left

Be very careful when you are running the rm -r command: this will recursively delete files and is NOT reversible. Only run it when you know you are in the correct folder, and make sure you know which folder you are deleting)

Operation not Permitted error
Sometimes on a mac you might get an error "operation not permitted". If you have this, follow these instructions to allow your Terminal to change files

e.g. see below: I use ls -a multiple times to check what I still need to delete. At the end, all that's left is the .mp3s and the . and .. shortcuts (these aren't file and can be ignored).