-
Notifications
You must be signed in to change notification settings - Fork 126
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
Switch to Wiring Pi GPIO utility #27
base: master
Are you sure you want to change the base?
Conversation
Uses pi-gpioutil, a wrapper for Wiring Pi's gpio utility, rather than quick2wire's gpio-admin. Benefits include more robust pin exports. Further improvement option: Speed up read/writes by using native code bindings, such as: https://github.com/eugeneware/wiring-pi
deduplicated auto-exporting code
rm getMode
test for board revision
README: inital example adapted README: linebreaks README: export example
Hello. I'm using this branch with my RPi A+. It seems to work so far. Is there something I could do to test it further and let it eventually merge into master? |
Waiting for confirmation that someone has tested this. I don't have a Pi handy to test this on. Just one other person's confirmation would be good enough. |
I've been using this branch with my A+ and although I haven't performed programmatic tests, I can say I haven't had any problems so far. |
Awesome. @tjanson Just looking through the code. Any reason you've used pi-gpioutil for some functions (like export, unexport), but not for others (read, write, etc.)? I don't have a problem with adding pi-gpioutil as a dep, but I'd rather the code be consistent with using pi-gpioutil or fs, but not both. And given the choice, I'd rather reduce deps than adding them. |
It’s been a long time, let me try to remember.
|
seems to be working fine on Model B+, Revision: 1.2... |
Great work tjanson on this branch. One suggestion on overloading the write and read method. Instead of passing a string type argument for 'force', why not pass an object. Something like:
This opens up flexibility for future additions and is more of a standard approach (at least in my experiences). Just a thought. Looking forward to getting this merged in. |
Yes, good point @risingtiger. I wasn’t very familiar with JS when I wrote that. There are probably other possible improvements too. I won’t implement that since I don’t have a Pi for testing at the moment (and other things on my mind). If you’re interested, feel free :) |
Sure thing. I'll have a bit of time later today to jump in on it. |
Would love to see this merge. :) Anyone still working on it? |
I just tried this branch on a Pi2 B+ and get the error:
Edit: Nevermind, I had to install WiringPI first, following the directions here: http://wiringpi.com/download-and-install/. Edit 2: OK, this runs without errors, but does not actually write values to the pins. The node code:
opens gpio26 in "output" mode, but does not set the value to 1. from a 2nd console:
Also tested with a voltmeter. If I manually Any ideas? |
If Oh, this was in fact already filed as issue #45 by @alex-dacosta, and fixed (?) by 82ef7bd on |
exportMode
param)Let me know if any changes are required. Also: This passes all tests and works for me, but should still be tested manually.