Added much more info to README.md

This commit is contained in:
Fabian Schlenz 2019-11-17 19:31:59 +01:00
parent d92388d11f
commit d818624287

111
README.md
View File

@ -1,4 +1,92 @@
# Ports # ESMP3
## 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) |
|-------|-----------|----------------|
| ESP-32-WROOM-32D | Controlling everything | 4€ |
| WS1053B on a PCB with SD card slot | Play the MP3 files; provide an SD card slot | 5€ |
| MFRC522 ] RFID reader | 1€ |
| 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.
Copy `include/config.sample.h` to `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.
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.
## RFID-folder-mappings
### Via webinterface
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.
### Manually
Mapping are stored on the SD card in the file `/_mapping.txt`. Every
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.
A valid `_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.)
## Technical details
### Ports
| Device | Port | Connected to | | Device | Port | Connected to |
| ------ | ---- | ------------ | | ------ | ---- | ------------ |
@ -23,16 +111,16 @@
Buttons pull to GND if pushed -> Internal Pull-Up needed! Buttons pull to GND if pushed -> Internal Pull-Up needed!
# RFID stuff ### RFID tags
The mapping of rfid tags to files uses the ID of the The mapping of rfid tags to files uses the ID of the
tag. Create a file `ids.txt` in a folder containing tag. A file called `_mapping.txt` in the root folder of
one or more IDs will lead to the folder beginning to play the SD card defines the mappings between RFID tag ids and
when a tag with that id is on the reader. folders to play.
The ID should be a 8 character long, downcase string The easiest way to create this file is to use the mapping
containing the ID in hexadecimal. E.g. `23b1aa7d`. functionality of the webinterface.
## Special modes #### Special modes
You can also save data on the tags to further manipulate You can also save data on the tags to further manipulate
the system. Position of the data is irrelevant, the whole the system. Position of the data is irrelevant, the whole
tag will be searched. tag will be searched.
@ -48,3 +136,10 @@ started will keep running until the end. Removing the tag
will be deactivated, as are the buttons for prev and next will be deactivated, as are the buttons for prev and next
track. You can disable locking mode by again scanning the track. You can disable locking mode by again scanning the
lock tag again. 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.