jwhitehorn / pi_piper

Event driven Raspberry Pi GPIO programming in Ruby
BSD 2-Clause "Simplified" License
694 stars 71 forks source link

Yet Another Problem #77

Open ghost opened 8 years ago

ghost commented 8 years ago

After doing Sudo ruby xxxx.rb /usr/uibl ruibylgews/1.9.1/ (Errno: :EBUSY) e Device or resource busy /sys/class/gpio/export r from piper-2.0.0/u b:65:in export from /usr/lib/ piper-2.e.e/uib/pi piper/bca283 b:34:in pin input. piper.2.0.0/uib/pi piper/pin.rb: sin initialize from /usr/lib/ruby/gems/1.9.1/gems/pi piper 2.0.0/uib/pi piper.rb115:in from /usr/lib/ruby/gems/1.9.1/gems/pi piper-2,0.0/uib/pi piper,rb1151in new block in Watch

Not completely correct. Sorry😀

zsyed91 commented 8 years ago

instead of sudo ruby xxx.rb please run rvmsudo ruby xxx.rb.

Check out https://rvm.io/integration/sudo for a detailed explanation. sudo does not pass the session to the script which is why rvmsudo is needed. Please try that and let me know if it works for you.

ghost commented 8 years ago

I don't know how to use RvmSudo

On Jun 15, 2016, at 1:21 PM, Zshawn Syed notifications@github.com wrote:

instead of sudo ruby xxx.rb please run rvmsudo ruby xxx.rb.

Check out https://rvm.io/integration/sudo for a detailed explanation. sudo does not pass the session to the script which is why rvmsudo is needed. Please try that and let me know if it works for you.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

zsyed91 commented 8 years ago

Well, its pretty simple:

  1. Install rvm
  2. Install a ruby via rvm install 2.1.0 or if you want latest, rvm install 2.3.0.
  3. Run rvmsudo ruby xxx.rb

Let me know if your script works after doing the above. It is crucial to run the script via rvmsudo.

ghost commented 8 years ago

That is simpler than I expected but do I have to reinstall ruby? I have it installed already and it took me forever to re update everything.

zsyed91 commented 8 years ago

I don't believe so, if you wanted to use the system ruby or whichever you have installed already. In that case, simply try running step 1 and step 3.

zsyed91 commented 8 years ago

@riolibrary Did you get your project working?

ghost commented 8 years ago

No :disappointed: @zsyed91 I tried to run: rvmsudo ruby xxx.rb

and it gave the same error except with something about a secure path

Please help, I have been with this project for a couple months now and would like to finish it

elmatou commented 8 years ago

from the few line you posted I can understand that you run with a linux permission issue, which is not specific to PiPiper.

Rasbian requires that gpio are accessed by an user with root privileges (which is not really true with jessy based raspian, but for clarity we will stick to that assomption)

@riolibrary, could you copy/paste an extensive backtrace showing your bug. Also we need to know which ruby you installed and how you did it.

maraaaa commented 8 years ago

@riolibrary did you ever get this issue resolved? If so, what was the fix?

If not can we try a few things?

Finally, as @elmatou points out, we'll need some more logging to better help you debug. If you can post a full backtrace of your errors it would be immensely helpful.