porsager / busylight

node library for busylight
49 stars 17 forks source link

Support Busylight API Rev 2.2 #3

Closed carlos-cubas closed 8 years ago

carlos-cubas commented 8 years ago

For the most part it looks like i can find the device, and am writing the buffer to it. But nothing happens with the light. Anyone have any hints?

carlos-cubas commented 8 years ago

Might actually be the device version. I'm using device: {vendorId: 10171, productId: 15306} which is not the same as the supported model. How would i go about figuring out how to control this model?

porsager commented 8 years ago

Hi. Sorry for the late reply, just had to get hold of a busylight I could test with ;) So it's working fine for me with node 6.1 on El capitan. It's very likely it's due to the different model.

I suppose you tried to get going by doing this to get the unsupported model? If not, give that a try, and let me know how that works.

const Busylight = require('busylight')
const busylight = Busylight.get({ vendorId: 10171, productId: 15306 })

busylight.ring()
carlos-cubas commented 8 years ago

So I received the USB API description for the new model from plenom. Busylight API rev. 2.2 - 22052015.pdf The latest busylight was launched late last year. Looking at the API it seems like the command structure has changed somewhat from the one implemented in this library. Here are some observations:

Will probably need to create separate issues for this, but i suppose a proposal would be to create a version/driver system so that you may specify which version/driver to use with your busylight?

porsager commented 8 years ago

Ah, that's great! I will start implementing it tomorrow. I am pretty sure we will be able to automatically decide on the API depending on the vendor and productId, so that the node api can stay the same. Thanks a lot for the pdf!

porsager commented 8 years ago

@venomcc So it wasn't actually such a big change. I had to write 64 bytes and include a checksum at the end as you described.

I've published v. 0.3.0 now that should support their new models. (I was only able to test with the Busylight Alpha - productId 0x3bca though)