The Adafruit_BBIO code usage does work when the user is root. Kindest regards, Mary
> On Jun 1, 2017, at 6:25 PM, William Hermans <[email protected]> wrote: > > > >> On Thu, Jun 1, 2017 at 2:26 PM, Metelko <[email protected]> wrote: >> I have updated my system starting with a base image from: >> https://rcn-ee.com/rootfs/2017-04-07/elinux/ubuntu-16.04.2-console-armhf-2017-04-07.tar.xz >> Then updating the kernel: Linux bbb-266a 4.9.30-ti-rt-r37 #1 SMP PREEMPT RT >> Sun May 28 15:55:20 UTC 2017 armv7l armv7l armv7l GNU/Linux >> >> I am using the udev rule previously suggested: 80-gpio-no-root.rules >> # /etc/udev/rules.d/80-gpio-noroot.rules >> # >> # From: https://forum.pine64.org/showthread.php?tid=2233 >> # >> # Corrects sys GPIO permissions on the Pine64 so non-root users in the >> gpio group can manipulate bits >> # >> # Change group to gpio >> SUBSYSTEM=="gpio", PROGRAM="/bin/sh -c '/bin/chown -R root:gpio >> /sys/devices/platform/ocp/*.gpio'" >> # Change user permissions to ensure user and group have read/write >> permissions >> SUBSYSTEM=="gpio", PROGRAM="/bin/sh -c '/bin/chmod -R ug+rw >> /sys/devices/platform/ocp/*.gpio'" >> >> I am still able to manually export gpio pins from the non-root user account >> and control the GPIO (echo 50 >> export in /sys/class/gpio directory). But >> I am using Adafruit_BBIO to do it in software. When we discussed this last >> (April 27, 2017), I was able to control it from a user account using >> Adafruit_BBIO in a python application. Now I am getting a permission error. >> Did something change in the last month that would effect this? I do not >> see any changes to Adafruit_BBIO that would impact this. >> >> Python 3.5.2 (default, Nov 17 2016, 17:05:23) >> [GCC 5.4.0 20160609] on linux >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import Adafruit_BBIO.GPIO as GPIO >> >>> GPIO.setup("P8_15", GPIO.OUT) >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> ValueError: Set gpio direction failed, missing file or invalid >> permissions. >> >> Kindest regards, >> Mary > > You could see if that is in fact a permissions error by running the python > script as root. If it runs without error, then something in the BBIO library > is not quite ready for prime time yet. My guess is that it would be a simple > pathing issue. e.g. the pathing in the update BBIO library is not quite up to > date. > -- > For more options, visit http://beagleboard.org/discuss > --- > You received this message because you are subscribed to a topic in the Google > Groups "BeagleBoard" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/beagleboard/kKLf8zWAfoM/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/beagleboard/CALHSORrREBLNGPY14436sGgaXKMH9wzSrwK1ce6e%2Bg6ieNoKMQ%40mail.gmail.com. > For more options, visit https://groups.google.com/d/optout. -- For more options, visit http://beagleboard.org/discuss --- You received this message because you are subscribed to the Google Groups "BeagleBoard" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/beagleboard/F257095C-9133-40FE-9C6D-D6AC80D2BD46%40gmail.com. For more options, visit https://groups.google.com/d/optout.
