jacroe / pidora

A Raspberry Pi Radio. Includes Pandora (via pianobar) and NPR Hourly News
http://pidora.jacroe.com/
GNU General Public License v3.0
38 stars 12 forks source link

Works fine up until loading web page #42

Closed parkerlreed closed 10 years ago

parkerlreed commented 11 years ago

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.

jacroe commented 11 years ago

I was able to look through the install log of someone else's install, and I may have understood what's wrong.

Execute this command in a terminal: sudo apt-get install python-requests. Does it install or does it say it's already installed? If it does install a few packages, restart and it should work.

Let me know if it doesn't, and we'll try something else.

parkerlreed commented 11 years ago

Yes I installed that the first time the server tried to run. It said it was missing the requests module.

On Tue, Oct 22, 2013 at 8:56 PM, Jacob Roeland notifications@github.comwrote:

I was able to look through the install log of someone else's install, and I may have understood what's wrong.

Execute this command in a terminal: sudo apt-get install python-requests. Does it install or does it say it's already installed? If it does install a few packages, restart and it should work.

Let me know if it doesn't, and we'll try something else.

— Reply to this email directly or view it on GitHubhttps://github.com/jacroe/pidora/issues/42#issuecomment-26871301 .

jacroe commented 11 years ago

But you're still getting the same loading screen?

c0da commented 11 years ago

Hello jacroe!

Same problem here :( after installing python-requests and executing 'python hello.py', it takes a while to start pianobar, but finally pianobar starts playing music. If I refresh the webpage I see 'Pianobar is starting up...', and it seems the hello.py/cherryd process crashes (pianobar still running in the background) with the following message:

[25/Oct/2013:13:32:02] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0xd8e330>> 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'

[25/Oct/2013:13:32:02] 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'",)

[25/Oct/2013:13:32:02] ENGINE Bus STOPPING [25/Oct/2013:13:32:02] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8080)) already shut down [25/Oct/2013:13:32:02] ENGINE Stopped thread '_TimeoutMonitor'. [25/Oct/2013:13:32:02] ENGINE Bus STOPPED [25/Oct/2013:13:32:02] ENGINE Bus EXITING [25/Oct/2013:13:32:02] ENGINE Bus EXITED

I hope this information helps!

Best Regards, Coda

jacroe commented 11 years ago

I think I've fixed it.

  1. First, do apt-get remove python-requests. For some reason, this version doesn't work correctly.
  2. Install python-setuptools.
  3. Next, wget https://raw.github.com/pypa/pip/master/contrib/get-pip.py && sudo python get-pip.py.
  4. Finally, sudo pip install requests.

Or in one nice command: wget https://gist.github.com/jacroe/7245436/raw/eef603932e4406758a41a75999df6245633e4444/install-correct-requests.sh && bash install-correct-requests.sh. You shouldn't have to restart Pidora, but it may help.

I hope this solves these issues. Again, let me know if it doesn't.

parkerlreed commented 11 years ago

Sorry for the late reply. Haven't been able to find the SD card I had for the Pi. Will update when I can. Thanks for the response.

c0da commented 11 years ago

Thanks for your response jacroe! Unfortunately I'm still getting the same error :(

I've tried by removing pidora and pianobar and running the new install.sh script, but no luck on my side :(

Thanks for all the work you are doing!

c0da commented 11 years ago

By the way, I've also tried by following your latests instructions :P

Best Regards!

jacroe commented 11 years ago

@coda4k Dang. Could you start up your Pi, do a killall python and then run Pidora from the command line and post the output for me? At least up to when it does a POST /api?json=?

c0da commented 11 years ago

Sure! Here it is:

[31/Oct/2013:14:51:46] ENGINE Listening for SIGHUP. [31/Oct/2013:14:51:46] ENGINE Listening for SIGTERM. [31/Oct/2013:14:51:46] ENGINE Listening for SIGUSR1. [31/Oct/2013:14:51:46] ENGINE Bus STARTING [31/Oct/2013:14:51:46] ENGINE Started monitor thread '_TimeoutMonitor'. 213.112.21.108 - - [31/Oct/2013:14:52:02] "GET / HTTP/1.1" 200 1459 "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36" 213.112.21.108 - - [31/Oct/2013:14:52:02] "GET /imgs/love.png HTTP/1.1" 304 - "http://213.112.21.104:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36" 213.112.21.108 - - [31/Oct/2013:14:52:02] "GET /css/styles.css HTTP/1.1" 304 - "http://213.112.21.104:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36" 213.112.21.108 - - [31/Oct/2013:14:52:02] "GET /js/pidora.js HTTP/1.1" 304 - "http://213.112.21.104:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36" 213.112.21.108 - - [31/Oct/2013:14:52:02] "GET /imgs/pandora.png HTTP/1.1" 304 - "http://213.112.21.104:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36" 213.112.21.108 - - [31/Oct/2013:14:52:05] "GET /api?json=%7B%22method%22%3A%22GetSongInfo%22%2C%22id%22%3A1%7D HTTP/1.1" 200 117 "http://213.112.21.104:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36"

I hope it helps!! and thank you again!

jacroe commented 11 years ago

Thanks! But could you give me more? Specifically, until one of the lines look similar to this: 127.0.0.1 - - [31/Oct/2013:17:55:55] "POST /api?json=%7B%22songData%22%3A+%7B%22album%22%3A+%22Paramore%22%2C+%22loved%22%3A+true%2C+%22artist%22%3A+%22Paramore%22%2C+%22explainURL%22%3A+%22http%3A%2F%2Fwww.pandora.com%2Fparamore%2Fparamore%2Fstill-into-you%22%2C+%22title%22%3A+%22Still+Into+You%22%2C+%22songPlayed%22%3A+0%2C+%22artURL%22%3A+%22http%3A%2F%2Fcont-dc6-1.pandora.com%2Fimages%2Fpublic%2Famz%2F0%2F3%2F4%2F2%2F075678732430_500W_500H.jpg%22%2C+%22songDuration%22%3A+0%7D%2C+%22id%22%3A+1%2C+%22method%22%3A+%22SetSongInfo%22%7D HTTP/1.1" 200 52 "" "python-requests/2.0.0 CPython/2.7.3 Linux/3.8.0-32-generic"

c0da commented 11 years ago

Hello again, jacroe!

Ahhmm.. sorry, I don't see any line that looks like that one :( The last line I pasted (please see below) repeats maybe 20 or 30 times until the process dies with "ENGINE Error in 'start' listener" :(

213.112.21.108 - - [31/Oct/2013:14:52:05] "GET /api?json=%7B%22method%22%3A%22GetSongInfo%22%2C%22id%22%3A1%7D HTTP/1.1" 200 117 "http://213.112.21.104:8080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.114 Safari/537.36"

Best Regards!

jacroe commented 11 years ago

Can you please verify you can run pianobar itself? If it was set up correctly, you should be able to run pianobar from the command line and hear music playing without any user input.

c0da commented 11 years ago

yeap, it runs fine by itself :( even if I execute 'python hello.py', pianobar starts playing music after a while (I can see the process running in background), and it keeps playing music after the 'hello.py' process dies.

I hope it helps!

jacroe commented 10 years ago

The best I can suggest is to wipe and re-install Pidora from scratch. I simply cannot reproduce this on my end. I'm sorry about that.