<?xml-stylesheet type="text/xsl" href="https://community.element14.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><description>Project Components 


 Required Software 


 Python Script 

 Code explanation 

 Custom bitmaps 


 MPC status 


 Event listener 



 Full code 


 Autostart 



 Demo 

 I recently worked with the PiFace Control and Display for my Santa Catcher , in</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Thu, 26 May 2016 17:17:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I have got a piface display 2, when I try to run the script I have an error&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Traceback (most recent call last):&lt;/p&gt;&lt;p&gt;&amp;nbsp; File &amp;quot;/python/radio.py&amp;quot;, line 131, in &amp;lt;module&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cad = pifacecad.pifacecad()&lt;/p&gt;&lt;p&gt;AttributeError: &amp;#39;module&amp;#39; object has no attribute &amp;#39;pifacecad&amp;#39;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have the same problem as Jaroslaw&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please Help&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Sun, 17 Apr 2016 17:27:19 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I have got a piface display 2, when I try to run the script I have an error&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Traceback (most recent call last):&lt;/p&gt;&lt;p&gt;&amp;nbsp; File &amp;quot;/python/radio.py&amp;quot;, line 131, in &amp;lt;module&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cad = pifacecad.pifacecad()&lt;/p&gt;&lt;p&gt;AttributeError: &amp;#39;module&amp;#39; object has no attribute &amp;#39;pifacecad&amp;#39;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;How to do this right, how to write the script?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Mon, 04 May 2015 12:34:12 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Cool introduction.&lt;br /&gt;I had, however a &amp;quot;TypeError: expected an object with the buffer interface&amp;quot; on every line with a find() method on the return of the subprocess() method.&lt;/p&gt;&lt;p&gt;Reason: subporcess() always returns bytecode unless you give it an argument &amp;#39;universal_newlines=True&amp;#39;.&lt;/p&gt;&lt;p&gt;So, eg the function &lt;span&gt;display_volume() &lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span&gt;is now:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;def display_volume():&lt;/p&gt;&lt;p&gt;&amp;nbsp; volume = subprocess.check_output(&amp;quot;mpc status | grep volume&amp;quot;, shell=True, stderr=subprocess.STDOUT)&lt;/p&gt;&lt;p&gt;&amp;nbsp; volume = volume[7:volume.find("%")+1]&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; cad.lcd.set_cursor(12, 1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; cad.lcd.write(volume)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;and it should be:&lt;/p&gt;&lt;p&gt;def display_volume():&lt;/p&gt;&lt;p&gt;&amp;nbsp; volume = subprocess.check_output(&amp;quot;mpc status | grep volume&amp;quot;, shell=True, stderr=subprocess.STDOUT, universal_newlines=True)&lt;/p&gt;&lt;p&gt;&amp;nbsp; volume = volume[7:volume.find("%")+1]&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp; cad.lcd.set_cursor(12, 1)&lt;/p&gt;&lt;p&gt;&amp;nbsp; cad.lcd.write(volume)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Add the argument in all occurences of your code and you&amp;#39;ll be fine..&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;ERwin&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Sun, 15 Feb 2015 21:40:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>rudibarani</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hi Frederick,&lt;/p&gt;&lt;p&gt;I had this great script running for some time as our internet radio on a raspberry pi + piface. Since a recent update of the raspberry pi introduced &lt;strong&gt;device tree&lt;/strong&gt;, I can only use it if I disable the device tree using raspi-config. Took me some time to figure this out.&lt;/p&gt;&lt;p&gt;As disabling the device tree is mentioned to be a temporary feature - what do I have to change to keep it running with device tree enabled? I don&amp;#39;t know much about programming for raspi pi yet - but I am willing learn it. &lt;/p&gt;&lt;p&gt;Thank you very much!&lt;/p&gt;&lt;p&gt;Phillip&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Tue, 30 Sep 2014 16:28:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;If I wanted to modify the code so that the first line of text reflected the station information and he second scrolled the name of the song, h&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Mon, 15 Sep 2014 20:12:18 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hallo Frederick,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks for your responds,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I have already run the radio.py with stand in:&lt;/p&gt;&lt;p&gt;/usr/share/doc/python3-pifacecad/examples!!!!!!!!!!!!!!!!!!!!!!!!!!&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I start your script an d get errors:&lt;/p&gt;&lt;p&gt;syntaxerror in line 4 I put a space between subprocess and from, but now is the syntax error in time.&lt;/p&gt;&lt;p&gt;I put a # before the line with syntax error.&lt;/p&gt;&lt;p&gt;now a syntax error in 35, 40(elif), 82 and then 5 module not exist.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks, already,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Adrie van der Nat&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Fri, 12 Sep 2014 22:12:47 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hallo Frederick,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I try it&amp;nbsp; 4 days, every day 4 hours.&lt;/p&gt;&lt;p&gt;To install OS and Python3&amp;nbsp; is no problem.&lt;/p&gt;&lt;p&gt;Now I get the problem that the mplayer do&amp;#39;nt install Stop at 1 %.&lt;/p&gt;&lt;p&gt;I&amp;nbsp; did sudo apt-get install mplayer. start but stop at 1%.&lt;/p&gt;&lt;p&gt;I an 70 years old, I was teacher, also ICT, but not Linux.&lt;/p&gt;&lt;p&gt;I help much persons with desktop etc. Now I nedd help.Sorry&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Greetings,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Adrie&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Fri, 12 Sep 2014 17:33:51 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Maby someone can make th image for me for 10 Euro.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Please email me, Thanks, Adrie&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Tue, 09 Sep 2014 09:24:14 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Hallo Frederick,&lt;/p&gt;&lt;p&gt;I just start with mine Rasberry and I am also abot 70 Years.&lt;/p&gt;&lt;p&gt;Is it possible that I can download a ready immage (Dropbox, google box etc.)&lt;/p&gt;&lt;p&gt;For i tried to do it myself, but do&amp;#39;nt succeed.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Already thanks.&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Adrie&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;a class="jive-link-email-small" href="mailto:aavandernat@quicknet.nl"&gt;aavandernat@quicknet.nl&lt;/a&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Sun, 07 Sep 2014 15:56:25 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>dragonstyne</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Great work Frederick. It looks good too. &lt;/p&gt;&lt;p&gt;I may have to try this. You have peaked my curiosity. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thank you,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;-Steve&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Thu, 04 Sep 2014 11:51:22 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Hallo,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Look nice, Thanks.&lt;/p&gt;&lt;p&gt;With wich image you start on the SD?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Greetings,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Adrie&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Sun, 29 Jun 2014 15:55:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I think it is possible. If you run &amp;quot;mpc status&amp;quot; you will see some info about radio station and most of them shows the song name currenly playing so you can parse it from that status string.&lt;/p&gt;&lt;p&gt;Regards.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: Internet Radio Player with Raspberry Pi, PiFace CAD and MPD/MPC</title><link>https://community.element14.com/products/raspberry-pi/raspberrypi_projects/b/blog/posts/internet-radio-player-with-raspberry-pi-piface-cad-and-mpd-mpc</link><pubDate>Wed, 30 Apr 2014 08:31:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2be5c102-1749-458d-8439-50070d30a942</guid><dc:creator>e14 Contributor</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;Great project! Is it possible to show RDS info on the display?&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=16974&amp;AppID=84&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>