{"id":200,"date":"2015-01-31T22:33:45","date_gmt":"2015-01-31T22:33:45","guid":{"rendered":"http:\/\/coffeefueledcreations.com\/blog\/?p=200"},"modified":"2016-09-26T16:58:13","modified_gmt":"2016-09-26T15:58:13","slug":"moppyjukebox","status":"publish","type":"post","link":"http:\/\/coffeefueledcreations.com\/blog\/?p=200","title":{"rendered":"MoppyJukebox"},"content":{"rendered":"<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/86dk50GFMkE?feature=player_detailpage\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n<p>A Stand Alone Musical Floppy Jukebox<\/p>\n<p>I saw a video of some Musical Floppies and thought &#8220;Yea, I could get in on that&#8221;.<\/p>\n<p>By mashing some stuff together and with some overarching Java code here is a self contained MoppyJukebox.<!--more--><\/p>\n<p>What was Used:<br \/>\nRaspberry Pi<br \/>\n-Rasbian<br \/>\n-Java 1.8.0-b132<br \/>\n$ sudo apt-get update &amp;&amp; sudo apt-get install oracle-java7-jdk<br \/>\n-Arduino SDK Installed<br \/>\n$ sudo apt-get install arduino<br \/>\n-pi4j<br \/>\n$ curl -s get.pi4j.com | sudo bash<br \/>\nArduino<br \/>\nFloppy Disk Drives<br \/>\nPower Supply<br \/>\n-With Some Molex to Floppy Adapters<br \/>\nSome sort of VFD\/LCD 20&#215;2<br \/>\n3 x Push Buttons<\/p>\n<p>My code extends and uses the MoppyDesk code provided by IAmSammy. All the source code is here: <a title=\"SammyIAm\" href=\"https:\/\/github.com\/SammyIAm\/Moppy\">https:\/\/github.com\/SammyIAm\/Moppy<\/a><br \/>\n(What a great person!)<\/p>\n<p>Unzip the source files, import the src\/ directory into your eclipse workspace and attach the necessary libraries.<\/p>\n<p><a title=\"MoppyJukebox Source\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/7683699\/moppyjukebox.zip\" target=\"_blank\">moppyjukebox.zip<\/a><\/p>\n<p>The following libraries will need adding to the Java Build Path:<\/p>\n<ul>\n<li>pi4j-core.jar<\/li>\n<li>pi4j-device.jar<\/li>\n<li>pi4j-gpio-extension.jar<\/li>\n<li>pi4j-service.jar<\/li>\n<li>RXTXcomm.jar<\/li>\n<\/ul>\n<p>pi4j Version: 0.0.5<br \/>\nRXTX Version: 2.2pre2<\/p>\n<p>I had 8 Drives available to me so I went ahead and created a 6 Drive MoppyJukebox (I killed 2 of them). Most of the information needed to get the initial drives setup can be found on <a title=\"SammyIAm\" href=\"https:\/\/github.com\/\/Moppy\" target=\"_blank\">SammyIAm&#8217;s site<\/a>. But as a quick reference for myself here&#8217;s a recap.<\/p>\n<p>Wireing:<br \/>\nPin 11\/12: Drive Select<br \/>\nPin 17: GND<br \/>\nPin 18: Direction (Green)<br \/>\nPin 19: GND<br \/>\nPin 20: Step (Yellow)<br \/>\n<a href=\"http:\/\/46.32.240.35\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2014\/10\/Moppy-Wireing.png\"><img loading=\"lazy\" class=\"aligncenter size-large wp-image-202\" src=\"http:\/\/46.32.240.35\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2014\/10\/Moppy-Wireing-1024x942.png\" alt=\"Moppy Wireing\" width=\"960\" height=\"883\" \/><\/a>Do this for each drive moving up the Arduino pins.<\/p>\n<p>Trick the PSU into supplying power without a Motherbord (At own risk!)<br \/>\nConnect green to black (14\/15) <a title=\"PSX Enable Image\" href=\"http:\/\/www.techpowerup.com\/articles\/other\/22\">Reference<\/a><\/p>\n<p>The Pi is wired up like this:<\/p>\n<p><a href=\"http:\/\/46.32.240.35\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2015\/02\/MoppyPi2.png\"><img loading=\"lazy\" class=\"aligncenter size-large wp-image-248\" src=\"http:\/\/46.32.240.35\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2015\/02\/MoppyPi2-1024x822.png\" alt=\"MoppyPi2\" width=\"960\" height=\"771\" srcset=\"http:\/\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2015\/02\/MoppyPi2-1024x822.png 1024w, http:\/\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2015\/02\/MoppyPi2-300x241.png 300w, http:\/\/coffeefueledcreations.com\/blog\/wp-content\/uploads\/2015\/02\/MoppyPi2.png 1899w\" sizes=\"(max-width: 960px) 100vw, 960px\" \/><\/a>I&#8217;m using a VFD so I have no backlight. If you are using a LCD with backlight remember to wire in the LED. Currently 20&#215;2 is hard coded.<\/p>\n<p>The buttons are in the order you would expect, from left to right: Previous,\u00a0 Play\/Stop, Next.<\/p>\n<p>Here is a link to the jar that needs to be run on the Raspberry Pi.<br \/>\nSource code can be found <a title=\"MoppyJukebox\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/7683699\/moppyjukebox.zip\" target=\"_blank\">here<\/a>.<\/p>\n<p><a title=\"MoppyJukebox Jar\" href=\"https:\/\/dl.dropboxusercontent.com\/u\/7683699\/moppyjukebox.jar\" target=\"_blank\">MoppyJukebox.jar<\/a><\/p>\n<p>Or from the pi<\/p>\n<p><code>$ wget https:\/\/dl.dropboxusercontent.com\/u\/7683699\/moppyjukebox.jar<\/code><\/p>\n<p>On the pi this jar needs to be run with Super User privileges to access the pi4j stuff. Also the RXTX library .so files need to be included in the library path<\/p>\n<p><code>$ sudo java -Djava.library.path=\/usr\/lib\/jni\/ -jar moppyjukebox.jar<br \/>\n<\/code><br \/>\nIf you get the following error messages you need to link the RXTX .so files in the java library path.<br \/>\n<code>java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while loading gnu.io.RXTXCommDriver<br \/>\nException in thread \"main\" java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path<br \/>\n<\/code><br \/>\nWhen the program starts up it will setup the com port for communication with the Arduino running <a href=\"https:\/\/github.com\/SammyIAm\/Moppy\" target=\"_blank\">SammyIAm&#8217;s code<\/a>. This port can change and is configurable with config.properties file.<\/p>\n<p>Next it will run away to find the midis to play. The midi files need to be named in a specific way so that both the top line is the artist and the bottom is the song.<\/p>\n<p><code>Artist Name$$Track Name.mid<\/code><\/p>\n<p>Note: for long song\/artist names there is text scrolling.<\/p>\n<p>The midi files should be placed in the following directory:<\/p>\n<p><code>\/opt\/moppyjukebox<\/code><\/p>\n<p>This directory can be made with these commands:<\/p>\n<p><code>$ sudo mkdir moppyjukebox<br \/>\n$ chmod -R 0777 moppyjukebox\/<\/code><\/p>\n<p>I&#8217;m not worried about file security as I have no services running, you may want to be a little stricter with file permissions.<\/p>\n<p>Now naturally I want this thing to be stand alone, turn it on and go. To automatically run the jar file on boot I used a cron job.<br \/>\n<code><br \/>\n$ sudo crontab -e<\/code><\/p>\n<p>and added the following line (My moppyjukebox.jar is in \/opt\/moppyjukeboxbin):<br \/>\n<code><br \/>\n@reboot \/usr\/bin\/java -classpath \/opt\/moppyjukeboxbin -Djava.library.path=\/usr\/lib\/jni\/ -jar \/opt\/moppyjukeboxbin\/moppyjukebox.jar<br \/>\n<\/code><br \/>\nI think that&#8217;s pretty much it.<br \/>\n<iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/CEz70uOASFw?feature=player_detailpage\" width=\"640\" height=\"360\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>A Stand Alone Musical Floppy Jukebox I saw a video of some Musical Floppies and thought &#8220;Yea, I could get in on that&#8221;. By mashing some stuff together and with some overarching Java code here is a self contained MoppyJukebox.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,4,5,7,8],"tags":[],"_links":{"self":[{"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/200"}],"collection":[{"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=200"}],"version-history":[{"count":1,"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions"}],"predecessor-version":[{"id":323,"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/200\/revisions\/323"}],"wp:attachment":[{"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=200"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=200"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/coffeefueledcreations.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=200"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}