Closed fraser73 closed 9 years ago
The available commands, as listed in the OpenZWave API documentation, are:
["AddDevice"]
["CreateNewPrimary"]
["ReceiveConfiguration"]
["RemoveDevice"]
["RemoveFailedNode"]
["HasNodeFailed"]
["ReplaceFailedNode"]
["TransferPrimaryRole"]
["RequestNetworkUpdate"]
["RequestNodeNeighborUpdate"]
["AssignReturnRoute"]
["DeleteAllReturnRoutes"]
["SendNodeInformation"]
["ReplicationSend"]
["CreateButton"]
["DeleteButton"]
The argument list tries to follow OpenZWave's argument list for BeginControllerCommand. Thus;
I'll add these in the documentation. Thanks for pointing this out!
If that's the case, test2.js should be updated to reflect the correct API and not fail out-of-the-box.
yup, I guess you're right. :)
I've updated the API doc and the examples. Please give it a try.
Hi, sorry for the delay in getting back to you... Can this be re-opened, I'm still having a problem with Illegal invocation. I'm running raspbian wheezy, openzwave 1.2.919, node 0.12.7, openzwave-shared@1.0.4, nan@2.0.9, and an aeon labs z-stick 2, with the updated test2.js I see:
scan complete, hit ^C to finish.
/root/test2.js:115
zwave.beginControllerCommand('AddDevice', true);
^
TypeError: Illegal invocation
at null.
It was in front of me all this time. The problem is the 'inheritance' mechanism:
function inherits(target, source) { for (var k in source.prototype) { console.log('==='+k); target.prototype[k] = source.prototype[k]; } }
Workaround is to use zwave.addon.<command>
instead of zwave.command
. So, if you edit the last lines in test2.js to read:
zwave.on('scan complete', function() { console.log('scan complete, hit ^C to finish.'); // Add a new device to the ZWave controller zwave.addon.beginControllerCommand('AddDevice', true); });
it works like a charm!
2015-09-17 22:39:16.491 Detail, contrlr, Received: 0x01, 0x07, 0x00, 0x4a, 0x04, 0x01, 0x00, 0x00, 0xb7
2015-09-17 22:39:16.491 Detail,
2015-09-17 22:39:16.491 Info, contrlr, FUNC_ID_ZW_ADD_NODE_TO_NETWORK:
2015-09-17 22:39:16.491 Info, contrlr, ADD_NODE_STATUS_LEARN_READY
2015-09-17 22:39:16.491 Detail, contrlr, Expected callbackId was received
2015-09-17 22:39:16.491 Detail, contrlr, Expected reply was received
2015-09-17 22:39:16.492 Detail, contrlr, Message transaction complete
2015-09-17 22:39:16.492 Detail,
2015-09-17 22:39:16.492 Detail, contrlr, Removing current message
2015-09-17 22:39:16.492 Info, WriteNextMsg Controller nothing to do
controller commmand feedback: r=4, s=0
Ok, I thought I'd blow away my pi and start again from scratch... I seem to be having problems installing openzwave-shared@1.0.5, I end up with screenfulls of nan errors, however I can install openzwave-shared@1.0.4, which is what I've done...
I've modified the test2.js as directed and it works fine.
In order to get node-contrib-openzwave running without the same problem, I assume a similar modification needs to be made to 10-zwave.js, however I can't see where - can you enlighten me?
Again sorry for this, seems I've mispasted a pull request after a merge conflict. I'll prepare something by the end of the day.
2015-09-18 17:46 GMT+03:00 fraser73 notifications@github.com:
Ok, I thought I'd blow away my pi and start again from scratch... I seem to be having problems installing openzwave-shared@1.0.5, I end up with screenfulls of nan errors, however I can install openzwave-shared@1.0.4, which is what I've done...
I've modified the test2.js as directed and it works fine.
In order to get node-contrib-openzwave running without the same problem, I assume a similar modification needs to be made to 10-zwave.js, however I can't see where - can you enlighten me?
— Reply to this email directly or view it on GitHub https://github.com/OpenZWave/node-openzwave-shared/issues/13#issuecomment-141473170 .
Elias Karakoulakis Electrical & Computer Engineer NTUA Athens Msc Information Systems, AUEB Athens KNX Advanced Partner
Hi, did you get anywhere with the update? I still don't seem to be able to npm install 1.0.5 - also would fixing 1.0.5 make the node-red-contrib-openzwave work again? Thanks very much.
I've simplified the module inheritance semantics so as to make it as simple (and hopefully, as cross-version compatible) as it can be. The API for the library initialisation has changed slightly, but this is something I guess we can live with (as init calls are only made once!) I've tested this with an actual ZWave stick (ever imagined how difficult is to find one in a country with capital controls?) with NodeJS 0.10.25 and 0.12.4. I'll experiment with versions 3 and 4 in due time. I've also updated the test2.js script to show how to call management functions. Please provide some feedback: does this solve the "Invalid invocation" problem?
resolving - tested on both 0.10.x and 0.12.x with actual hardware, working beautifully.
Excellent, all appears to be working fine here. Thanks very much.
I've just rebuilt my zwave system and am now seeing a problem with node-openzwave-shared. OZW seems to work fine, but node-openzwave.shared can only recieve information from the z-stick, as soon as it tries to write, be it through Node-red or using test2.js, I get "illegal invocation". Here is the output from the end of the test2.js, showing completion of the initial scan and failure. Please let me know if you want anything else, I'm happy to help as much as I can.
2015-08-25 09:49:01.262 Info, Node query processing complete except for sleeping nodes. node2: Aeotec, Multi Sensor node2: name="", type="Routing Binary Sensor", location="" node2: class 32 node2: =0 node2: class 48 node2: Sensor=false node2: class 49 node2: Temperature=55.405 node2: Luminance=2 node2: Relative Humidity=59 node2: class 128 node2: Battery Level=100 node2: class 132 node2: Wake-up Interval=0 node2: Minimum Wake-up Interval=240 node2: Maximum Wake-up Interval=2678400 node2: Default Wake-up Interval=0 node2: Wake-up Interval Step=240 node2: class 134 node2: Library Version=6 node2: Protocol Version=3.28 node2: Application Version=1.18 scan complete, hit ^C to finish. /root/test2.js:114 zwave.beginControllerCommand('SendNodeInformation', 5); ^ TypeError: Illegal invocation at null. (/root/test2.js:114:11)
at emit (events.js:104:17)