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
On Friday, April 28, 2017 at 9:26:39 AM UTC-5, Metelko wrote:
>
> Thanks Robert! That seemed to have worked. I can control it from my user
> account. I do believe we will be working with PWM devices soon, so I will
> watch for any updates on that.
>
> /sys/class/gpio/gpio43$ ls -al
> total 0
> drwxrwxr-x 3 root gpio 0 Apr 27 21:48 .
> drwxrwxr-x 3 root gpio 0 Apr 27 21:48 ..
> -rw-rw-r-- 1 root gpio 4096 Apr 27 21:48 active_low
> lrwxrwxrwx 1 root gpio 0 Apr 27 21:48 device -> ../../../gpiochip1
> -rw-rw-r-- 1 root gpio 4096 Apr 27 21:48 direction
> -rw-rw-r-- 1 root gpio 4096 Apr 27 21:48 edge
> -rw-rw-r-- 1 root gpio 4096 Apr 27 21:48 label
> drwxrwxr-x 2 root gpio 0 Apr 27 21:48 power
> lrwxrwxrwx 1 root gpio 0 Apr 27 21:48 subsystem ->
> ../../../../../../../class/gpio
> -rw-rw-r-- 1 root gpio 4096 Apr 27 21:48 uevent
> -rw-rw-r-- 1 root gpio 4096 Apr 27 21:48 value
>
>
>
> On Thursday, April 27, 2017 at 4:51:35 PM UTC-5, RobertCNelson wrote:
>>
>> On Thu, Apr 27, 2017 at 4:46 PM, William Hermans <[email protected]>
>> wrote:
>> > By the way, I think the small amount I talked about udev, and
>> permissions on
>> > my git for bonejs. I pretty much got most of that information from rPI
>> > content all over the web. I did have to make several modifications
>> though .
>>
>> if only they had a pwm udev rule. ;)
>>
>> still no go with v4.9.x-ti
>>
>> debian@beaglebone:/sys/class/pwm$ ls -lha
>> total 0
>> drwxrwxr-x 2 root pwm 0 Apr 27 21:39 .
>> drwxr-xr-x 61 root root 0 Apr 27 21:39 ..
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 pwmchip0 ->
>> ../../devices/platform/ocp/48300000.epwmss/48300100.ecap/pwm/pwmchip0
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 pwmchip1 ->
>> ../../devices/platform/ocp/48300000.epwmss/48300200.pwm/pwm/pwmchip1
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 pwmchip3 ->
>> ../../devices/platform/ocp/48302000.epwmss/48302200.pwm/pwm/pwmchip3
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 pwmchip5 ->
>> ../../devices/platform/ocp/48304000.epwmss/48304100.ecap/pwm/pwmchip5
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 pwmchip6 ->
>> ../../devices/platform/ocp/48304000.epwmss/48304200.pwm/pwm/pwmchip6
>>
>> debian@beaglebone:/sys/class/pwm/pwmchip3$ ls -lha
>> total 0
>> drwxrwxr-x 4 root pwm 0 Apr 27 21:48 .
>> drwxr-xr-x 3 root root 0 Apr 27 21:38 ..
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 device -> ../../../48302200.pwm
>> -rw-rw---- 1 root pwm 4.0K Apr 27 21:39 export
>> -rw-rw-r-- 1 root pwm 4.0K Apr 27 21:39 npwm
>> drwxrwxr-x 2 root pwm 0 Apr 27 21:39 power
>> drwxr-xr-x 3 root root 0 Apr 27 21:48 pwm0
>> lrwxrwxrwx 1 root pwm 0 Apr 27 21:39 subsystem ->
>> ../../../../../../../class/pwm
>> -rw-rw-r-- 1 root pwm 4.0K Apr 27 21:39 uevent
>> -rw-rw---- 1 root pwm 4.0K Apr 27 21:39 unexport
>>
>> debian@beaglebone:/sys/class/pwm/pwmchip3/pwm0$ ls -lha
>> total 0
>> drwxr-xr-x 3 root root 0 Apr 27 21:49 .
>> drwxrwxr-x 4 root pwm 0 Apr 27 21:48 ..
>> -r--r--r-- 1 root root 4.0K Apr 27 21:50 capture
>> -rw-r--r-- 1 root root 4.0K Apr 27 21:50 duty_cycle
>> -rw-r--r-- 1 root root 4.0K Apr 27 21:48 enable
>> -rw-r--r-- 1 root root 4.0K Apr 27 21:50 period
>> -rw-r--r-- 1 root root 4.0K Apr 27 21:50 polarity
>> drwxr-xr-x 2 root root 0 Apr 27 21:50 power
>> -rw-r--r-- 1 root root 4.0K Apr 27 21:50 uevent
>>
>> the "pwm0" node always comes up root:root..
>>
>> Regards,
>>
>> --
>> Robert Nelson
>> https://rcn-ee.com/
>>
>
--
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/3a9426dc-3094-4da5-bb33-144449b64d27%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.