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

Pidora not starting on reboot and other issues #48

Open taylorkline opened 10 years ago

taylorkline commented 10 years ago

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.

jacroe commented 10 years ago

I've seen other people have this same issue, and I simply haven't seen it yet. I'm not going to say it's unreproducible yet because I'm going to try wiping the Pi and installing from install.sh and maybe that'll produce the bug.

Can you give me an update on this? Is it still occurring?

taylorkline commented 10 years ago

Yes, I was unfortunately never able to determine the cause.

jacroe commented 10 years ago

You wouldn't happen to know of anything else on your Pi that's already using port 8080 do you?

jacroe commented 10 years ago

It looks like port 8080 is already bound to by some other program/service. You could try using a different port number (anything over 1024) by changing it in cpy.conf and bar-update.py. And then running python hello.py. If it's a port binding issue, that would (read: should) solve it.

taylorkline commented 10 years ago

I'll try that next week over spring break and report back!

On February 21, 2014 2:01:02 PM Jacob Roeland notifications@github.com wrote:

It looks like port 8080 is already bound to by some other program/service. You could try using a different port number (anything over 1024) by changing it in cpy.conf and bar-update.py. And then running python hello.py. If it's a port binding issue, that would (read: should) solve it.


Reply to this email directly or view it on GitHub: https://github.com/jacroe/pidora/issues/48#issuecomment-35767572

taylorkline commented 10 years ago

Unfortunately, no luck with that:

[16/Mar/2014:01:16:41] ENGINE Listening for SIGHUP.
[16/Mar/2014:01:16:41] ENGINE Listening for SIGTERM.
[16/Mar/2014:01:16:41] ENGINE Listening for SIGUSR1.
[16/Mar/2014:01:16:41] ENGINE Bus STARTING
[16/Mar/2014:01:16:41] ENGINE Started monitor thread '_TimeoutMonitor'.
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET / HTTP/1.1" 200 1459 "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /css/styles.css HTTP/1.1" 200 667 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /imgs/love.png HTTP/1.1" 200 1037 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /js/pidora.js HTTP/1.1" 200 6316 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /imgs/pandora.png HTTP/1.1" 200 82708 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:55] "GET /imgs/favicon.ico HTTP/1.1" 200 15086 "" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
192.168.1.124 - - [16/Mar/2014:01:16:58] "GET /api?json=%7B%22method%22%3A%22GetSongInfo%22%2C%22id%22%3A1%7D HTTP/1.1" 200 117 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
.
.
.
192.168.1.124 - - [16/Mar/2014:01:18:20] "GET /api?json=%7B%22method%22%3A%22GetSongInfo%22%2C%22id%22%3A1%7D HTTP/1.1" 200 117 "http://192.168.1.147:8111/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.149 Safari/537.36"
[16/Mar/2014:01:18:22] ENGINE Error in 'start' listener <bound method Server.start of <cherrypy._cpserver.Server object at 0x14152f0>>
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 8111 not bound on '0.0.0.0'

[16/Mar/2014:01:18:22] 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 8111 not bound on '0.0.0.0'",)

[16/Mar/2014:01:18:22] ENGINE Bus STOPPING
[16/Mar/2014:01:18:22] ENGINE HTTP Server cherrypy._cpwsgi_server.CPWSGIServer(('0.0.0.0', 8111)) already shut down
[16/Mar/2014:01:18:22] ENGINE Stopped thread '_TimeoutMonitor'.
[16/Mar/2014:01:18:22] ENGINE Bus STOPPED
[16/Mar/2014:01:18:22] ENGINE Bus EXITING
[16/Mar/2014:01:18:22] ENGINE Bus EXITED
pjz commented 10 years ago

I had a similar issue where it wouldn't start at startup because the network stack wasn't fully initialized; I wrote a little start-pidora script that was:

#!/bin/bash
export PATH=${PATH}:/usr/local/bin
while ! ping -c 1 8.8.8.8 >/dev/null 2>&1 ; do
  sleep 1
done
cd /home/pi/pidora
python hello.py >/tmp/pidora.log 2>&1 

Which fixed it for me. YMMV.