Code Monkey home page Code Monkey logo

pidora's People

Contributors

billchurch avatar jacroe avatar kylejohnson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pidora's Issues

Move away from Apache and PHP

Apache and PHP were chosen at the beginning of this project because they were easy to install and set up. However, their benefits may be overshadowed some by their weaknesses.

  • While I adore PHP (for better or for worse), it really is a web language. And having to deal with two fundamentally different languages, such as PHP and Python, is annoying.
  • Apache is a great web server. But it running as a different user makes it hard to interact with pianobar beyond the ctl interface.

For these reasons, we're going to move away from them and use a Python web framework such as CherryPy or web.py. This will allow tighter integration, an easier install process, and cleaner code (hopefully).

  • Command->ChangeStation
  • Add start and quit buttons to interface
  • Song explanation bug
  • Mobile

Stats

Add some fun stats such as number of minutes listening to music, number of songs loved and banned and shelved, etc.

api.php not interacting correctly with msg

I'm running into a problem where api.php is creating a msg file that it cannot interact with, and am wondering what I can do to fix this. Also affects curSong and stationList. The only way I've been able to fix it so far is to rm the file or chown/chmod the file so api.php can interact with it. Not sure how I can resolve this issue elsewise. Also, does not seem to be resuming properly after playing NPR news. Running debian wheezy, set up semiproperly.
shown below:

root@icecube:/opt/lampp/htdocs/pidora# ls -ll
total 2492
-rwxrwxrwx 1 nobody 6226 35147 Mar 27 21:10 LICENSE
-rwxrwxrwx 1 nobody 6226 3113 Mar 27 21:10 README.md
drwsrwsrwx 2 nobody 6226 4096 May 23 00:38 albumart
-rwxrwxrwx 1 nobody 6226 3268 May 22 21:54 api.php
prwxrwxrwx 1 nobody 6226 0 May 23 00:38 ctl
-rw-r----- 1 root 6226 229 May 23 00:42 curSong
drwsrwsrwx 2 nobody 6226 4096 Mar 27 21:10 inc
-rwxrwxrwx 1 nobody 6226 3089 May 22 04:47 index.php
-rwxrwxrwx 1 nobody 6226 1 May 23 00:37 lastNews
drwsrwsrwx 2 nobody 6226 4096 Mar 27 21:10 lib
-rwxrwxrwx 1 nobody 6226 2315 Mar 27 21:10 mobile.php
-rwxrwxrwx 1 nobody 6226 2468301 May 23 00:37 newscast.mp3
drwsrwsrwx 2 nobody 6226 4096 May 22 04:11 pianobar-eventcmd
-rw-r----- 1 root 6226 285 May 23 00:38 stationList

Also with update.py, it seems to have trouble following the correct NPR news feed and/or playing too often.

Traceback (most recent call last):
File "/root/.config/pianobar/update.py", line 31, in
urllib.urlretrieve(feed.entries[0].id, www + "newscast.mp3")
File "/usr/lib/python2.7/urllib.py", line 93, in urlretrieve
return _urlopener.retrieve(url, filename, reporthook, data)
File "/usr/lib/python2.7/urllib.py", line 239, in retrieve
fp = self.open(url, data)
File "/usr/lib/python2.7/urllib.py", line 207, in open
return getattr(self, name)(url)
File "/usr/lib/python2.7/urllib.py", line 344, in open_http
h.endheaders(data)
File "/usr/lib/python2.7/httplib.py", line 958, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 818, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 780, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 761, in connect
self.timeout, self.source_address)
File "/usr/lib/python2.7/socket.py", line 553, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
IOError: [Errno socket error] [Errno -2] Name or service not known

Works fine up until loading web page

Start server, music plays, load web page, web page comes up, has basic controls in the upper left, am able to click those controls, but after a few seconds they fade away and it displays

"Hello There

Pianobar is starting up..."

Pianobar is already running and working. Tried loading page in Chrome on my laptop.

EDIT: And I see this issue has been mentioned before but I do not see an update.py file anywheree.

PianoBar Install Part Fails

I know that this is more directly related to Pianobar but since it causes your installer to fail I thought I would pass the issue in here. So when doing the git clone of Pianobar and it runs the build the Pianobar build fails with

Makefile:103: *** Please choose a valid libav implementation by setting LIBAV.  Stop.

If I open the Makefile in Pianobar and set the value in there no matter what I set it to nothing works. IT will fail as below. Let me know if you have any ideas.

pi@raspberrypi ~/pianobar $ make
Makefile:103: *** Please choose a valid libav implementation by setting LIBAV.  Stop.
pi@raspberrypi ~/pianobar $ nano Makefile
pi@raspberrypi ~/pianobar $ make
Package libavcodec was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavcodec.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavcodec' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package libavutil was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavutil.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavutil' found
Package libavfilter was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavfilter.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavfilter' found
Package libavcodec was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavcodec.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavcodec' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package libavutil was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavutil.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavutil' found
Package libavfilter was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavfilter.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavfilter' found
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.c:35:32: fatal error: libavcodec/avcodec.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
Package libavcodec was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavcodec.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavcodec' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package libavutil was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavutil.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavutil' found
Package libavfilter was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavfilter.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavfilter' found
Package libavcodec was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavcodec.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavcodec' found
Package libavformat was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavformat.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavformat' found
Package libavutil was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavutil.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavutil' found
Package libavfilter was not found in the pkg-config search path.
Perhaps you should add the directory containing `libavfilter.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libavfilter' found
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
src/player.c:35:32: fatal error: libavcodec/avcodec.h: No such file or directory
compilation terminated.
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
    CC  src/main.c
In file included from src/main.h:30:0,
                 from src/main.c:57:
src/player.h:34:34: fatal error: libavfilter/avfilter.h: No such file or directory
compilation terminated.
make: *** [src/main.o] Error 1
pi@raspberrypi ~/pianobar $

Local Host Error

Hi I have installed pianobar and all of the code that was added but when I type Startx on my Pi it boots up then brings up a screen that says it cant find http://localhost/8080 or something along those lines...Is there anything im doing wrong? How would I get to to the webpage/what would I type in the adress bar on my computer to get to the webinterface that will let me control Pandora like pause and play?

Thanks,
Cameron2621

"Love" ,"Tired" messages aren't fading out

I have everything but the "Love" ,"Tired" messages working on my pi. After I click the "Love" or "Tired" buttons in my browser, pianobar is updated correctly and the message is displayed in my browser, but it never goes away until I delete the msg file created in my pidora directory. Artwork and song info all work great until the the msg file is created. As a temporary work around I commented out those last few lines of update.py. It works ok now, other than I don't get any message now.

Any ideas?

Grabbing explanation for comedy

Check the last element and make sure it doesn't say something like "other comedic similarities". If it does, replace "Music Genome Project" with that.

What is Midori

What is Midori? you reference it in the set up but never state how to install it or configure it or even where to download it from. Please update the Readme file.

Album Art is stuck

Pidora is great! Exactly what I was looking for to tinker with streaming Pandora to my home audio system through a Raspberry Pi.

Everything seems to be working with my configuration except the album art displays one artist but doesn't change with the song. Maybe this is a permissions issue? I changed the owner to my user account with permissions granted.

Thanks!

Install script illegal option -n

Full text:

After selecting the station, pianobar will print the station's name and a long ID number. This will be the default station. Copy that number to the clipboard.
Press q to quit at any time.
./install.sh: 35: read: Illegal option -n

Welcome to pianobar (2013.09.15-dev)! Press ? for a list of commands.

JSONify api

  • Song info
  • Index page
  • Explanation
  • Message
  • Mobile page
  • Station list

Figured out how to launch pianobar from pidora website

Not sure if this is the best method, but i installed libssh2-1-dev libssh2-php
restarted apache2
tested and verified that php see's the ssh2 extension

added the code below as a stand off file and just executed it from index.php.
Love Your Work on the Pidora Website!!! the Living Room Pi is connected directly to the receiver and is just for Pidora web ui. I went in and made some buttons so my Fiance would like it more. She loves not having to hook her Iphone up to the receiver to listen to her Pandora now!

<?php
if (!function_exists("ssh2_connect")) die("function ssh2_connect doesn't exist");
// log in at server1.example.com on port 22
if(!($con = ssh2_connect("server1.example.com", 22))){
    echo "fail: unable to establish connection\n";
} else {
    // try to authenticate with username ,password 
    if(!ssh2_auth_password($con, "username", "password")) {
        echo "fail: unable to authenticate\n";
    } else {
        // allright, we're in!
        echo "okay: logged in...\n";

        // execute a command
        if (!($stream = ssh2_exec($con, "pianobar" ))) {
            echo "fail: unable to execute command\n";
        } else {
            // collect returning data from command
            stream_set_blocking($stream, true);
            $data = "";
            while ($buf = fread($stream,4096)) {
                $data .= $buf;
            }
            fclose($stream);
        }
    }
}
?>

Document which Raspberry Pi distro install.sh works with

Can you let us know which distro you're using to develop with? I prefer Raspbian, but I can tell by reading install.sh that it's not going to work with the latest version of Raspbian (particularly the 'build pianobar' part).

No audio with OMXplayer

Same issue as #27

I have removed midori from the auto start because I am using the videoloop.sh to open omxplayer to play a video on a loop @ startup.

Autostart

@lxpanel --profile LXDE
@pcmanfm --desktop --profile LXDE
@xscreensaver -no-splash
rm /home/pi/pidora/curSong.json
@python /home/pi/pidora/hello.py

@midori -a "http://localhost:8080/" -e Fullscreen

@sh /home/pi/videoloop.sh

Not displaying current song information

Followed all steps outlined in the readme but I can't get Pianobar to display anything but the "Hello There Pianobar is starting up" screen. The Play, Next, Love, Ban, and Tired buttons work as they should, but the current song information and album artwork don't display.

Two things that might be important:
First, each time the song changes, Pianobar prints the following line to the terminal:
"ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unkown PCM cards.pcm.front"

Second, here is the directory structure I am using:
/home/pi/public_html/pidora/
In which public_html is my www directory (i.e. The current default apache site uses public_html as DocumentRoot and Directory, as per the Ubuntu tutorial you linked to).
I've edited the third line in update.py to read "www= "/home/pi/public_html/"" (step 6 in the readme).

Thanks for your detailed instructions.

SOLVED:
line in update.py should have read "www= "/home/pi/public_html/pidora/""

Change README to use git clone

We can tell the README to use git clone https://github.com/jacroe/pidora.git to download everything. And since everything is already configured for the Pi, it's really easy to use (and to place inside a install script).

Do I just install it and it works?

Hi! I'm currently using Pianobar and Pianobar Remote, but I'm unhappy with it because it will abruptly stop playing after ~24 hours.

I heard about this project, but I have no idea how it works, and can't seem to find an answer. Do I just install it based on the instructions, nothing else needed? Then, how do I interface with it in order to change stations, etc?

Also, the instructions talk about preventing the screen from going blank. However, my RPi is a headless installation. I do not have a GUI installed. Is that a problem? Can I just ignore those steps?

I'll be donating if it works for me :)

Mobile disabled?

Hi there... I hate to post another, but I have a question. Why does the mobile interface say that controls are disabled?

Way to remove NPR

Hi there! Is there a way I can remove NPR? I love the idea, but it doesn't fit with where I'm playing Pandora. Thanks a ton!! I love the project, keep up the amazing work!

NPR Volume way lower

Wondering if there is anything that can be done to boost the volume level of the NPR broadcast. It is significantly quieter than the music. When Pandora is at a background volume level the NPR News is almost impossible to hear.

No audio

When I run hello.py, the webserver starts just fine and connects to pandora just fine (or so it seems, since a song title appears and the controls work), but sound is played through neither the analog audio jack nor hdmi. If I run pianobar by itself, it works fine. Any ideas on what could be wrong?

Pidora not starting on reboot and other issues

Hello again! Entirely possible this is my fault again, but right now Pidora isn't restarting. When I restart my RPi and go to IPADDRESS:8080, nothing is being hosted unless I run python ./pidora/hello.py manually. Maybe it's a problem with:

echo "rm $HOME/pidora/curSong.json
@python $HOME/pidora/hello.py
@midori -a \"http://localhost:8080/\" -e Fullscreen" | sudo tee -a /etc/xdg/lxsession/LXDE/autostart

Could it be a problem with the fact that I have a headless install and do not use LXDE?

Also, when I start Pidora manually with python ./pidora/hello.py and access it from my laptop's browser (Chrome), I get stuck with "Pianobar is starting up" and eventually the ssh session ends with an error:

117 "http://192.168.16.49:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.11 Safari/537.36"                                                                                                    
[24/Dec/2013:04:31:12] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0xde01f0>>                                                                                                                 
Traceback (most recent call last):                                                                                        
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 197, in publish                                                 
    output.append(listener(*args, **kwargs))                                                                               
  File "/home/pi/pidora/cherrypy/_cpserver.py", line 151, in start
    ServerAdapter.start(self)
  File "/home/pi/pidora/cherrypy/process/servers.py", line 174, in start
    self.wait()
  File "/home/pi/pidora/cherrypy/process/servers.py", line 214, in wait
    wait_for_occupied_port(host, port)
  File "/home/pi/pidora/cherrypy/process/servers.py", line 427, in wait_for_occupied_port
    raise IOError("Port %r not bound on %r" % (port, host))
IOError: Port 8080 not bound on '0.0.0.0'

[24/Dec/2013:04:31:12] ENGINE Shutting down due to error in start listener:
Traceback (most recent call last):
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 235, in start
    self.publish('start')
  File "/home/pi/pidora/cherrypy/process/wspbus.py", line 215, in publish
    raise exc
ChannelFailures: IOError("Port 8080 not bound on '0.0.0.0'",)

[24/Dec/2013:04:31:12] ENGINE Bus STOPPING
[24/Dec/2013:04:31:12] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down
[24/Dec/2013:04:31:12] ENGINE Stopped thread '_TimeoutMonitor'.
[24/Dec/2013:04:31:12] ENGINE Bus STOPPED
[24/Dec/2013:04:31:12] ENGINE Bus EXITING
[24/Dec/2013:04:31:12] ENGINE Bus EXITED

Thanks in advance for your help.

Add station changing

pianobar returns all of the stations for us. Let's make a station changer.

  1. User presses "s" key.
  2. List of stations come up along with a number beside them. Probably 0-9 with the ability to push "m" to see more. (If you had station 1 and station 12, after pushing the "1" key, would play the first station before you have a chance to push "2". So we need pagination.)
  3. Send "s12" to FIFO.

Phone not going to mobile site

For some reason my Galaxy S III is not going to the mobile site. I am running latest cyanogenmod on it android 4.3. Is this a work in progress still?

TLS read failed

Hey there...

I'm getting the dreaded "Login... Network error: TLS read failed."

I've tried every solution I can find, including the one you posted - to no avail. It's happened on both of my Pi's, so I don't think it's a local issue.

Any solutions? This just now started happening the other day.

Thanks so much, you're the best!

Step 6 of Readme file is too vague

Step 6 is too vague. first off i dont have a sample eventcmd file to base my file on. It would be nice if you can add a sample file in your project that i can then copy to the correct destination. Secondly, what python script are you referencing? you state that this file should point to the python script but dont give any clarification as to what python script or even how to point to this script from the eventcmd file. Please update your readme file.

6.Edit your pianobar config file by adding the fifo and event_command variables and their location. The event_command should point to the Python script.

Song Explanation

Explore the use of being able to display the song's explanation.

"no such file or directory" in update.py

Very cool project, but I'm having some trouble. I've done this twice on two different raspbian installs, neither one works.

Pianobar works fine, and in the browser, the index.php comes up, but it never gets past " Hello There Pianobar is starting up..."

I am not using midori from localhost, I'm hitting it from another computer, while ssh in to RPi to see what's going on.

Here's what's happening on pianobar console -- this demonstrates that it is picking up my config file, where i've specified the fifo and the update.py location. Furthermore, when I change the config entry (thats supposed to point to update.py) to a nonexistent file, I get a different error.

Welcome to pianobar (2012.05.06)! Press ? for a list of commands.
(i) Control fifo at /var/www/ctl opened
(i) Login... Ok.
: No such file or directory
(i) Get stations... Ok.
: No such file or directory

Then it starts playing my playlist. But index.php page still shows "hello there..."

Any ideas?

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.