lagerschaden

Members
  • Content Count

    34
  • Joined

  • Last visited


Reputation Activity

  1. Like
    lagerschaden got a reaction from DevDrake in OPiZero and GPIO Rootless access from python   
    on Orangepi One you have to add a file like /etc/udev/rules.d/99-gpio.rules
    SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ chown -R root:gpio /sys/devices/platform/sunxi-pinctrl/gpio && chmod -R 770 /sys/devices/platform/sunxi-pinctrl/gpio;\ '" add a group gpio and add the user to it, then you have rootless access to gpio
  2. Like
    lagerschaden got a reaction from barish in [RfC] Make Armbian more IoT friendly?   
    It would be GREAT if rootless access to gpio was integrated in armbian (just like in raspbian).
     
    I made a little test on my Orangepi-One:
    created a group gpio and added the user to the group gpio, then created the file /etc/udev/rules/99-gpio.rules, this makes the access rootless
    # /etc/udev/rules/99-gpio.rules SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ chown -R root:gpio /sys/class/gpio && chmod -R 770 /sys/class/gpio;\ chown -R root:gpio /sys/devices/platform/sunxi-pinctrl/gpio && chmod -R 770 /sys/devices/platform/sunxi-pinctrl/gpio;\ '" Edit (02/09/2018): for later versions of armbian the file must change (tested with 4.14.18 and 4.14.65):
    # /etc/udev/rules.d/97-gpio.rules SUBSYSTEM=="gpio*", PROGRAM="/bin/sh -c '\ chown -R root:gpio /sys/class/gpio && chmod -R 0770 /sys/class/gpio &&\ chown -R root:gpio /sys/devices/platform/soc && chmod -R 0770 /sys/devices/platform/soc'"  
    Now you can use the access on the bash for the PIN PA12 (calculation see https://linux-sunxi.org/GPIO)
    echo 12 > /sys/class/gpio/export # enable access to PA12 sleep 0.1 # wait some time to become gpio12 active echo out > /sys/class/gpio/gpio12/direction # PA12 is output echo 0 > /sys/class/gpio/gpio12/value # PA12 is low echo 1 > /sys/class/gpio/gpio12/value # PA12 is high echo 12 > /sys/class/gpio/unexport # disable access to PA12 My skills in programming are not good enough  to transform this to C, C+, Python etc, but you don't need any root privileges.
  3. Like
    lagerschaden got a reaction from jscax in OPiZero and GPIO Rootless access from python   
    I have the same problem, need rootless acces to GPIO with python.
    I use pyH3 from https://github.com/duxingkei33/orangepi_PC_gpio_pyH3 on an Orangepi One
     
  4. Like
    lagerschaden got a reaction from tkaiser in [orangepione] [kernel 4.11.12.sun8i]   
    4 cores:
    ___ ____ _ ___ / _ \ _ __ __ _ _ __ __ _ ___ | _ \(_) / _ \ _ __ ___ | | | | '__/ _` | '_ \ / _` |/ _ \ | |_) | | | | | | '_ \ / _ \ | |_| | | | (_| | | | | (_| | __/ | __/| | | |_| | | | | __/ \___/|_| \__,_|_| |_|\__, |\___| |_| |_| \___/|_| |_|\___| |___/ Welcome to ARMBIAN 5.35 user-built Debian GNU/Linux 8 (jessie) 3.4.113-sun8i System load: 0.37 0.24 0.10 Up time: 2 min Memory usage: 10 % of 494MB IP: 192.168.3.157 CPU temp: 41°C Usage of /: 82% of 1.1G Last login: Sat Nov 25 16:49:11 2017 from xxxxs-ubuntu.fritz.box pi@orangepione:~$ uname -a Linux orangepione 3.4.113-sun8i #4 SMP PREEMPT Wed Nov 22 13:45:28 CET 2017 armv7l GNU/Linux pi@orangepione:~$ cat /proc/cpuinfo Processor : ARMv7 Processor rev 5 (v7l) processor : 0 BogoMIPS : 1942.85 processor : 1 BogoMIPS : 1942.85 processor : 2 BogoMIPS : 1942.85 processor : 3 BogoMIPS : 1942.85 Features : swp half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt CPU implementer : 0x41 CPU architecture: 7 CPU variant : 0x0 CPU part : 0xc07 CPU revision : 5 Hardware : sun8i Revision : 0000 Serial : 540078678620542709ce pi@orangepione:~$