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

Bulbs are detected, but no actions work #1

Closed
timothyb89 opened this issue May 22, 2014 · 14 comments
Closed

Bulbs are detected, but no actions work #1

timothyb89 opened this issue May 22, 2014 · 14 comments
Assignees
Labels

Comments

@timothyb89
Copy link
Owner

No description provided.

@timothyb89 timothyb89 self-assigned this May 22, 2014
@Na3blis
Copy link

Na3blis commented May 23, 2014

Same issue. Tried all 3 options, on, off, toggle with no results. Also when I select configure again it goes back to default settings instead of selecting the current options I just choose.
Stock Nexus 5

@timothyb89
Copy link
Owner Author

To clarify, how are you "confirming" or exiting from the bulb picker and the action config form? Are you using the system back button, or the check mark on the action bar?

Apologies if this seems silly, but I'm trying to determine if it's a UI bug.

@timothyb89
Copy link
Owner Author

I've published an update that may resolve the issue, please let me know if it still occurs.

@Na3blis
Copy link

Na3blis commented May 24, 2014

The UI issue seems to partially be fixed. It now displays that I have 4 bulbs selected when I go to Configuration it displays the proper selection and says I have 4 bulbs selected. But when I go to edit the selection it is off. For example, if I select 1 bulb, it properly says so. But then when I edit again it now shows all 4 bulbs selected. Also, I seem to have to start up lifx initially for the bulbs to start showing up, though I may not be giving them enough time to be found? Also if I select none and hit the check, then it goes back to previous screen giving the invalid selection error and still says 1 bulb selected (as it should given the error). But then when going back in to edit them it has nothing checked instead of all 4 checked like before the error despite 1 being selected. Aside from those issues, the actions still don't work after the update. If I can help in any way let me know.

@timothyb89
Copy link
Owner Author

Issue #2 seems to be solved which was a pretty big contributing factor to this bug. Unfortunately actions are still broken and I've hit a bit of a wall in finding the problem, although it definitely seems to be related to having multiple bulbs.

I have another bulb coming in the mail in a couple of days so I should be able to reproduce the issue for myself, with any luck it should get the fix moving a lot faster.

@ahmadtawakol
Copy link

Actions are working for me though. I have two bulbs, and they're both being controlled fine. I do see them both with the same name, and the first button toggles them BOTH on and off, while the second button doesn't do anything. This only started happening after the last update.

@timothyb89
Copy link
Owner Author

It might be a strange question, but are the bulbs near each other? Like, in the same room, same light fixture, something like that? It's possible this has to do with issue #4 and gateway bulb discovery.

It's a bit tricky to figure out, but this may be related to how the bulbs form mesh networks. The specifics don't seem to be documented (at all, anywhere) but I'd guess they need to be in a fairly close proximity to one another to create a mesh network. If there's no other bulbs around, it'll configure itself as a "gateway" bulb which other nearby bulbs can connect to later. We then search for these gateway bulbs and send commands through them to other bulbs.

Right now the plugin only finds the first "gateway" bulb on your network, so consequently it'll only see the bulbs connected to that gateway. In other words, the plugin will only find some random gateway on your network, and any bulbs connected directly to it.

If you end up with multiple bulb groups (a.k.a. "mesh networks", "gateway bulbs", ...), it's fairly random which responds first when the plugin starts searching the network, save for the usual factors in WiFi latency (distance, interference...). This has a few effects:

  • The bulb list will randomly be missing bulbs - they're attached to a different "gateway" bulb that we ignored
  • Actions will only work when we find the same gateway that we found while configuring the action

At any rate, it's possible fixing issue #4 will also solve this. I'll work on getting a test build done in the next day or so and we can see what happens!

@ahmadtawakol
Copy link

Oh, now I understand. That does make sense. Yes the bulbs are in the same
room.

I haven't looked through your code, but when I was making a simple ruby
script to control the bulbs, if I didn't add a wait of 3-5 seconds after
starting discovery, it sometimes wouldn't find all the bulbs.

Maybe that would help you somehow.

On May 28, 2014, at 3:39 AM, Tim Buckley notifications@github.com wrote:

It might be a strange question, but are the bulbs near each other? Like, in
the same room, same light fixture, something like that? It's possible this
has to do with issue #4
https://github.com/timothyb89/lifx-tasker/issues/4and gateway bulb
discovery.

It's a bit tricky to figure out, but this may be related to how the bulbs
form mesh networks. The specifics don't seem to be documented (at all,
anywhere) but I'd guess they need to be in a fairly close proximity to one
another to create a mesh network. If there's no other bulbs around, it'll
configure itself as a "gateway" bulb which other nearby bulbs can connect
to later. We then search for these gateway bulbs and send commands through
them to other bulbs.

Right now the plugin only finds the first "gateway" bulb on your network,
so consequently it'll only see the bulbs connected to that gateway. In
other words, the plugin will only find some random gateway on your network,
and any bulbs connected directly to it.

If you end up with multiple bulb groups (a.k.a. "mesh networks", "gateway
bulbs", ...), it's fairly random which responds first when the plugin
starts searching the network, save for the usual factors in WiFi latency
(distance, interference...). This has a few effects:

  • The bulb list will randomly be missing bulbs - they're attached to a
    different "gateway" bulb that we ignored
  • Actions will only work when we find the same gateway that we found
    while configuring the action

At any rate, it's possible fixing issue
#4https://github.com/timothyb89/lifx-tasker/issues/4will also solve
this. I'll work on getting a test build done in the next
day or so and we can see what happens!


Reply to this email directly or view it on
GitHubhttps://github.com//issues/1#issuecomment-44370706
.

@timothyb89
Copy link
Owner Author

Possible test build to fix this and issue #4: https://drive.google.com/file/d/0B30rtS9KioFNXzIyMjd5SDJrekk/edit?usp=sharing

@Na3blis
Copy link

Na3blis commented May 30, 2014

After the latest build, it only finds one bulb, and seems to cause an issue with groups within the app. After trying to use it, the Lifx app temporarily seems to lose it's group settings. So all my lights in the bedroom group are no longer in the group for some reason (though the group and bulbs all show up in their app). Then after some indeterminate amount of time, they are back in the group. But then if I try to use the latest build to toggle my lights it happens again.

@timothyb89
Copy link
Owner Author

I just got my second bulb in the mail today, so I'll work on attempting to reproduce. So far I've noticed that 2 gateways - each with one bulb - do seem to work properly (at least in my setup - still not sure if those are all the variables of interest). Both bulbs are detected and actions seem to be working correctly.

I'll work on trying to get them to connect to each other (1 gateway, 2 bulbs) to see if that changes anything, though I honestly expected that to have been the default case. It may take some tinkering to convince them to form into a mesh.

Your logs indicated only 1 gateway had been found. This ... shouldn't happen. I suspect there may be some errors in the background being eaten by the logging framework. I'll work on switching to something different that won't keep eating the log output from lifx-java (see issue #6) and move forward from there.

@timothyb89
Copy link
Owner Author

Alright, new test build here: https://drive.google.com/file/d/0B30rtS9KioFNdGdIbnZGVFNQMUE/edit?usp=sharing

This doesn't change much except for logging. A logfile named lifx-tasker.log is now written to the root of your user storage (/sdcard/lifx-tasker.log or /storage/emulated/0, etc). You can email me this logfile (or post it here, pastebin, etc - it shouldn't contain anything sensitive now) directly from any file manager app.

I believe the extra logging info will be helpful in figuring out what's going on here. The previous logging library was silencing all of the log output from the lifx library and presumably eating a number of error messages. This particular situation should be much improved now, however, and will hopefully make it a lot easier to submit logs.

Apologies for the slow progress on this. This is my first real experience with Android dev and it turns out that remote debugging is a lot trickier than I had expected! With any luck this'll be solved soon!

@timothyb89
Copy link
Owner Author

I have been able to reproduce bulb actions applying to all bulbs on a gateway and was able to trace the issue to a bug in lifx-java (see issue #4). It should be fixed in this latest test build: https://drive.google.com/file/d/0B30rtS9KioFNc0ZVa0tMbFlPQlU/edit?usp=sharing

Let me know if it improves anything!

@timothyb89
Copy link
Owner Author

I've pushed an update to the Play Store which appears to resolve the issue. I'm closing this for now, please let me know if it comes up again!

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

No branches or pull requests

3 participants