Comments (11)
Hello kilianyusinyu,
I think I found the problem. The npm module did not direct to its repository properly (you will always install a v0.0.5 package). I just fix the link to the correct repository. You may like npm install [email protected]
to ensure the lastest release is installed on your host.
Sorry, it's my fault.
from cc-znp.
Hi kilianyusinyu,
Sorry for the inconvenience. There is not event loop problem, the problem is stream broken in lower layer. We already fixed it, and tested. It should be ok. Would you please try it again, thanks :-)
(The package is now updated to v0.0.7)
from cc-znp.
Hi kilianyusinyu,
The following code is test ok.
const ccznp = require('cc-znp');
const spCfg = {
path: '/dev/ttyACM0',
options: {
baudrate: 115200,
flowControl: true,
rtscts: true
}
};
ccznp.on('ready', () => {
console.log('Device is ready.');
ccznp.sapiRequest('startRequest', {}, () => {
});
});
ccznp.on('AREQ', (Ind) => {
// { subsys: 'ZDO', ind: 'stateChangeInd', data: { state: 8 } }
console.dir(Ind);
var data = Ind.data;
if (data.state === 9) {
ccznp.sapiRequest('permitJoiningRequest', {destination: 0xFFFC, timeout: 0xAA}, (error, result) => {
if (error) {
throw error;
}
// Verify the results
console.log(result);
});
}
});
ccznp.init(spCfg, (error) => {
console.log(error);
});
ccznp.on('close', function() {
console.log('Serial port closed.');
});
from cc-znp.
Hi kilianyusinyu,
Thanks for your feedback. We encountered an issue of messages processing performance in RaspPi-2 before, so I was wondering if BBB has the same problem. I just extend the request timeout from 3 seconds to 20 seconds, and npm publish to version 0.0.5. Would you please try it again?
By the way, did you call reset in your script? Since reset will break the connection from cc2531 to your host, and many requests will be pended until they are timed out. (Just a notice for you if you are using cc2531)
from cc-znp.
Hi simenkid,
Many thanks for your quick response! The request timeout change from 3 to 20 seconds is quite noticeable with the new version 0.0.5 and I have tested again several times. Unfortunately, the problem still persists and I only get good results after several runs, whereby each run yields a timeout error after which one (i.e. the last run) suddenly yields expected results without any timeout errors - exactly as already described above. I guess the problem lies elsewhere inside the cc-znp package or inside one of its dependencies?
Just to answer your question regarding reset. No, I did not call reset in my script. But thanks all the same for the tip!
from cc-znp.
Hi, kilianyusinyu,
We are now tracing down the dependencies. We will fix this issue and let you know soon. :-)
from cc-znp.
Hi, kilianyusinyu,
It seems that something goes wrong with node.js event loop. We just fix the problem. Would you please try it again? And let us know if the problem is solved. ^^
(The package is now updated to v0.0.6.)
from cc-znp.
Hi simenkid,
I have just tested again and the problem is still persisting. After several runs (as already described above) it suddenly works but this is not user-friendly! This implies that the cause of this request timeout problem is still elsewhere in some package.
from cc-znp.
Hi jackchased,
I have tested several times with the updated version 0.0.7 and each time the AREQ event is not fired and the script keeps waiting for it for quite a very long time after which I simply stop it with CTRL+C. Unfortunately, no errors are thrown to inform me about the cause of the problem and this is not helping me either.
from cc-znp.
Hi kilianyusinyu,
What do you mean "each time the AREQ event is not fired and the script keeps waiting for it for quite a very long time"?
Is that possible to give us your code under test?
from cc-znp.
Hi jackchased,
What I mean is that the code above that worked for you did not work for me. In my case, I have a CC2531 USB Evaluation Kit connected to the USB port on my BeagleBoneBlack which in turn is connected to the USB port of my MacBook.
As you can see, the AREQ event is never fired and the script keeps waiting for it for quite a very long time.
from cc-znp.
Related Issues (8)
- Command ZDO_AUTO_FIND_DESTINATION HOT 2
- Error: Unrecognized command HOT 1
- how to use cc-znp with zcl-packet?
- Check ZDO Request: ZDO_MGMT_PERMIT_JOIN_REQ HOT 2
- Check if cc-znp do have the new MT commands or REQ/RSP corrections HOT 1
- Check AF Indication: AF_INCOMING_MSG_EXT
- Error to install serialport. 4.0.1 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cc-znp.