justmoon / node-blync

Blynclight module for Node.js using node-hid
13 stars 5 forks source link

Can't get to the first device #1

Open edasque opened 9 years ago

edasque commented 9 years ago

The following code outputs:

blync = require('blync')
HID = require('node-hid')
devices = HID.devices()
console.dir devices

deviceCount = blync.getDevices().length

console.dir blync.getDevices()
coffee blync_meeting.coffee
[....
  { vendorId: 4400,
    productId: 7680,
    path: 'USB_1130_1e00_1d111200',
    serialNumber: '',
    manufacturer: 'TENX',
    product: 'Blync',
    release: 1320,
    interface: -1 },
 ... ]
[]

so node-hid sees the device but node-blync doesn't. Looking at your code, it seems that it assumes a different product-id & interface. Mine is productId: 7680 and its interface is -1.

if I edit out these conditions, it finds the right device but:

cannot open device with path USB_1130_1e00_1d111200
edasque commented 9 years ago

Any thoughts, @justmoon

danyalaytekin commented 9 years ago

Same here.

danyalaytekin commented 9 years ago

Here's my spec:

{ vendorId: 3667,
    productId: 9494,
    path: 'USB_0e53_2516_14200000',
    serialNumber: '',
    manufacturer: '',
    product: 'Blynclight',
    release: 256,
    interface: -1,
    usagePage: 65280,
    usage: 1 }
edasque commented 9 years ago

@danyalaytekin , I don't think this repo is active, @justmoon isn't supporting it

danyalaytekin commented 9 years ago

It works for me now if I change the parameters on line 9 of blync.js. However the command parameters have also changed for my model (BLYNCUSB30). Doing some research it now seems to support full RBG (in that order) for commandBuffer indices 1-3. Index 4 seems to be blink speed. Index 8 now seems to be irrelevant.

edasque commented 9 years ago

@danyalaytekin if you do fork this repo to make it work with your device, let me know and I'll try it with mine. Where did you get the info on the commandBuffer structure? I looked at some point but couldn't find it.

danyalaytekin commented 9 years ago

@edasque Here you go, I have started but it isn't very tidy yet. I have changed sendCommand to take red, green, blue. https://github.com/danyalaytekin/node-blync/tree/master/lib

As for finding the info, it was pure trial and error really, some for loops and playing around. :)