Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raspberry Pi Issues #102

Open
natn opened this issue Apr 9, 2018 · 2 comments
Open

Raspberry Pi Issues #102

natn opened this issue Apr 9, 2018 · 2 comments

Comments

@natn
Copy link

natn commented Apr 9, 2018

I have moved over a bunch of code from my dev system to a Raspberry Pi 2 and have run into a couple of issues.

  1. Discovery is very unreliable for color bulbs, while the Tile in the same configuration is discovered much more reliably (pretty much always). I have switched to directly specifying the MAC and IP and using the appropriate constructor for the lights in my configuration for now. This is working, but even then my code is requiring multiple constructor retries before all the bulbs are properly recognized. On my dev system (very high end system, running windows, etc, so about as different as it could get), this rarely happened with the bulbs in this config. I am going to try to eliminate as much obvious stuff as I can (networking, WiFi signal strength, etc) but am wondering if anyone else has seen this.

  2. When tile_chain.project_matrix(matrix, duration_ms, rapid=True) is executed in my code the RPi seems to be consuming more CPU (100% when doing back to back requests) than I would expect. I probably did not see this on my dev system as its likely orders of magnitude faster than the Raspberry Pi. Maybe I just can't push the RPi that much, but I'm hoping there is some optimization yet to do.

@natn
Copy link
Author

natn commented Apr 14, 2018

I haven't really found an answer to the discovery issues I am having, but I have a workaround that is acceptable for now anyway. Since I am working with a fixed set of lights in a fixed configuration, I run an initial discovery script for the bulbs in the setup, retrying until I get them all. Once I make it through discovery without an exception I put all the lights into a list and pickle pickle.dump("mylights",open(mylights.p","wb")) it. I run this code manually on the RPi.

Then when the RPi boots it runs my main code and un-pickles the list mylights = pickle.load(open("mylights.p","rb")). This bypasses the whole discovery thing for normal operation so everything starts up nice and fast.

I then need to rerun the discovery script if I change the lights, but at least for now the configuration is static.

@mclarkk
Copy link
Owner

mclarkk commented Apr 16, 2018

How does the discovery process fail? I assume WorkflowExceptions...are they always in response to a particular kind of message? Have you tried increasing the default timeout in device.py?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants