kershner / screenBloom

Fake Ambilight for Philips Hue via Python
http://www.screenbloom.com
329 stars 48 forks source link

not working on macOS Sierra #15

Closed stephanvane closed 7 years ago

stephanvane commented 7 years ago

Hi,

this project doesn't seem to work on macOS Sierra (10.12). The app runs (even though the dock-icon displays Application Not Responding), but after a while it just displays the following error in the browser:

Error - 500

Internal Server Error
Sorry about that!
Error Text:

<urlopen error [Errno 60] Operation timed out>

I'd love to help debugging, but Python development has been a while for me. Any pointers on running the project from source would be welcome :)

kershner commented 7 years ago

Hey there!

Sorry you're having problems running ScreenBloom. First thing, can you send me the contents of your screenbloom_config.cfg file? It is located inside the ScreenBloom package contents. I believe it's in the /MacOS folder and will be mixed in with all the rest of the files.

stephanvane commented 7 years ago

Hi, Thanks for the quick reply!

I found the cfg file inside the .app. I noticed that the file is not inside the MacOS folder, but that it's called MacOS\screenbloom_config.cfg (see screenshot) image

These are the contents of the cfg file:

[Configuration]
hue_ip = 192.168.0.2
username = 7rFbM5194mcClFVBfUBSpgoUYT2xKxrz705etOmu
auto_start = 0

[Light Settings]
all_lights = 1,3,2,5,4
active = 0,0,0,0,0
update = 0.7
update_buffer = 0
default = 255,226,168
max_bri = 254
min_bri = 1
zones = []
zone_state = 0
black_rgb = 1,1,1
display_index = 0

[Party Mode]
running = 0

[App State]
running = 0

Editing this file to match my hue's IP address / username didn't work. Neither did moving the cfg file to the MacOS folder. Are there any logs available we could look into to?

kershner commented 7 years ago

Everything looks normal. You won't need to change any values here, they're auto-set by the Hue handshake process. So you might want to re-gen the file (delete it and re-run ScreenBloom) if you can't undo the changes.

Next thing is to try accessing the SB sites in a few different browsers, and also try to visit the URLs manually - I've had reports from users that this fixes the issue for them.

Also, is there anything out of the ordinary about your Hue setup? For example, maybe a light that is still registered with the bridge that no longer functions for one reason or another?

kershner commented 7 years ago

Oh one more thing - if you want to get the full error message causing the failure, just run the screenbloom.exec file also located where you found the config file. That will launch ScreenBloom with the Python console up so you should be able to get a stack trace. Post that here if you end up going this route.

stephanvane commented 7 years ago

Hi @kershner, thanks for the explanation. I ran Screenbloom with the Python console. After waiting around a minute I get the following error:

➜  MacOS ./screenBloom
Config already exists
ERROR:__main__:Exception on / [GET]
Traceback (most recent call last):
  File "flask/app.py", line 1817, in wsgi_app
  File "flask/app.py", line 1477, in full_dispatch_request
  File "flask/app.py", line 1381, in handle_user_exception
  File "flask/app.py", line 1475, in full_dispatch_request
  File "flask/app.py", line 1461, in dispatch_request
  File "<string>", line 46, in index
  File "modules/screenbloom_functions.py", line 586, in get_index_data
    lights = get_lights_data(hue_ip, username)
  File "modules/screenbloom_functions.py", line 173, in get_lights_data
    result = bridge.light.get(resource)
  File "beautifulhue/api/_light.py", line 37, in get
  File "beautifulhue/libs/http.py", line 45, in get
  File "beautifulhue/libs/http.py", line 35, in _request
  File "urllib2.py", line 154, in urlopen
  File "urllib2.py", line 431, in open
  File "urllib2.py", line 449, in _open
  File "urllib2.py", line 409, in _call_chain
  File "urllib2.py", line 1227, in http_open
  File "urllib2.py", line 1197, in do_open
URLError: <urlopen error [Errno 60] Operation timed out>

Fortunately, deleting the config file solved everything!

No idea where the problematic config file came from. The same thing happened on my other computer (macOS Sierra as well).

Thank you so much for the help and keep up the good work! Awesome project :)

kershner commented 7 years ago

Glad you got it sorted. Yep looks like some of the light data got corrupted somehow so the Hue API wasn't able to reach some lights and then timing out. This will be useful in coming up with a more elegant error handler.

Thanks again for the help with debugging!

stephanvane commented 7 years ago

Hi, I've got some extra info that might be of help:

For me everything works perfectly now, so again thanks for the help. Good luck with further development, I hope I can ben of help in the near future (brushing up my python first)

kershner commented 7 years ago

Wow you're totally right lol. I must've forgotten to remove my dev config file. What an idiot.

Just spliced that out of the archive and re-uploaded it to the site. I'll take a look at the regen config functionality, you can tell I don't use the Mac version that much heh. Thanks again for the help!