-
Notifications
You must be signed in to change notification settings - Fork 71
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
Doesn't work on Raspbian JESSIE? #68
Comments
Haven't gotten a chance to upgrade to jessie yet so I am not sure. It seems like the changes in jessie mean you don't need sudo access for GPIO anymore. But to be safe, did you try running your script or irb session using I can take a look but AFAIK
If you say that the led is already on before the script, then either your wiring is done in a way that power is always getting to the led or something else has locked the pin. In the latter case, that would definitely be a bug if it isn't throwing an error. |
tell us also which version of PiPiper you are using. |
Here is what I notice:
Then: # same as rvmsudo but for rbenv
rbenv sudo irb
irb(main):001:0> require 'pi_piper'
=> true
irb(main):002:0> include PiPiper
=> Object
irb(main):005:0* pin = PiPiper::Pin.new(:pin => 13, :direction => :out)
=> #<PiPiper::Pin:0x5665da18 @pin=13, @direction=:out, @invert=false, @trigger=:both, @pull=0, @last_value=nil, @value=0>
# LED is off
irb(main):006:0> pin.on?
=> false
irb(main):007:0> pin.on
=> 1
# LED is still off
irb(main):008:0> pin.on?
=> false I'm using |
If I try to use pi_piper without irb(main):004:0* pin = PiPiper::Pin.new(:pin => 11, :direction => :out)
bcm2835_init: Unable to open /dev/mem: Permission denied
Errno::EACCES: Permission denied @ rb_sysopen - /sys/class/gpio/gpio11/direction
from /home/pi/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/pi_piper-2.0.0/lib/pi_piper/bcm2835.rb:61:in `write'
from /home/pi/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/pi_piper-2.0.0/lib/pi_piper/bcm2835.rb:61:in `pin_direction'
from /home/pi/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/pi_piper-2.0.0/lib/pi_piper/bcm2835.rb:45:in `pin_output'
from /home/pi/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/pi_piper-2.0.0/lib/pi_piper/pin.rb:56:in `initialize'
from (irb):4:in `new'
from (irb):4
from /home/pi/.rbenv/versions/2.3.0/bin/irb:11:in `<main>'
irb(main):005:0> |
It works! The GPIO 17 pin is on the place 11, but it's still called "17". Conclusion:
Thanks for your help! :) |
Ah yes, I was thinking that might be it. I will update the documentation to make this clearer. I noticed that others have had that same misunderstanding. I am glad that it works for you though! |
I try to use this gem but I don't manage to control any pin.
I have no error message, but nothing happens on my board.
The LED on pin 17 is on, since the boot of the raspberry. But:
Does anyone succeed to make it work on Raspbian Jessie + Ruby 2?
The text was updated successfully, but these errors were encountered: