sidoh / ledenet_api

An API for the LEDENET Magic UFO LED WiFi Controller
MIT License
46 stars 12 forks source link

Error: undefined method `ip' for nil:NilClass #5

Open noah-ellman opened 7 years ago

noah-ellman commented 7 years ago

OR "Error: Invalid argument" I'm not a ruby guy, more of a JavaScript/PHP guy. So I'm not too excited to dig deeper here... but it seems there is a simple semantic error for most of the commands.

The only thing that works (works great!) is --on and --off. Everything else results in a syntax error.

ledenet-ufo 192.168.29.148 --status

Error: Invalid argument

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/io.rb:31:in pos' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/io.rb:31:inseekable?' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/io.rb:23:in initialize' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/io.rb:240:ininitialize' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/base.rb:143:in new' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/base.rb:143:inread' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/bindata-2.4.0/lib/bindata/base.rb:21:in read' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/lib/ledenet/api.rb:116:inblock in send_packet' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/lib/ledenet/api.rb:142:in socket_action' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/lib/ledenet/api.rb:112:insend_packet' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/lib/ledenet/api.rb:130:in request_status' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/lib/ledenet/api.rb:20:instatus' C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/bin/ledenet-ufo:156:in <top (required)>' C:/Ruby22-x64/bin/ledenet-ufo:23:inload' C:/Ruby22-x64/bin/ledenet-ufo:23:in <main>

PS C:\Users\Noah\downloads> ledenet-ufo --on -r 200 -g 0 -b 255 --warm-white 0 --status

Error: undefined method `ip' for nil:NilClass

C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ledenet_api-1.4.2/bin/ledenet-ufo:130:in <top (required)>' C:/Ruby22-x64/bin/ledenet-ufo:23:inload' C:/Ruby22-x64/bin/ledenet-ufo:23:in <main>

Any ideas? :-)

(using window 10 and Ruby 2.2 and also tried with 2.3.x )

sidoh commented 7 years ago

Ah, yeah. I've heard that other people have had trouble with this library on Windows.

The second problem you're seeing sounds like it's not finding a device through discovery. There should be better error handling around that in the script.

The first one unfortunately seems closer to a fundamental incompatibility with Windows. Seems like it's nested deep in the library I used to define packet structures (bindata).

I'm burning most of my project time on a different effort right now, but I'll try to poke at this when I get time.

noah-ellman commented 7 years ago

Ah, damn Windows. Thanks, hope you can find the issue.