{"id":4759,"date":"2017-11-12T19:45:30","date_gmt":"2017-11-12T18:45:30","guid":{"rendered":"http:\/\/www.doncorso.de\/dcwp\/?page_id=4759"},"modified":"2017-11-12T21:47:18","modified_gmt":"2017-11-12T20:47:18","slug":"die-musikbox","status":"publish","type":"page","link":"https:\/\/www.doncorso.de\/dcwp\/?page_id=4759","title":{"rendered":"die Musikbox"},"content":{"rendered":"<p><a href=\"#wasesist\">\u00a0Was es ist<\/a><br \/>\n<a style=\"font-size: 1rem;\" href=\"#wieesumgesetztist\">Wie es umgesetzt ist<\/a><br \/>\n<a href=\"#wasmannochmachenkoennte\">Was man noch machen k\u00f6nnte<\/a><br \/>\n<a style=\"font-size: 1rem;\" href=\"#wasdubrauchst\">Was Du brauchst<\/a><br \/>\n<a href=\"#nfcleserverkabelung\">NFC-Leser Verkabelung<\/a><br \/>\n<a href=\"#dieeinzelnenschritte\">Die einzelnen Schritte (f\u00fcr Dokumentation und Nachbau)<\/a><\/p>\n<hr \/>\n<h1 id=\"wasesist\">Was es ist<\/h1>\n<p>Die Musikbox soll es Kindern (nat\u00fcrlich genauso auch Senioren) erm\u00f6glichen, ohne technische Kenntnisse, ihre Lieblings-Musik bzw -H\u00f6rb\u00fccher o.\u00e4. abzuspielen. Daf\u00fcr wird alles auf eine m\u00f6glichst einfache und intuitive Benutzung ausgerichtet. Um ein H\u00f6rbuch abzuspielen, muss lediglich die Musikbox eingeschaltet und ein Gegenstand, der mit diesem H\u00f6rbuch assoziiert wird, auf ein markiertes Feld gestellt werden. Nimmt man den Gegenstand weg, pausiert der Abspieler und beim Zur\u00fcckstellen des Gegenstands wird die Wiedergabe fortgesetzt.<\/p>\n<p>Die Kosten liegen bei ungef\u00e4hr 45 Euro<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h1 id=\"wieesumgesetztist\">Wie es umgesetzt ist<\/h1>\n<ul>\n<li>Ein Raspberry Pi Version 2 oder 3 oder Pi Zero bootet ein Raspbian<\/li>\n<li>ein Benutzer wird automatisch angemeldet<\/li>\n<li>ein Auto-Start-Skript fragt st\u00e4ndig den NFC-Leser ab<\/li>\n<li>sobald der Leser ein NFC-Signal empf\u00e4ngt\n<ul>\n<li>wird entweder ein zuvor pausiertes Abspielen fortgesetzt<br \/>\noder:<\/li>\n<li>es wird gepr\u00fcft, ob dieser ID schon ein abzuspielendes Verzeichnis zugeordnet ist<\/li>\n<li>Ist noch kein Verzeichnis der ID zugeordnet, wird das n\u00e4chste, noch keiner ID zugeordnete Verzeichnis auf einem angeschlossenen USB-Stick dieser ID zugeordnet<\/li>\n<li>die erste Datei im zugeordneten Verzeichnis wird abgespielt und die folgenden Dateien werden in der Wiedergabeliste eingereiht<\/li>\n<\/ul>\n<\/li>\n<li>sobald der Leser kein NFC-Signal mehr empf\u00e4ngt\n<ul>\n<li>wird die Wiedergabe pausiert<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<hr \/>\n<h1 id=\"wasmannochmachenkoennte\">Was man noch machen k\u00f6nnte<\/h1>\n<ul>\n<li>Bootzeit optimieren<\/li>\n<li>Problem mit Umlauten und SOnderzeichen in Musik-Verzeichnisnamen<\/li>\n<li>Stromsparen\n<ul>\n<li>LEDs aus<\/li>\n<li>HDMI aus<\/li>\n<\/ul>\n<\/li>\n<li>NFC-Tag zum Herunterfahren festlegen<\/li>\n<li>Images f\u00fcr Zero und normale Pis gegenseitig testen und zusammenbringen<\/li>\n<li>auf Python- oder C-L\u00f6sung festlegen<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<hr \/>\n<h1 id=\"wasdubrauchst\">Was Du brauchst<\/h1>\n<ul>\n<li>Raspberry Pi (egal welche Version)<\/li>\n<li>Stromversorgung f\u00fcr den Pi<\/li>\n<li>bei dem Raspberry Zero wird zus\u00e4tzlich ben\u00f6tigt:\n<ul>\n<li>eine USB-Soundkarte (<a href=\"https:\/\/www.ebay.de\/itm\/USB-2-0-Mic-Speaker-3D-Soundkarte-Audio-Adapter-5-1-Konverter\/362008064868?hash=item54495cb364:g:MKoAAOSwRqBZn9Eu\">ebay-link<\/a>)<\/li>\n<li>otg-Kabel: micro USB auf mindestens 2 USB-Anschl\u00fcsse (<a href=\"https:\/\/www.ebay.de\/itm\/3-in-1-OTG-Kabel-Micro-USB-2-0-Stecker-Hub-Handy-Tablets-Host-Adapter-Smartphone\/262873953365?_trkparms=aid%3D222007%26algo%3DSIM.MBE%26ao%3D1%26asc%3D49132%26meid%3D0bdc4e79dfb64faf8c5eef49e72368cf%26pid%3D100011%26rk%3D1%26rkt%3D12%26sd%3D172290635172&amp;_trksid=p2047675.c100011.m1850\">ebay-Link<\/a>)<img decoding=\"async\" loading=\"lazy\" class=\"\" src=\"https:\/\/i.ebayimg.com\/images\/g\/T38AAOSwnTdZ5yBh\/s-l1600.jpg\" width=\"196\" height=\"130\" \/><\/li>\n<\/ul>\n<\/li>\n<li>micro sd Karte (4 GB oder gr\u00f6\u00dfer)<\/li>\n<li>USB-Stick (zum Speichern der abzuspielenden Musik)<\/li>\n<li>SD-Karten-Abbild - raspbian user: pi\u00a0 pass: R0teB0x\n<ul>\n<li>Pi Zero\u00a0\u00a0<a href=\"http:\/\/doncorso.de\/musikbox\/pizero_musikbox_dez_2016.7z\">DOWNLOAD HIER<\/a><\/li>\n<li>Pi V2 oder V3\u00a0 <a href=\"http:\/\/doncorso.de\/musikbox\/musikbox_2017-06-27.7z\">DOWNLOAD HIER<\/a><\/li>\n<\/ul>\n<\/li>\n<li>Lautsprecher mit Klinkenanschluss (bspw. klassische PC-Boxen)<\/li>\n<li>NFC-Leser: MIFARE RC522 Chip (<a href=\"https:\/\/www.ebay.de\/itm\/272262610222\">ebay-Link<\/a>)<\/li>\n<li>Regenbogen-Kabel weiblich-weiblich (<a href=\"https:\/\/www.ebay.de\/itm\/391332662648\">ebay-Link<\/a>)<\/li>\n<li>L\u00f6tkolben und L\u00f6tzinn<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h1 id=\"nfcleserverkabelung\">\u00a0NFC-Leser Verkabelung<\/h1>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignleft size-full wp-image-4766\" src=\"http:\/\/www.doncorso.de\/dcwp\/wp-content\/uploads\/2017\/11\/rfid_leser_verkabelung.png\" alt=\"\" width=\"398\" height=\"324\" srcset=\"https:\/\/www.doncorso.de\/dcwp\/wp-content\/uploads\/2017\/11\/rfid_leser_verkabelung.png 398w, https:\/\/www.doncorso.de\/dcwp\/wp-content\/uploads\/2017\/11\/rfid_leser_verkabelung-300x244.png 300w\" sizes=\"(max-width: 398px) 100vw, 398px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Use the following wiring:<\/b><\/h2>\n<table>\n<tbody>\n<tr>\n<td><b>RFID-RC522 Pin<\/b><\/td>\n<td><b>Raspberry PI Pin<\/b><\/td>\n<td><b>Raspberry PI Pin name<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">SDA\/NSS<\/span><\/td>\n<td><span style=\"font-weight: 400;\">24<\/span><\/td>\n<td><span style=\"font-weight: 400;\">GPIO8<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">SCK<\/span><\/td>\n<td><span style=\"font-weight: 400;\">23<\/span><\/td>\n<td><span style=\"font-weight: 400;\">GPIO11<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">MOSI<\/span><\/td>\n<td><span style=\"font-weight: 400;\">19<\/span><\/td>\n<td><span style=\"font-weight: 400;\">GPIO10<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">MISO<\/span><\/td>\n<td><span style=\"font-weight: 400;\">21<\/span><\/td>\n<td><span style=\"font-weight: 400;\">GPIO9<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">IRQ<\/span><\/td>\n<td><span style=\"font-weight: 400;\">None<\/span><\/td>\n<td><span style=\"font-weight: 400;\">None<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">GND<\/span><\/td>\n<td><span style=\"font-weight: 400;\">20<\/span><\/td>\n<td><span style=\"font-weight: 400;\">GND<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">RST<\/span><\/td>\n<td><span style=\"font-weight: 400;\">22<\/span><\/td>\n<td><span style=\"font-weight: 400;\">GPIO25<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">3.3V\/VCC<\/span><\/td>\n<td><span style=\"font-weight: 400;\">17<\/span><\/td>\n<td><span style=\"font-weight: 400;\">3V3<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<hr \/>\n<h1><\/h1>\n<h1 id=\"dieeinzelnenschritte\">die einzelnen Schritte (zwecks Doku und Nachbau)<\/h1>\n<p>Das folgende ist teilweise unvollst\u00e4ndig oder aus der Erinnerung dokumentiert. Es hilft sicher weiter, ist aber keine Schritt-F\u00fcr-Schritt-Durchklick-Anleitung.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>SPI aktivieren<\/strong><\/p>\n<p>Run sudo raspi-config,<br \/>\nchoose Advanced Options -&gt; SPI -&gt; Yes . You can reboot, but it isn't necessary (dtoverlay -l will show that there is a run-time overlay that enables the SPI interface).<\/p>\n<p>&nbsp;<\/p>\n<h2><b>Install git and python-dev:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">sudo apt-get update<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">sudo apt-get upgrade<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">sudo apt-get install python-dev git<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Install the SPI-Py library:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">git clone https:\/\/github.com\/lthiery\/SPI-Py.git<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">cd SPI-Py<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">sudo python setup.py install<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">cd ..<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Install MFCR522-python:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">cd ~<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">git clone https:\/\/github.com\/mxgxw\/MFRC522-python.git<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">cd MFRC522-python\/<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>Run the script:<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">sudo python Read.py<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><b>MusikBoxSkript automatisch starten <\/b><\/h2>\n<h2><b>benutzer automatisch einloggen lassen<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">sudo joe \/etc\/systemd\/system\/getty@tty1.service.d\/autologin.conf<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">[Service]<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">ExecStart=<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">ExecStart=-\/sbin\/agetty --autologin \"user account\" %I<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400;\"><br \/>\n<\/span><b>nach Benutzer-Login automatisch Skript starten<\/b><\/h2>\n<p><span style=\"font-weight: 400;\">joe \/home\/pi\/.profile<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><span style=\"font-weight: 400;\">bash \/home\/pi\/musikbox\/start.sh<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b>Umlaut-Fragezeichen-Dreck:<\/b><\/p>\n<p>sudo apt-get install convmv<\/p>\n<p>convmv -f iso-8859-15 -t utf8 -r \/Pfad\/zur\/Datei\/oder\/Ordner\/ --notest<\/p>\n<p>&nbsp;<\/p>\n<h1><b>GPIO f\u00fcr Knopf<\/b><\/h1>\n<p><b>echo 4 &gt;\/sys\/class\/gpio\/export<br \/>\n<\/b><b>echo in &gt;\/sys\/class\/gpio\/gpio4\/direction<br \/>\n<\/b><b>cat \/sys\/class\/gpio\/gpio4\/value<\/b><\/p>\n<p>&nbsp;<\/p>\n<h1><b>Audio standardm\u00e4\u00dfig auf USB-Soundkarte ausgeben<\/b><\/h1>\n<p><span style=\"font-weight: 400;\">sudo joe \/usr\/share\/alsa\/alsa.conf<\/span><\/p>\n<p><span style=\"font-weight: 400;\">defaults.ctl.card 0<br \/>\n<\/span><span style=\"font-weight: 400;\">defaults.pcm.card 0<\/span><\/p>\n<p><span style=\"font-weight: 400;\">\u00e4ndern auf:<\/span><\/p>\n<p><span style=\"font-weight: 400;\">defaults.ctl.card 1<br \/>\n<\/span><span style=\"font-weight: 400;\">defaults.pcm.card 1<\/span><\/p>\n<p>&nbsp;<\/p>\n<h1><b>c-Programm fuer RFID-Leseger\u00e4t<\/b><\/h1>\n<p><span style=\"font-weight: 400;\">quelle: http:\/\/www.nikolaus-lueneburg.de\/2014\/06\/rfid-rc522-modul-mit-spi-schnittstelle\/<\/span><\/p>\n<p><span style=\"font-weight: 400;\">F\u00fcr den Zugriff auf die Raspberry Pi Schnittstellen wird die C Bibliothek f\u00fcr den Broadcom BCM 2835 Chip ben\u00f6tigt.<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">wget http:\/\/www.airspayce.com\/mikem\/bcm2835\/bcm2835-1.50.tar.gz<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">tar -xzf .\/bcm2835-1.50.tar.gz<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">cd bcm2835-1.50\/<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">.\/configure<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">make<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">sudo make install<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">dann das c-Programm runterladen und bauen<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">wget https:\/\/storage.googleapis.com\/google-code-archive-source\/v2\/code.google.com\/rpi-rc522\/source-archive.zip<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">unzip source-archive.zip<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">cd rpi-rc522\/trunk\/rc522<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">gcc config.c rfid.c rc522.c main.c -o rc522_reader -lbcm2835<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">sudo cp RC522.conf \/etc\/<\/span><\/li>\n<li style=\"font-weight: 400;\"><span style=\"font-weight: 400;\">sudo .\/rc522_reader -d<\/span><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h1><b>alternativ: das Python-Dingen:<\/b><\/h1>\n<p><span style=\"font-weight: 400;\">sudo python \/home\/pi\/MFRC522-python\/Read.py<\/span><\/p>\n<p>&nbsp;<\/p>\n<h2><span style=\"font-weight: 400;\">das Paket usbmount<\/span><\/h2>\n<p>apt get install usbmount<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0Was es ist Wie es umgesetzt ist Was man noch machen k\u00f6nnte Was Du brauchst NFC-Leser Verkabelung Die einzelnen Schritte (f\u00fcr Dokumentation und Nachbau) Was es ist Die Musikbox soll es Kindern (nat\u00fcrlich genauso auch Senioren) erm\u00f6glichen, ohne technische Kenntnisse, ihre Lieblings-Musik bzw -H\u00f6rb\u00fccher o.\u00e4. abzuspielen. Daf\u00fcr wird alles auf eine m\u00f6glichst einfache und intuitive <a href=\"https:\/\/www.doncorso.de\/dcwp\/?page_id=4759\" class=\"more-link\">...weiterlesen<span class=\"screen-reader-text\"> \"die Musikbox\"<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":4751,"menu_order":10,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"_links":{"self":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/pages\/4759"}],"collection":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4759"}],"version-history":[{"count":16,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/pages\/4759\/revisions"}],"predecessor-version":[{"id":4777,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/pages\/4759\/revisions\/4777"}],"up":[{"embeddable":true,"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=\/wp\/v2\/pages\/4751"}],"wp:attachment":[{"href":"https:\/\/www.doncorso.de\/dcwp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}