||1 year ago|
|bin||1 year ago|
|include||1 year ago|
|lib||2 years ago|
|src||1 year ago|
|test||2 years ago|
|.gitignore||1 year ago|
|.travis.yml||2 years ago|
|DEPLOY.md||1 year ago|
|README.md||1 year ago|
|build_version.sh||2 years ago|
|deploy.sh||1 year ago|
|partitions.csv||1 year ago|
|platformio.ini||1 year ago|
What you need
Please note: This list is a "things I used", neither "these are the best things for this stuff" nor "you can only use these things". But please be aware that using other stuff may lead to you having to make more or less easy modifications.
Prizes are more or less the cheapest I could find on Aliexpress.
|What?||For what?||Price (approx)|
|WS1053B on a PCB with SD card slot||Play the MP3 files; provide an SD card slot||5€|
|5V Amplifier(s) (e.g. 2x PAM-8302)||Single-channel Amplifier||2€|
|Speaker(s) matching your amp (e.g. 2pcs 4 Ohm 5W)||Enabling you to hear the sounds||4€|
|RFID tags (ISO14443A) - e.g. 10 cards||You can also get Keyfobs or stickers||4€|
|4 buttons||Prev/Next track, Volume up/down||1€|
You'all also need an SD card, some breadboard(s), jumper cables and a soldering iron. Also, some kind of box for the finished player.
How to connect
Schematics coming soon...ish...
How to install
Format your SD card with FAT32 and put files on it: Every album has to go into its own folder in the root of the SD card. Folders and files should not contain special characters (meaning stuff like äöüß). Spaces and dashes an alike are okay. Put the SD card into the SD card slot.
include/config.h. Modify it to at
least contain the correct login details for your WiFi.
The code then should compile in PlatformIO without errors. Upload it to your ESP32. After that, upload static files using PlatformIO's task "Upload file system image".
The serial console in PlatformIO should give you more or less useful messages about what's going on. There will also be a line saying "WiFi connected. IP address: xxx.xxx.xxx.xxx" when the connection to your WiFi succeeded.
In your browser, enter "http://xxx.xxx.xxx.xxx/" (using the IP address) from above. From there you can define mappings between RFID tag IDs and folders on the SD card.
To create a new mapping between an RFID tag and an folder, you can use the web interface. Click the button with the cogs icon. After putting your rfid tag on the reader (and possibly removing it again), its ID will be shown in the dialog. Click the button with the arrows behind the ID to start the mapping mode.
The dialog showing all folders with media files will be shown. Click the button with the arrows behind the correct folder, to create the mapping.
Mapping are stored on the SD card in the file
mapping goes on its own line. Lines should be separated by \n (Unix-
style line endings); the last line should also end with a newline.
Format of a line is
<RFID id>=<folder>. RFID id is the UID of an
RFID tag, expressed as 8 lowercase characters with leading 0 (if
necessary). Folder is the foldername to play; starting with a slash and
ending without one.
_mapping.txt could look like this:
1a2b3c4d=/Christmas Music Vol. 17 003aab7f=/Let it go b691a22c=/Frozen Audiobook 22cb6ae9=/Let it go
(Yes, more than one tag can map to a folder.)
Buttons pull to GND if pushed -> Internal Pull-Up needed!
The mapping of rfid tags to files uses the ID of the
tag. A file called
_mapping.txt in the root folder of
the SD card defines the mappings between RFID tag ids and
folders to play.
The easiest way to create this file is to use the mapping functionality of the webinterface.
You can also save data on the tags to further manipulate the system. Position of the data is irrelevant, the whole tag will be searched.
[random] will play the files in a random order.
[random:2] will randomize everything except the first 2
files. This can be useful for having the favorite song of
your kids playing, but after that getting a bit of randomness.
[lock] will turn this key into a key for the locking
mode. Scanning the tag enables locking mode. The next album
started will keep running until the end. Removing the tag
will be deactivated, as are the buttons for prev and next
track. You can disable locking mode by again scanning the
lock tag again.
[advent] is used for christmas time. An album with this tag
will only play in December. On December 1st, only track 1
will play. On December 2nd, track 2 followed by track 1. On
December 3rd, tracks 3, 1 and 2. From December 24th on, track
24 followed by tracks 1-23. So your kid will get the "daily track"
first, followed by all previous tags in the right order.
You can send commands to ESMP3 using three different ways:
- Through a websocket connection to
- Through the serial console using an USB cable.
- Via HTTP POST request to
http://<IP>/cmd, having the command in the variable
Supported commands are:
||Starts playing the given path. Path may be a path on the|
|sd card or a http(s) URL of a webstream (direct links to mp3/4/ogg streams,|
|PLS files, M3U files or podcast XML feeds are supported).|
||Continues playing the previously played thing.|
||Sets the volume to X (0-255).|
||Starts the previous track, if available.|
||Starts the next track, if available.|
||Starts playing track no. X of the currently playing album.|
||Resets the VS1053 audio chip.|
||Adds a mapping between RFID card and path|
||Runs an update check.|