Can you enhance and register package to "pypi" ?
Like:
https://pypi.org/project/RPi.GPIO/
https://pypi.org/project/Adafruit-GPIO/
https://pypi.org/project/OPi.GPIO/
https://pypi.org/project/OrangePi.GPIO/
Can you enhance build to debian binary package and distribute over ayufan ppa ?
Like:
https://packages.debian.org/buster/python-rpi.gpio
https://packages.debian.org/buster/python3-rpi.gpio
https://packages.debian.org/buster/rpi.gpio-common
Yes, possible. First, choose the group, "dialout" is recommended not "sudo".
Like:
https://pypi.org/project/RPi.GPIO/
https://pypi.org/project/Adafruit-GPIO/
https://pypi.org/project/OPi.GPIO/
https://pypi.org/project/OrangePi.GPIO/
Can you enhance build to debian binary package and distribute over ayufan ppa ?
Like:
https://packages.debian.org/buster/python-rpi.gpio
https://packages.debian.org/buster/python3-rpi.gpio
https://packages.debian.org/buster/rpi.gpio-common
(08-08-2018, 09:10 AM)pas059 Wrote: Someone knows a solution to use gpio app (that uses sysfs) outside root? or another method to use gpio lines than sysfs which does not requires root?
Yes, possible. First, choose the group, "dialout" is recommended not "sudo".
Code:
$ ### test default situation
$ id -a
uid=1000(rock64) gid=1000(rock64) groups=1000(rock64),4(adm),27(sudo),29(audio),44(video),46(plugdev),104(input),109(ssh)
$ ls -la /sys/class/gpio/export
--w------- 1 root root 4096 Aug 22 19:51 export
$ echo 102 > /sys/class/gpio/export
-bash: /sys/class/gpio/export: Permission denied
$ ### modify system
$ sudo bash
# cat > /etc/udev/rules.d/gpio.rules <<'EOF'
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys/class/gpio/export /sys/class/gpio/unexport ; chmod 220 /sys/class/gpio/export /sys/class/gpio/unexport'"
SUBSYSTEM=="gpio", KERNEL=="gpio*", ACTION=="add", PROGRAM="/bin/sh -c 'chown root:dialout /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value ; chmod 660 /sys%p/active_low /sys%p/direction /sys%p/edge /sys%p/value'"
EOF
# usermod -a -G dialout rock64
# reboot
$ ### now working access over "dialout" group
$ id -a
uid=1000(rock64) gid=1000(rock64) groups=1000(rock64),4(adm),20(dialout),27(sudo),29(audio),44(video),46(plugdev),104(input),109(ssh)
$ ls -la /sys/class/gpio/export
--w--w---- 1 root dialout 4096 Aug 22 20:48 /sys/class/gpio/export
$ ### cpu pin 102 == GPIO3_A6 == pinheader pin 18
$ echo 102 > /sys/class/gpio/export
$ ls -l /sys/class/gpio/gpio102/
total 0
-rw-rw---- 1 root dialout 4096 Aug 22 20:50 active_low
lrwxrwxrwx 1 root root 0 Aug 22 20:51 device -> ../../../pinctrl
-rw-rw---- 1 root dialout 4096 Aug 22 20:50 direction
-rw-rw---- 1 root dialout 4096 Aug 22 20:50 edge
drwxr-xr-x 2 root root 0 Aug 22 20:51 power
lrwxrwxrwx 1 root root 0 Aug 22 20:51 subsystem -> ../../../../../class/gpio
-rw-r--r-- 1 root root 4096 Aug 22 20:50 uevent
-rw-rw---- 1 root dialout 4096 Aug 22 20:50 value
$ echo out > /sys/class/gpio/gpio102/direction
$ echo 0 > /sys/class/gpio/gpio102/value
$ echo 1 > /sys/class/gpio/gpio102/value
$ echo in > /sys/class/gpio/gpio102/direction
$ cat /sys/class/gpio/gpio102/value
1
$ echo 102 > /sys/class/gpio/unexport
I left this community in Aug 2019 due to PINE64 refusal to produce/deliver ROCK64-1G version 3 after more than one year of changing statuses to "planning", "evaluating", "releasing", "availability", "estimated availability" and finally "no schedule" . ROCK64 is dead platform without any advantage. Buy Raspberry PI 4 !