jperkin / node-openzwave

node.js interface to libopenzwave
Other
110 stars 54 forks source link

second impressions #3

Closed mrose17 closed 10 years ago

mrose17 commented 10 years ago

i've been adding devices, overall it just seems to work in terms of adding and discovery. two things though:

  1. i notice that the nodeinfo parameter passed on the 'node ready' event doesn't contain a network address. i need something like that in order to uniquely identify a device (someday perhaps there are multiple zwave networks in use with one steward, who knows?) i haven't cracked open the openzwave source, is that something that's available?
  2. every time i remove the stick from my mbp, push the button, pair a device, push the button, and plug it back into the mbp again, it takes longer and longer to discover anything (including the stick). is that normal? is there a way to "reboot the stick"?

right now, i've been watching the test script run for 10m and it's found only the stick.

thanks!

jperkin commented 10 years ago

The way to uniquely identifiy a device is with the homeid+nodeid combination. Currently I don't pass back the homeid but I can trivially do that from 'device ready'. I'm not sure if multiple homeids are supported from the same driver, if so then it'll need thinking about. Each operation to a node is keyed on that combination, search for 'home' in src/openwave.cc.

As for 2, I don't have an easy way to test that - the devices I am driving are in production use in a coffee shop. I'll see if I can get some time out of hours to do tests like that, would definitely like to make it more robust! It's likely I need to initiate a new scan each time the device is plugged back in or something.

mrose17 commented 10 years ago

thanks. i see the homeid in your glue code. i'll add it to the 'driver ready' notification and see what's what.

it may very well be that there can be only one driver per server... i'd just like to have that homeid available in case in the future, that isn't true. plus, for uniqueness.

the sluggishness of response is rather odd. it gets worse every time i pair a device. oh well, let's not worry about it for now...

jperkin commented 10 years ago

I've seen the sluggishness happen myself when I've been running other managers on the same network (I'm currently transitioning over to my new code from some existing hacks which just write data directly to /dev/ttyUSB0). It seems to clear up after a while of not sending any data, but I'm not sure what exactly is causing it - it seems to get confused when too much is going on, could be related to the internal callbacks it has for every operation and trying to keep track of them all.