-
Notifications
You must be signed in to change notification settings - Fork 2
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
Lock mechanism seems to be not working #3
Comments
Have forked the project and pushed my changes i used to for testing into this branch: https://github.com/Psykoman1990/js-pigpio/tree/fix-lock |
Thanks @Psykoman1990 sorry for not responding sooner. I'll try and look at it this week. |
Looked into this issue some days ago again. To use hrtime() is maybe not the best solution too, as it leads to 100% CPU usage. I'll try to look into this again to find an ever better solution. Quite new to JS. |
Didn't found any better solution for waiting for release of lock. Do you remember why you only added some "undefined, true" at the end of some "set-_pi_gpio_command" calls? |
@miketrebilcock Would really appreciate it if you could have a look at this and respond to my last question. Thank you |
@miketrebilcock Would be nice if you can have a look at this issue. Thanks |
I'm working on https://www.npmjs.com/package/node-red-node-pi-gpiod and found some issues regarding the Lock mechanism of this library.
Seems that something went wrong in acquireLock().
You are checking in Line 46 if the lock entry !== undefined what is ok for waiting if it is set, but it isn't set at startup, so the loop "content" will never be called. The result is that it never gets set.
I also ran into some problems with timeout() => was never called, so i used process.hrtime() instead.
Result would be something like:
But now i get errors because of the 2nd connection from _callback.js
So my question is how the lock was intended to work?
The text was updated successfully, but these errors were encountered: