tag:blogger.com,1999:blog-3283731055839367530.post5370805280239669297..comments2018-05-12T14:53:07.344+02:00Comments on Routerjanitor: Raspberry Pi - Music on holdJoris Van Schuerbeeckhttps://plus.google.com/112199693888637390091noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-3283731055839367530.post-77797135996900204262017-05-03T09:18:40.206+02:002017-05-03T09:18:40.206+02:00Thanks for the update, will be helpfull for some p...Thanks for the update, will be helpfull for some people. Raspbian has changed a bit in the last 3 years.Joris Van Schuerbeeckhttps://www.blogger.com/profile/10545937132352452234noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-50162340202478884132017-05-03T08:18:49.119+02:002017-05-03T08:18:49.119+02:00Success! There was more than one permission issue...Success! There was more than one permission issue that was blocking me, and there wasn&#39;t any feedback on screen until I started running the commands one by one to try and figure out why it wasn&#39;t working.<br /><br />Some keys to me getting mine working:<br /><br />I&#39;m not 100% sure how much of this was needed since I was throwing a bunch of stuff at the wall to see what would stick, but in case this may help someone in the future:<br /><br />- You need to grant yourself (&quot;pi&quot; user) execute permission (once) to the two automount scripts:<br /><br />sudo chmod +x /etc/./stopmusic<br />sudo chmod +x /etc/./restartmusic<br /><br />In /etc/mpd.conf , in addition to changing the music directory as listed on your page, I also changed the user from &quot;mpd&quot; to &quot;root&quot; (when set as mpd, music would not restart properly when the USB stick was inserted hot -- it would play about half a second and then stop -- it would play normally if the device was power cycled, however. When set to root, hot-swapping USB music drives works fine).<br /><br />Not sure if it&#39;s necessary, but when running many of the commands in those scripts on a one-off basis by typing them on the command line, I ran into permission errors on many of the commands. As such, I prefaced every command in both the stopmusic and restartmusic scripts with &quot;sudo &quot;.<br /><br />I was using a FAT32 formatted USB stick with mp3 files from my Windows PC, and initially had trouble getting the Pi to see any of the files on there. This may not be 100% necessary, but I added a few switches to the &quot;mount USB&quot; portion of /etc/./restartmusic -- my line there is as follows:<br /><br />sudo /bin/mount /dev/sda1 /mnt/usb -o uid=pi,gid=pi<br /><br />Supposedly that extra part at the end gives the &quot;pi&quot; user the ability to see the FAT32 files. I haven&#39;t gone back to try it without it, but I&#39;m kind of at the point of, &quot;if it ain&#39;t broke...&quot;<br /><br />The listall and add to playlist section wasn&#39;t actually listing the file playlist on screen. I added another listall command and now it does. This doesn&#39;t affect functionality, but it did help for troubleshooting. That section of the restartmusic script on my player looks like this:<br /><br />echo List files found and add to playlist<br />sudo /usr/bin/mpc listall | mpc add<br />sudo /usr/bin/mpc listall<br /><br />The list only displays if the command is run manually on the command line, but it was good to see that things were working correctly! (Now it displays the list upon booting, too, if a display is attached, per my modification to rc.local explained below.)<br /><br />As noted by &quot;penbrock&quot; on the page that brought me here, I added the following line to the end of the restartmusic script which ensures that &quot;repeat&quot; is turned on, and doesn&#39;t hurt it if it already was:<br /><br />sudo /usr/bin/mpc repeat on<br /><br />Finally, in /etc/rc.local , I opted to have it run the &quot;restartmusic&quot; script on startup rather than just the &quot;mpc play&quot; command, my thought process being that if the power is turned off and the USB drive is changed while the power is off, the player will try to play the old files upon startup since the playlist doesn&#39;t get re-indexed. Now it does, and it doesn&#39;t seem to cause problems if the Pi is started without a USB drive installed (it just gives a &#39;device not found&#39; error when trying to mount the USB drive). As such, in rc.local instead of /usr/bin/mpc play , I have the following:<br /><br />sudo /etc/./restartmusic<br /><br /><br />Thanks for this great article and a nice simple code to make it work. I wouldn&#39;t have known where to start without it.Kevinhttps://www.blogger.com/profile/11783306244549168108noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-62610614876377964112017-04-28T09:19:32.969+02:002017-04-28T09:19:32.969+02:00Shouldn&#39;t matter what USB port if I remember r...Shouldn&#39;t matter what USB port if I remember right, but just type &quot;mount&quot; and you should see where it got mounted ? If that&#39;s different it&#39;s easy to change the script.<br />(i&#39;m not sure if that got changed any way by using the GUI options).<br />Don&#39;t have one at hand at the moment to test myself, this wat a little project at my former place of work.Joris Van Schuerbeeckhttps://www.blogger.com/profile/10545937132352452234noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-56869037551723854252017-04-28T08:47:17.816+02:002017-04-28T08:47:17.816+02:00Sorry for the multiple replies. I realized somethi...Sorry for the multiple replies. I realized something which may be significant: I&#39;m attempting this project on a Raspberry pi 2 model B, which has four USB ports built in -- based on your image, you made your music player with an earlier pi board. I&#39;m guessing perhaps I need to specify which USB port will have the music files? I&#39;m a big n00b when it comes to pi.Kevinhttps://www.blogger.com/profile/11783306244549168108noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-33579598323298155022017-04-26T16:01:18.375+02:002017-04-26T16:01:18.375+02:00what&#39;s the output of mpc listall ?
Also reboot...what&#39;s the output of mpc listall ?<br />Also reboot and don&#39;t have a HDMI screen plugged in, you want the sound out of the jack.Joris Van Schuerbeeckhttps://www.blogger.com/profile/10545937132352452234noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-32276253442052990822017-04-26T11:22:10.656+02:002017-04-26T11:22:10.656+02:00Howdy. Thanks for this write-up. I&#39;ve follow...Howdy. Thanks for this write-up. I&#39;ve followed it step-by-step, but I&#39;m not getting any music from my Pi. :(<br /><br />I also used a NOOBS setup and the default installation of Raspbian that auto-launched (Debian jessie desktop version). I enabled SSH and then SSH-ed into it and did every step listed in this post, pasting most of the text so I wouldn&#39;t screw anything up.<br /><br />The first time I inserted the USB drive I was in the default desktop GUI, and a &quot;Removable medium inserted&quot; pop-up appeared asking me to select the action to perform (the only choice was &quot;Open in File Manager&quot;).<br /><br />I tried changing the settings so that it boots to the command line rather than the GUI, and that worked, but it still doesn&#39;t play anything when it boots.<br /><br />If I manually type &quot; mpc play &quot;, the following appears on screen:<br />volume: n/a repeat: off random: off single: off consume: off<br /><br />...but no music plays, and I&#39;m just quickly given another command prompt.<br /><br />I can see that the rc.local command is being issued, as near the end of the boot process is the same line of text that appears after I manually type &quot; mpc play &quot;.<br /><br />Any thoughts?<br /><br />There are three mp3s on the USB drive I&#39;m using, and I do still have the keyboard and mouse attached to the Pi, if that makes a difference. Am I missing something stupid? Thanks in advance.Kevinhttps://www.blogger.com/profile/11783306244549168108noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-73704334216256458372016-05-23T17:42:00.304+02:002016-05-23T17:42:00.304+02:00Hi,
it&#39;s a 2014 image, so you&#39;re better o...Hi,<br /><br />it&#39;s a 2014 image, so you&#39;re better off installing the latest rasbian and going from there, there&#39;s only a few commands to do.Joris Van Schuerbeeckhttps://www.blogger.com/profile/10545937132352452234noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-77151327345134492232016-05-23T17:41:47.331+02:002016-05-23T17:41:47.331+02:00Hi,
it&#39;s a 2014 image, so you&#39;re better o...Hi,<br /><br />it&#39;s a 2014 image, so you&#39;re better off installing the latest rasbian and going from there, there&#39;s only a few commands to do.Joris Van Schuerbeeckhttps://www.blogger.com/profile/10545937132352452234noreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-84003544490609129082016-03-31T19:56:01.177+02:002016-03-31T19:56:01.177+02:00Would love an iso of this too! :)Would love an iso of this too! :)Chrisnoreply@blogger.comtag:blogger.com,1999:blog-3283731055839367530.post-55403777239407848222016-02-25T20:30:08.760+01:002016-02-25T20:30:08.760+01:00anyone have a iso image of this
anyone have a iso image of this<br />Anonymousnoreply@blogger.com