-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Attaching multiple HR sensors #13
Comments
Yeah i have the same problem. It works with only one sensor, but when i attach 2 or more sensors it doesn't work. Please anyone help. |
A single For example
gives me
If you don't know the |
Hello, I wonder what is the proper way to use multiple sensors at the same time. I'm trying to attach 8 hr sensors and right now I'm getting: " MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 read listeners added. Use emitter.setMaxListeners() to increase limit" even with just two of them, so I think I'm not attaching them well. I have that warning until I increase the limit to 1000, and that doesn't seem right.
stick0.on("startup", function() { console.log("startup stick"); console.log("Max channels:", stick0.maxChannels); // will output 8 hrSensor0.attach(0, 0); hrSensor1.attach(1, 0); ...
I'm just attaching the sensors on the stick startup using DeviceID=0 for all of them because I want to be able to attach to any hr sensors, not only the ones I know. I wonder if I could scan the DeviceID before attaching it.
I know I should follow your instructions. So I'd like to know which is the best way to do it:
Do I have to attach the sensors recursively then? (I did and that seems to make the limit warning disappear) Should I detach every sensor just after it's attached to reattach it again with its real DeviceID?
The lib gives also an exit error if I ever try to attach o detach a sensor that is already attached o detached. Any way to prevent that beyond making sure of not doing that?
This is the best nodejs ANT+ lib I've found. Thank you for your great work.
The text was updated successfully, but these errors were encountered: