Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zwave.getNeighbours() function is not working #120

Closed
kranthisai opened this issue Sep 16, 2016 · 16 comments
Closed

zwave.getNeighbours() function is not working #120

kranthisai opened this issue Sep 16, 2016 · 16 comments

Comments

@kranthisai
Copy link

Hi,
I am getting the following error, when using getNeighbours(). Also, I couldn't find anything in the repo when I searched for getNeighbours().

console.log(zwave.getNeighbours());
                      ^

TypeError: undefined is not a function
at EventEmitter. (/_/openzwave-shared/test2.js:129:27)
at EventEmitter.emit (events.js:118:17)
at addonModule.Emitter.emit (/
_/openzwave-shared/lib/openzwave-shared.js:39:5)

@kmoughon
Copy link

This is a international issue... Check your spelling of the function. If you search the repo you will find 'getNeighbors', the US English spelling. I work at a company with offices in Scotland and Florida, we run into this issue all the time.

@ekarak
Copy link
Member

ekarak commented Sep 17, 2016

$ grep -ri neigh src/
src/openzwave.cc:     Nan::SetPrototypeMethod(t, "requestNodeNeighborUpdate", 
src/openzwave.cc:       Nan::SetPrototypeMethod(t, "getNodeNeighbors", 

not an issue -resolving

@ekarak ekarak closed this as completed Sep 17, 2016
@lobando
Copy link

lobando commented Sep 19, 2016

Thanks,
When calling getNodeNeighbors we are getting

*** Error in `node': free(): invalid pointer: 0x00007fffa9abcc00 ***
Aborted (core dumped)

are we doing something wrong?

@ekarak
Copy link
Member

ekarak commented Sep 20, 2016

you're right! I'm deleting the neighbors array no matter if I don't have to.
Just a minute while I fix this...

@ekarak ekarak reopened this Sep 20, 2016
ekarak added a commit that referenced this issue Sep 20, 2016
@ekarak
Copy link
Member

ekarak commented Sep 20, 2016

can you please checkout the latest master and retry?

@kranthisai
Copy link
Author

Thanks, I retried. Got empty array this time. I want to create some routing table to understand which sensor is connected to which repeater. Is this the function right?

@ekarak
Copy link
Member

ekarak commented Sep 20, 2016

Yes thats correct, but you need to do a requestNeighborUdate first. Will
confirm this once I get home

Στις 20 Σεπ 2016 7:35 μ.μ., ο χρήστης "Kranthi" [email protected]
έγραψε:

Thanks, I retried. Got empty array this time. I want to create some
routing table to understand which sensor is connected to which repeater. Is
this the function right?


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
#120 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAj4KdMZjelbo81Jful0zEo4JORk9WMKks5qsAttgaJpZM4J_ck1
.

@kranthisai
Copy link
Author

Thanks.. I tried requestNodeNeighborUpdate for all the nodeids, still getNodeneighbor function is returning empty array..

@magorski
Copy link

You sure that getNeighbours method still exist in node-openzwave-shared? From What I see it's been removed in commit 2573b7f7c64. When I'm trying to run it Im getting TypeError: zwave.getNeighbors is not a function error.

I think it's been replaced by getNodeNeighbors() function but documentation never got updated (no mention of getNodeNeighbors() in docs).

BTW, looks like you need to run requestNodeNeighborUpdate (and wait some seconds/minutes?) before you use getNodeNeighbors() otherwise you getting empty array.

@kranthisai
Copy link
Author

Thanks @magorski . I tried even today but it didn't worked for me. After requestNodeNeighborUpdate, my program sleeps for 5 minutes before executing getNodeNeighbors(). Got the following error today: *** Error in `node': double free or corruption (out): 0x00007ffd9388e9d0 ***Aborted (core dumped)

@ekarak
Copy link
Member

ekarak commented Nov 19, 2016

Is this still an issue? Can you paste an example that replicates this?
BTW, getNodeNeighbors() requires a node id argument, are you sure you're passing a value?

@ekarak
Copy link
Member

ekarak commented Dec 3, 2016

Just added a simple dump of the node neighbors in test.js and it seems to be working for me:

== Driver Statistics:
{"m_SOFCnt":15,"m_ACKWaiting":0,"m_readAborts":0,"m_badChecksum":0,"m_readCnt":15,"m_writeCnt":13,"m_CANCnt":0,"m_NAKCnt":0,"m_ACKCnt":13,"m_OOFCnt":0,"m_dropped":0,"m_retries":0,"m_callbacks":0,"m_badroutes":0}
== Node 1 neighbors: [2]
== Node 1 Statistics:

Resolving

@ekarak ekarak closed this as completed Dec 3, 2016
@nand87
Copy link

nand87 commented Jan 30, 2018

getNeighbors() does not exist. Doc must be updated.

@ekarak
Copy link
Member

ekarak commented Jan 30, 2018

@nand87
Copy link

nand87 commented Jan 30, 2018

@ekarak sorry I meant getNeightbors() => it 's not defined.
https://github.com/OpenZWave/node-openzwave-shared/blob/master/README-api.md

@ekarak
Copy link
Member

ekarak commented Jan 30, 2018

fixed the typo, thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants