Closed mrose17 closed 10 years ago
Oh, well, I can help with number one, if only for development purposes. On a different login, cd steward/node_modules/lifx; sudo node ./cli.js You don't need to type any keys. It starting up is sufficient to cause the bulb to announce itself.
I see the scan() routine is supposed to help discover bulbs. I'll do some network tracing to figure out why it isn't and the cli.js code is.
There's another problem: when you turn the bulb off, the steward forgets what color and brightness it was using. So then, when you turn it back on again, its brightness is 'undefined'.
i'll fix that one. that's easy.
i think that's now fixed in the master.
Yes, it is fixed. Still working on the two remaining problems.
Making progress. I notice that the lifx driver is already polling for a gateway. I think that it's NOT a simplicity to ignore the gateway. Better to absorb the complexity, particularly if it causes the code to work. :)
any luck?
No, as usual, my bulb crashed overnight. I think I'm going to wait until they have usable firmware.
Cuz, y'know, I always wanted to have to load new firmware into my light bulbs.
uh, okay. (-;
i went through and made the color mappings for rgb/hsl close to reversible, but it's really not exact. we're going to have to add an HSL picker to the HTML5/D3 client for greater fidelity...
i also put in some code to handle the disconnection. i suspect that you'll see better behavior now. just be sure to do this:
% cd steward
% git pull
% cd steward/
% rm -rf node_modules/lifx
% npm -l install
and the restart the steward.
I'll give it a try. Right now I'm trying to figure out if my bulb is crashing on its own, or if it's crashing because the lifxjs code is talking to it. I have the attention of a LIFX engineer, so there's some hope of addressing this problem.
good luck. be sure to grab the latest. i see tcp disconnects on my bulb, but the version of lifx.js i'm using (what you'll get after doing the steps above) automatically reconnects.
Hey, what did you do? The LIFX code is working! Good job!
thanks. there were basically three things, after i started with your base.
the basic logic was fine, it was just a matter of seeing where reasonable assumptions weren't being honored (-;
so, what are you integrating next?
@russnelson - if you "get the latest" you'll see the lifx driver. i renamed it and did some work on the color handling. here are the remaining issues. let me know if you can look at them…
if you look in LIFX.prototype.update, you'll see where it takes the HSL model from the update and converts it to RGB; similarly, if you look in LIFX.prototype.perform you'll see how the RGB model from the client gets converted to HSL for the bulb, and then later on, you'll see how HSL gets put back into RGB for the internal state.
i don't think the mapping is reversible, but haven't had time to verify that yet.
could you take a look at these two items? thanks!