-
Notifications
You must be signed in to change notification settings - Fork 30
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
cc-znp package not working properly on my BeagleBoneBlack. #4
Comments
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) |
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! |
Hi, kilianyusinyu, We are now tracing down the dependencies. We will fix this issue and let you know soon. :-) |
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.) |
Hi simenkid, |
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) |
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.');
}); |
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. |
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? |
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 Sorry, it's my fault. |
I have a CC2531 USB Evaluation Kit connected to the USB port on my BeagleBoneBlack (BBB). I also have two zigbee end-devices within the surroundings of my BBB which are expected to join the network once opened. When the following code
is run, I get the following error:
After running the script again several times (at least 6 times), the error suddenly disappears and I get the following results:
After getting the results finally, if I run the same script again it just hangs until I stop it with CRTL+C!
It is worth noting that this procedure happens with all the other commands (e.g. UTIL_GET_DEVICE_INFO etc.) I try to call i.e. I must run the script several times, get the 'Error: request timeout' message above during each run, before it finally runs without any errors and yield the results.
Am I perhaps doing something wrong or is this a bug within the cc-znp package? I would be grateful if you can investigate this issue as soon as possible and let me know your feedback/solution.
Many thanks in advance.
The text was updated successfully, but these errors were encountered: