jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Pidora: My Pandora radio

Fri Oct 26, 2012 6:52 am

This isn't nearly as neat or cool as some of the other projects being shown in this forum, but I figure I'll show what I've thrown together.

Pidora uses pianobar and a small PHP web app to play music from a Pandora radio station over HDMI (since we have that analog audio bug I couldn't make it headless yet). Basically you give it internet, a tv or monitor, and power and you'll have Pandora music being played with a minimal display showing the current track's information and albumart. Really simple but I'm proud of it. I'd like to know what you think.

Here's a screenshot and I've put my code up on Github

bababooey
Posts: 4
Joined: Wed Sep 19, 2012 4:05 pm

Re: Pidora: My Pandora radio

Sun Nov 18, 2012 6:22 pm

Thanks! Was able to get it working in a few minutes.

I'm playing the toddlers station in pandora, have wifi connect to the PI and some cheap speakers to play songs in the babys room headless. You mention audio problems and using HDMI but I'm using the 3.5mm jack out and some speakers.

It would be cool to be able to start/stop pianobar as well as change stations from the web GUI.

OUT.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Mon Nov 19, 2012 2:56 am

Wow, I'm so glad you were able to use it, and for your baby no less. That's incredible. Oh I totally wanted it to be headless from the get-go, and I'm so excited that you're able to get it working with analog audio without any hitches. Awesome!

If you did follow all the instructions and have the webserver set up, you can go to it's IP address and see what's playing in real-time. And then, if you tack on "api.php?control=[Command]" to the end of the URL, you'll be able to control it that way. For example: "p" plays and pauses the music, "n" goes to the next song, "q" quits pianobar, etc. You can look in the man file for pianobar for all the commands. Eventually, I'll want to add a way to do this other than access that URL manually.

Another option would be SSH'ing into the box, killing pianobar and then re-executing it. Then you'll be able to control and see all the log information coming from pianobar. If I'm feeling picky at work, I'll use this method.

bababooey
Posts: 4
Joined: Wed Sep 19, 2012 4:05 pm

Re: Pidora: My Pandora radio

Mon Nov 19, 2012 4:39 pm

Yeah the webpage works, I can see who is playing currently. Thanks for the command info, I'll give that a shot.

Ideally I would like to have a web GUI to control the headless pandora box, simple enough my wife can operate with her smart phone or laptop without having to know ssh etc..

I've searched around a bit and Pidora and Pianobar is about all I could find. Are there any other apps I should take a look at?

Thanks.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Mon Nov 19, 2012 9:45 pm

If you'll give me some time, I can easily add controls. That's something I wanted to do anyway. What all do you need? Play/Pause, Next, Thumbs Up and Down, Tired. What else?

I'll be getting out of university for Thanksgiving on Wednesday. I should be able to build it in then.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Pidora: My Pandora radio

Tue Nov 20, 2012 8:19 pm

Nice little app, controls would be great! What you listed as controls are pretty much what is needed, maybe the ability to change a station.

Boomer
Posts: 80
Joined: Thu Sep 06, 2012 3:22 pm

Re: Pidora: My Pandora radio

Wed Nov 21, 2012 12:57 am

Can you help the computer-challenged by giving us instructions how to download and install the program?

Thanks,

Jack

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Sat Nov 24, 2012 4:33 am

ski522 wrote:Nice little app, controls would be great! What you listed as controls are pretty much what is needed, maybe the ability to change a station.
I'm currently working on the controls right now. The back-end is finished, but I'm still deciding how I want to have them be displayed, trying to figure out how to make them appear only when needed. Easy with a mouse, slightly harder on touch devices.
Boomer wrote:Can you help the computer-challenged by giving us instructions how to download and install the program?
Sure. You'll need to be comfortable with the command-line, but if you are it's real easy. You can get the code from Github (https://github.com/jacroe/pidora/), and then all you have to do is follow the README. The easiest way I've found to download it is to install git on the Pi and then

Code: Select all

git clone git://github.com/jacroe/pidora.git
into the web-server's directory.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Pidora: My Pandora radio

Sat Nov 24, 2012 11:27 am

jacroe wrote: I'm currently working on the controls right now. The back-end is finished, but I'm still deciding how I want to have them be displayed, trying to figure out how to make them appear only when needed. Easy with a mouse, slightly harder on touch devices.
I was working on modifying this app to be used with Pianobar, it's a front end for mplayer. Might provide some help.
http://sourceforge.net/projects/mywebplayer/

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Pidora: My Pandora radio

Sat Dec 01, 2012 12:46 pm

Curious to know if you got an further along?

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Tue Dec 04, 2012 8:38 am

I took a look at MyWebPlayer and creating sockets seems to be a little bit of overkill. We already use a FIFO with PHP's file_put_contents. And running another program (albeit a shell script) could turn into another point of failure if you use the controls religiously.

That said, the general concept and feel of the program is great. Since his stuff is all GPL'd, I'll probably copy his icons and create a small mobile page to use. So thanks for that; I've been looking for some icon images.

I've also added keyboard shortcuts to the main interface in addition to the controls at the top right.. You can now [p]ause, go to the [n]ext song, [l]ove it, an it, or say that you're [t]ired of it. I find it useful to be able to Alt-Tab over the interface and then press a key instead of using a mouse.

jjj
Posts: 1
Joined: Sat Dec 01, 2012 7:50 pm

Re: Pidora: My Pandora radio

Mon Dec 10, 2012 10:30 pm

Thanks You for your work,
I have your app working nicely. I noticed that on your github page you recently added mousetrap.js. I haven't figured out how to use this. I'm not sure if this is keyboard shortcut for the keyboard attached to the pi, or the computer of the browser connecting. Could you please add instructions? Thanks again

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Tue Dec 11, 2012 3:02 am

jjj wrote:I noticed that on your github page you recently added mousetrap.js. I haven't figured out how to use this. I'm not sure if this is keyboard shortcut for the keyboard attached to the pi, or the computer of the browser connecting. Could you please add instructions? Thanks again
Yeah no problem. So Mousetrap is a client-side program that makes it ridiculously easy to assign keyboard shortcuts to Javascript functions. So for instance, you can press the "p" key to pause it. Or press "b" to ban the song.

You'll want to do this on the computer that you're viewing the website on. For instance, if you have Pidora playing on a media centre and you're viewing the website on your laptop, you'll control it via your laptop. And if you look above at my previous post, you'll see the five commands that I currently have in it. I hope that explains it enough for you.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Fri Dec 14, 2012 1:32 am

bababooey wrote:Ideally I would like to have a web GUI to control the headless pandora box, simple enough my wife can operate with her smart phone or laptop without having to know ssh etc..
ski522 wrote:Curious to know if you got an further along?
Now that I'm out for Christmas break I've been able to finish building the controls.

If you get the latest from the repo, I've added a slim mobile interface. Purely textual. It should work fine on any device, including mobile phones. I've also made the links for controlling the main interface less hidden; they're now on permanent display. Let me know if this covers everything you need.

Next, I'll be working on being able to change stations.

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Pidora: My Pandora radio

Wed Dec 26, 2012 4:50 pm

Just want to say thanks, great little app! Just got a chance to take a look at it again over the holidays!

compuguy
Posts: 25
Joined: Thu Jan 24, 2013 5:26 am

Re: Pidora: My Pandora radio

Wed Jan 30, 2013 4:31 am

Just got this working on my RasPi, but I'm having one issue with it. After pushing like it outputs this error: "Warning: unlink(msg): Permission denied in /home/pi/www/pidora/api.php on line 25". Any idea why this occurs? Everything else seems to work but this...

Edit: Found out that this was a permission based issue, and that it wanted write access in order to write and delete a file in the directory. What would be a great addition would be the ability to start or stop pianobar.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Thu Feb 14, 2013 8:38 am

New feature: Song Explanations. By pressing "e" on the keyboard, we'll display the song's features as identified by the Music Genome Project. I'll be working on station changing next. If you want more features, submit a feature request at GitHub. https://github.com/jacroe/pidora

Thank y'all for your continuing interest; it's absolutely awesome that someone else found this little script useful.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Thu Feb 14, 2013 8:45 am

compuguy wrote:What would be a great addition would be the ability to start or stop pianobar.
That's definitely in the works. Until then though, pausing it is just as effective. And if it stays paused for long enough, on unpause pianobar will dump the old playlist and start playing a new one due to a timeout.

But yes, stopping/restarting pianobar (and perhaps other musical services) is planned.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Thu Feb 21, 2013 12:30 am

You can now change the station via the web interface. Pressing "s" or clicking "Station" will give you a list of your stations and by clicking or keypressing will change it. Enjoy.

morbidpete
Posts: 4
Joined: Thu Mar 21, 2013 2:13 pm

Re: Pidora: My Pandora radio

Thu Mar 21, 2013 8:24 pm

Thanks for this!
This was my first attempt at doing anything with a Rpi. Granted it took me 7.5 hours to get it going. Its going. We are now ordering 23 pi's for all our locations! to be able to control the music from the main office.

Now I just need to figure out the audio pops while using the analog out :-(

ski522
Posts: 394
Joined: Sun Sep 30, 2012 2:22 pm

Re: Pidora: My Pandora radio

Thu Mar 21, 2013 10:52 pm

morbidpete wrote:Thanks for this!
This was my first attempt at doing anything with a Rpi. Granted it took me 7.5 hours to get it going. Its going. We are now ordering 23 pi's for all our locations! to be able to control the music from the main office.

Now I just need to figure out the audio pops while using the analog out :-(
This is a problem with the sound driver itself, make sure you're up to date with the latest firmware, otherwise USB soundcard will solve the popping problem.

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Fri Mar 22, 2013 2:24 am

morbidpete wrote:We are now ordering 23 pi's for all our locations! to be able to control the music from the main office.
...I'm speechless. That's incredible. Dude, you've got to let me know how that turns out. :D

morbidpete
Posts: 4
Joined: Thu Mar 21, 2013 2:13 pm

Re: Pidora: My Pandora radio

Mon Mar 25, 2013 3:20 pm

jacroe wrote:
morbidpete wrote:We are now ordering 23 pi's for all our locations! to be able to control the music from the main office.
...I'm speechless. That's incredible. Dude, you've got to let me know how that turns out. :D
will do, The boss is very impressed with the stability and web controls as basic as they are. But basic is good for him. I had a 3 day drill weekend and came back today to find it still going strong. No outages or issues reported.

oddly enough, Cant hear the pop between songs. The amp must be filtering it 8-)

jacroe
Posts: 16
Joined: Fri Oct 26, 2012 6:39 am
Location: Lake Mary, FL
Contact: Website

Re: Pidora: My Pandora radio

Thu Mar 28, 2013 12:20 am

A small, but cool (or, I think it is) update: Pidora will now play NPR's Daily News Summary as it becomes available each hour. This turns Pidora from simply being a Pandora client to being a more modern radio. After the 5 minute broadcast, the music comes right back. If you wish to update your installation, install the packages "python-feedparser" and "mpg123" from the repo, and overwrite update.py.

There's also the ability to quit from the web interface by pressing "q". This also clears all the cached albumart to free up space.

morbidpete
Posts: 4
Joined: Thu Mar 21, 2013 2:13 pm

Re: Pidora: My Pandora radio

Fri Mar 29, 2013 1:45 pm

jacroe wrote:A small, but cool (or, I think it is) update: Pidora will now play NPR's Daily News Summary as it becomes available each hour. This turns Pidora from simply being a Pandora client to being a more modern radio. After the 5 minute broadcast, the music comes right back. If you wish to update your installation, install the packages "python-feedparser" and "mpg123" from the repo, and overwrite update.py.

There's also the ability to quit from the web interface by pressing "q". This also clears all the cached albumart to free up space.
can we restart it after we use "q" to quit? I noticed the only way to get new stations to show in the list is to restart the service

Return to “Media centres”