hink / go-blink1

Thingm Blink(1) interface library for Go
20 stars 9 forks source link

Cannot control Blink1 until accessed with blink1-tool #3

Open freb opened 8 years ago

freb commented 8 years ago

I can't seem to control the Blink1 with go-blink1 until after I've issued some type of command to it via blink1-tool. Something as simple as blink1-tool --list allows me to control the device using this library.

I'm running Linux so I'm not sure if it is specific to my OS. From the docs it seems like you may have only tested on Mac, but I'd be interested if anyone else has this issue.

I'm writing a debug program that flashes a specific pattern when the Blink1 is plugged in, and while the program will always be running, the Blink1 is meant to be plugged in only when needed.

Right now I have to do something like this as a workaround:

exec.Command("blink1-tool", "--list").Run()
dev, err := blink1.OpenNextDevice()
hink commented 8 years ago

I'll take a look into this. Thanks!

hink commented 8 years ago

I can't reproduce this -- are you still having the issue?

freb commented 8 years ago

Its been a while since I wrote my program depending on the library, but at that time it seemed to be the case. I'm not sure if its a problem with my /etc/udev rules.

I did two things to make it work in my situation (which needed to handle unplugging and re-plugging in the device).

  1. Allow devices to be re-opened: https://github.com/freb/go-blink1/commit/23f1e658e3774dbda3cb6df539c7d50754d28fed
  2. Run that command: https://github.com/aerissecure/blink1status/blob/master/main.go#L181

When I get a minute, I'll try to reproduce this specific issue and report back.

jramb commented 7 years ago

I have the same problem as freb. The work-around works, but is of course not an optimal solution, I was hoping to be able to run without blink1-tool (on a Raspi).

Underwater-Hockey commented 7 years ago

I can confirm that this is still an issue. The workaround did work but really is only as a proof that it can be made to work. Has anyone come up with a fix?