Jump to content

Recommended Posts

Posted

I've been able to use all the other user space I/O without being root. PWM on the other hand seems to create files only after opening device. Is there a udev rule that will work with 4.14 kernel? For all other devices I use a simple rc.local script:

chown -R root:gpio /dev/gpiochip0
chmod -R ug+rw /dev/gpiochip0
chown -R root:gpio /dev/gpiochip1
chmod -R ug+rw /dev/gpiochip1
chown -R root:i2c /dev/i2c-0
chmod -R ug+rw /dev/i2c-0
chown -R root:spi /dev/spidev1.0
chmod -R ug+rw /dev/spidev1.0

 

<
Posted
SUBSYSTEM=="pwm*", PROGRAM="/bin/sh -c '\
        chown -R root:gpio /sys/class/pwm && chmod -R 770 /sys/class/pwm;\
        chown -R root:gpio /sys/devices/platform/soc/*.pwm/pwm/pwmchip* && chmod -R 770 /sys/devices/platform/soc/*.pwm/pwm/pwmchip*\
'"

This seems to set the permissions correctly, but nothing happened (at least no errors) while sudo works fine. I'm using kernel 4.14.18 and it looks like it was merged into the RPi kernel http://lists.infradead.org/pipermail/linux-rpi-kernel/2017-December/007193.html

Posted

I just tested this with Linux NanoPi-Duo 4.16.0-rc6 #239 SMP Wed Apr 11 14:03:49 CST 2018 armv7l armv7l armv7l GNU/Linux using official FriendlyArm image. Just add gpio group, add your non-root user to group and add udev rules /etc/udev/rules.d/99-com.rules I posted above. I tried the Armbian nightly image with 4.16 kernel, but wifi kept dying.

Posted
3 hours ago, sgjava said:

but wifi kept dying.


Just a small remark - wifi on Duo ( and on Opi Zero) is famous XR819 which is "half dead" by default :)

Posted

@Igor the Ubuntu releases (4.14 kernel currently) have been very solid on the Duo. I have one on my network running 24/7 without any issues for months. This was the nightly Debian release with the 4.16 kernel. The interface comes up for less then a minute then dies. I logged into the serial console and it shows wlan0 unavailable (haven't had time to dig in more). I'll wait for the Ubuntu with 4.16 and test again. I'm just happy I can access all the user space stuff without sudo now that PWM works.

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines