Giter VIP home page Giter VIP logo

lifx-http's People

Contributors

chendo avatar dicer avatar eminence avatar mikeboehm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lifx-http's Issues

Add some sort of authentication?

I'm currently running this on a windows server and have it open to the internet so I can control my lights away from home. I'm also using a Pebble watch app that works with this API allowing my to control my lights from my wrist.

All in all very happy with my setup but there is one thing troubling me. That is the api is open and public and if anyone came across the public api they would be able to control my lights.

So I would like to request if it is possible to add some sort of authentication to the api.

E.G. a username and password or an API token of some sorts.

Thanks

Scott

Error installing gem

Using Ubuntu desktop 12.04. Compiled Ruby 2.1.1 from source (since there's no 2.x package for desktop 12.04 as far as I can tell. Extracted lifx-http from GitHub supplied zip file. But when I try to install...

james@ubuntuvm:/Downloads/lifx-http-master$ ls
bin Gemfile lib lifx-http.gemspec start.sh
doc.png Gemfile.lock LICENSE README.md
james@ubuntuvm:
/Downloads/lifx-http-master$ sudo gem install lifx-http
ERROR: Loading command: install (LoadError)
cannot load such file -- zlib
ERROR: While executing gem ... (NoMethodError)
undefined method `invoke_with_build_args' for nil:NilClass

...looks like I need zlib? Is this a system-level library or a Ruby library, or is it some other problem entirely? Thanks for your help.

wrong

When I start lifx-http the program prints an URL where it can be reached.

root@htpc:/tmp# lifx-http
lifx-http can be reached at http://lifx-http.local:56780/

But this is not the hostname of my server.
So it will not work.

You may want to change that to http://realservername:56780 or http://:56780 or something with the real IP.

Installation fails on multiple platforms (OS X and ArchLinux)

In OS X Mavericks (sudo gem install lifx-http)

[rekoil:~] % lifx-http
/Library/Ruby/Gems/2.0.0/gems/grape-swagger-0.8.0/lib/grape-swagger/markdown.rb:12:in `initialize': The configured markdown adapter should implement the method markdown (ArgumentError)
    from /Library/Ruby/Gems/2.0.0/gems/grape-swagger-0.8.0/lib/grape-swagger.rb:76:in `new'
    from /Library/Ruby/Gems/2.0.0/gems/grape-swagger-0.8.0/lib/grape-swagger.rb:76:in `setup'
    from /Library/Ruby/Gems/2.0.0/gems/grape-swagger-0.8.0/lib/grape-swagger.rb:15:in `add_swagger_documentation'
    from /Library/Ruby/Gems/2.0.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:200:in `<class:API>'
    from /Library/Ruby/Gems/2.0.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:9:in `<module:LIFXHTTP>'
    from /Library/Ruby/Gems/2.0.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:8:in `<top (required)>'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /Library/Ruby/Gems/2.0.0/gems/lifx-http-0.2.3/bin/lifx-http:3:in `<top (required)>'
    from /usr/bin/lifx-http:23:in `load'
    from /usr/bin/lifx-http:23:in `<main>'

And on ArchLinux (gem install lifx-http)

[rekoil@hallongrottan:~] 1 % lifx-http
/home/rekoil/.gem/ruby/2.1.0/gems/grape-swagger-0.8.0/lib/grape-swagger/markdown.rb:12:in `initialize': The configured markdown adapter should implement the method markdown (ArgumentError)
    from /home/rekoil/.gem/ruby/2.1.0/gems/grape-swagger-0.8.0/lib/grape-swagger.rb:76:in `new'
    from /home/rekoil/.gem/ruby/2.1.0/gems/grape-swagger-0.8.0/lib/grape-swagger.rb:76:in `setup'
    from /home/rekoil/.gem/ruby/2.1.0/gems/grape-swagger-0.8.0/lib/grape-swagger.rb:15:in `add_swagger_documentation'
    from /home/rekoil/.gem/ruby/2.1.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:200:in `<class:API>'
    from /home/rekoil/.gem/ruby/2.1.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:9:in `<module:LIFXHTTP>'
    from /home/rekoil/.gem/ruby/2.1.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:8:in `<top (required)>'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/rekoil/.gem/ruby/2.1.0/gems/lifx-http-0.2.3/bin/lifx-http:3:in `<top (required)>'
    from .gem/ruby/2.1.0/bin/lifx-http:23:in `load'
    from .gem/ruby/2.1.0/bin/lifx-http:23:in `<main>'

I'm sure I've just missed something silly, please help me, I wanna play with my newly purchased light!

Sunrise

Hi, am trying to use the "sunrise effect" as a wake-up light, The problem is i can't turn on the light at 0 brightness, so in the morning all lights will turn on at full brightness for half a sec, go back to black and then the sunrise begins.

I do not remember how, but i did manage to get this to work with the node api, setting the brightness before turning it on perhaps, but this dose not seam to work. Any ides or is this a limitation of the lifx-gem?

Running in the background (hack)

I get the server running in the background, and deal with it potentially crashing by running this php script as a cron:

// This lets me run the script on an interval
exec('pkill lifx-http');
echo "killed LIFX";

// The nohum and & let me keep running commands after the server is launched
$command = 'lifx-http';
exec("nohup $command >/dev/null 2>/dev/null &"); 
echo 'started LIFX server';

// I exit the script to prevent any system hang
exit;

Error with umlauts

lifx-http will throw an error if a bulb is named with an umlaut, e.g. "Büro" (Bureau).

macbook:~ fabiopoloni$ lifx-http
lifx-http can be reached at http://lifx-http.local:56780/
[2014-05-02 19:42:12] INFO  WEBrick 1.3.1
[2014-05-02 19:42:12] INFO  ruby 2.1.1 (2014-02-24) [x86_64-darwin12.0]
[2014-05-02 19:42:12] INFO  WEBrick::HTTPServer#start: pid=45782 port=56780
[2014-05-02 19:42:17] ERROR Encoding::UndefinedConversionError: "\xC3" from ASCII-8BIT to UTF-8
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:34:in `encode'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:34:in `to_json'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:34:in `to_json_with_active_support_encoder'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:56:in `to_json'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:223:in `generate'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/json/common.rb:223:in `generate'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:96:in `stringify'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:34:in `encode'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/json/encoding.rb:21:in `encode'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/activesupport-4.1.0/lib/active_support/core_ext/object/json.rb:37:in `to_json_with_active_support_encoder'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/formatter/json.rb:6:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/formatter.rb:33:in `block in after'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/formatter.rb:32:in `collect'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/formatter.rb:32:in `after'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/base.rb:25:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/base.rb:18:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/error.rb:26:in `block in call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/error.rb:25:in `catch'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/error.rb:25:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/middleware/base.rb:18:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/endpoint.rb:157:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/endpoint.rb:145:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:75:in `optimized_each'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/api.rb:537:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/api.rb:44:in `call!'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/grape-0.7.0/lib/grape/api.rb:40:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/lifx-http-0.2.3/lib/lifx-http/method_override.rb:19:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /Users/fabiopoloni/.rvm/gems/ruby-2.1.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
    /Users/fabiopoloni/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
iphone.app-roved.com - - [02/May/2014:19:42:17 CEST] "GET /lights/all HTTP/1.1" 500 334
- -> /lights/all

Swagger documentation not accesible

When following the instruction to access the swagger docs I receive the following error:
Can't read from server. It may not have the appropriate access-control-origin settings.

Trouble running on ubuntu 13.04

Hi,
I've done a fresh install of ruby and install lifx and lifx-http. This is what I get when I try to run the server:

130 root@odroid:~⟫ lifx-http
/var/lib/gems/2.0.0/gems/lifx-0.4.5/lib/lifx/transport/udp.rb:36:in `setsockopt': Protocol not available (Errno::ENOPROTOOPT)
        from /var/lib/gems/2.0.0/gems/lifx-0.4.5/lib/lifx/transport/udp.rb:36:in `block in listen'

Errors after prolonged run

Hello!

I am seeing odd errors after running for approx. a day:

192.168.2.212 - - [05/Feb/2015:19:22:40 CET] "PUT /lights/d073d500072c/color?hue=22&saturation=0.83&brightness=0.74&duration=0.25 HTTP/1.1" 200 0
- -> /lights/d073d500072c/color?hue=22&saturation=0.83&brightness=0.74&duration=0.25
[2015-02-05 19:22:43] ERROR Timeout::ExitException: execution expired
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `write'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `<<'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `log'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:152:in `log'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:90:in `error'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:103:in `rescue in run'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:113:in `run'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
192.168.2.212 - - [05/Feb/2015:19:22:44 CET] "PUT /lights/d073d5010fe5/color?hue=22&saturation=0.83&brightness=0.74&duration=0.25 HTTP/1.1" 200 0
- -> /lights/d073d5010fe5/color?hue=22&saturation=0.83&brightness=0.74&duration=0.25
[2015-02-05 19:22:47] ERROR Timeout::ExitException: execution expired
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `write'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `<<'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `log'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:152:in `log'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:90:in `error'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:103:in `rescue in run'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:113:in `run'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
192.168.2.212 - - [05/Feb/2015:19:22:46 CET] "PUT /lights/d073d501dafb/color?hue=36&saturation=1.0&brightness=1.0&duration=0.25 HTTP/1.1" 200 0
- -> /lights/d073d501dafb/color?hue=36&saturation=1.0&brightness=1.0&duration=0.25
[2015-02-05 19:22:49] ERROR Timeout::ExitException: execution expired
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `write'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `<<'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:77:in `log'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:152:in `log'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/log.rb:90:in `error'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:103:in `rescue in run'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:113:in `run'
        /home/petr/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
192.168.2.212 - - [05/Feb/2015:19:23:40 CET] "PUT /lights/d073d500072c/color?hue=22&saturation=0.83&brightness=0.74&duration=0.25 HTTP/1.1" 200 0
- -> /lights/d073d500072c/color?hue=22&saturation=0.83&brightness=0.74&duration=0.25

After a server restart, it works again without any trouble

ERROR Timeout::Error occurs after idle for a while - more frequently with 1.5 bulb firmware!

- -> /lights/tag:Cyberspace/color?duration=2&hue=0&saturation=0.80&brightness=0.20&_method=put
[2014-09-09 23:43:54] ERROR Timeout::Error: Timeout::Error
    /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/lib/lifx/utilities.rb:27:in `rescue in try_until'
    /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/lib/lifx/utilities.rb:9:in `try_until'
    /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/lib/lifx/network_context.rb:104:in `sync'
    /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/lib/lifx/client.rb:90:in `sync'
    /Library/Ruby/Gems/2.0.0/gems/lifx-http-0.2.3/lib/lifx-http.rb:156:in `block (3 levels) in <class:API>'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:45:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:45:in `block in generate_api_method'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:220:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:220:in `run'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:171:in `block in call!'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/base.rb:24:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/base.rb:24:in `call!'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/base.rb:18:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/error.rb:27:in `block in call!'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/error.rb:26:in `catch'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/error.rb:26:in `call!'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/middleware/base.rb:18:in `call'
    /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
    /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:172:in `call!'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/endpoint.rb:160:in `call'
    /Library/Ruby/Gems/2.0.0/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:152:in `block in call'
    /Library/Ruby/Gems/2.0.0/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'
    /Library/Ruby/Gems/2.0.0/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:89:in `optimized_each'
    /Library/Ruby/Gems/2.0.0/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'
    /Library/Ruby/Gems/2.0.0/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/api.rb:128:in `call'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/api.rb:43:in `call!'
    /Library/Ruby/Gems/2.0.0/gems/grape-0.9.0/lib/grape/api.rb:39:in `call'
    /Library/Ruby/Gems/2.0.0/gems/rack-cors-0.2.9/lib/rack/cors.rb:54:in `call'
    /Library/Ruby/Gems/2.0.0/gems/lifx-http-0.2.3/lib/lifx-http/method_override.rb:19:in `call'
    /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'

On standard up to date mac os mavericks, with standard ruby 2.0. Previously I had to restart lifx-http every few days to get it working again. Since updating to the 1.5 bulb firmware from 1.3, it seems to break after a few hours. Totally unreliable. I don't know if this issue belongs on the lifx gem or this.. Hopefully @chendo can figure that puzzle out?

Ubuntu install

I am having issues running lifx-http on Ubuntu 13.10 Server. Here is the error I am getting

lifx-http

lifx-http can be reached at http://lifx-http.local:56780/
[2014-05-03 15:14:24] INFO WEBrick 1.3.1
[2014-05-03 15:14:24] INFO ruby 2.0.0 (2013-08-29) [x86_64-linux-gnu]
[2014-05-03 15:14:24] WARN TCPServer Error: Address already in use - bind(2)
[2014-05-03 15:14:24] INFO WEBrick::HTTPServer#start: pid=20303 port=56780

uname -a

Linux NAS 3.11.0-20-generic #34-Ubuntu SMP Tue Apr 1 20:40:25 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

ruby --version

ruby 2.0.0p299 (2013-08-29) [x86_64-linux-gnu]

lsof shows nothing when the service is not running.

lsof -wni tcp:56780

request: turn light on/off with a fade

It seems like the only way to do this right now is to transition to a color with a duration, but I want to turn the light on gradually using whatever the previous color was. Presumably, I could fetch the light first to get the color values and play it back with brightness=1.0 and brightness=0.0 but that's not so nice.

"circular argument references" in lifx-snoop

I installed your programm and startet "lifx-snoop".
This is what I got:

root@htpc:/tmp# lifx-snoop
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/routing_table.rb:10: warning: circular argument reference - site_id
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/routing_table.rb:10: warning: circular argument reference - device_id
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/tag_table.rb:27: warning: circular argument reference - tag_id
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/tag_table.rb:27: warning: circular argument reference - label
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/tag_table.rb:27: warning: circular argument reference - site_id
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/light.rb:26: warning: circular argument reference - id
/var/lib/gems/2.2.0/gems/lifx-0.4.5/lib/lifx/light.rb:367: warning: circular argument reference - wait_for
Listening on 56700 and 56750...
^C to quit.
^C/var/lib/gems/2.2.0/gems/lifx-0.4.5/bin/lifx-snoop:50:in sleep': Interrupt from /var/lib/gems/2.2.0/gems/lifx-0.4.5/bin/lifx-snoop:50:in<top (required)>'
from /usr/local/bin/lifx-snoop:23:in load' from /usr/local/bin/lifx-snoop:23:in

'

How I installed ruby:

sudo apt-get install python-software-properties
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install ruby2.2

My system:

root@htpc:/tmp# cat /etc/issue
Ubuntu 12.04.5 LTS \n \l
root@htpc:/tmp# ruby --version
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux-gnu]

I will now see if lifx-http will is working.

Raspberry Pi - "Connection Refused"

I'm trying to get this setup on a Pi and I keep getting this error when i try to run a test curl from a different machine (same network).

curl: (7) Failed connect to 192.168.1.144:56780; Connection refused

I've verified the IP is correct and there is no error/warning when I run "lifx-http" from the Pi.

Any ideas? is this more related to the pi and/or ruby? I have ruby 2.1.2 on the Pi.

thanks!

mDNS support

Did you try mDNS-sd in command line ? I've been unable to send a successful mDNS request that lifx-http can see and respond to.
I'm working on a SmartThings integration and mDNS discovery would be great.

not compatible with firmware 2.0?

I guess I knew this would happen.
But I installed the new firmware 2.0 anyway. :)
Now lifx-http does not work anymore. :(

  1. I suggest you put a warning in the readme that lifx-http does not support the new firmware.
  2. Is there any hope for a fix?

Do we even need this application anymore?
I was hoping we could talk to the bulbs (or the cloud) directly now.
But I cannot find any documentation about that.

lifx-snoop issue

Hey,

I seem to be having an issue with lifx-snoop:

/usr/bin/lifx-snoop:23:in load': /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/bin/lifx-snoop:30: syntax error, unexpected ',' (SyntaxError) light_udp.add_observer(self) do |message:, ip:, transport:| ^ /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/bin/lifx-snoop:38: syntax error, unexpected ',' peer_udp.add_observer(self) do |message:, ip:, transport:| ^ /Library/Ruby/Gems/2.0.0/gems/lifx-0.4.5/bin/lifx-snoop:42: syntax error, unexpected keyword_end, expecting end-of-input from /usr/bin/lifx-snoop:23:in

'

OSX Yosemite

Unfortunately I'm rather new to all of this so I don't know how to edit the code to correct it :(.

Any ideas?

Hue not working

Whenever I leave hue=0 the bulb is doing exactly what I want it to, but changing color isn't working with the latest firmware update.

Request - Please fix LIFX-HTTP so it works with the latest firmware :)

Can you give any indication as to when LIFX-HTTP will be updated to handle the latest firmware. It is (was) a great facility and I am using it to link in with my home automation system. I am now getting a lot of grief because the LIFX lamps don't work like they used to ;)

If I had been pre-warned by LIFX that this facility wouldn't work, I wouldn't have upgraded the firmware.

Thanks for considering :)

start script isn't working

The start.sh script isn't working but the ./bin/lifx-http is.

It gives me this error when I try starting the start.sh script

/usr/local/rvm/gems/ruby-2.1.1@global/gems/bundler-1.5.3/lib/bundler/rubygems_integration.rb:240:in   `block in replace_gem': thin is not part of the bundle. Add it to Gemfile. (Gem::LoadError)
        from /usr/local/rvm/gems/ruby-2.1.1/bin/thin:22:in `<main>'
        from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
        from /usr/local/rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'

Im trying to demonize the process on my Pi. Im sure I'm just missing something easy. Help.

Runing on RaspberryPi

This is problebly more of a Ruby problem (First time trying it out) But am trying to get lifx-http working on my RaspberryPi: But am getting this error: uninitialized constant Socket::SO_REUSEPORT, any clows? Whould be so nice to have a privet lifx cloud on my pi:)

$sudo lifx-http
/home/pi/.rvm/gems/ruby-2.1.1@global/gems/mdns-0.2.0/lib/mdns.rb:15:in start': uninitialized constant Socket::SO_REUSEPORT (NameError) from /home/pi/.rvm/gems/ruby-2.1.1@global/gems/lifx-http-0.2.3/bin/lifx-http:46:in<top (required)>'
from /home/pi/.rvm/rubies/ruby-2.1.1/bin/lifx-http:23:in load' from /home/pi/.rvm/rubies/ruby-2.1.1/bin/lifx-http:23:in

'
from /home/pi/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in eval' from /home/pi/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in'

lifx-http not getting status of lamps

Do anybody have idea, why this tool gets right status only when it was changed within itself. So, i mean, I use this tool with Z-WAY and Razberry, it works fine, but if I control lights with my smartphone, I can't get status. For example, If i just switch lamp on with smartphone, I always get "on:false" in json object. If i switch lamp on with lifx-http (with curl request for example), then I get right status. But if I changing lamp color for example i still getting last status, not new one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.