Python GPIO Library for the Rock64 (R64.GPIO)
#26
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



(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" Angry. ROCK64 is dead platform without any advantage. Buy Raspberry PI 4 !
Away
  Reply


Messages In This Thread
RE: Python GPIO Library for the Rock64 (R64.GPIO) - by mcerveny - 08-22-2018, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pine Rock64 eMMC lifespan moonspell79 3 281 08-19-2021, 06:46 PM
Last Post: bcnaz
  Rock64 No Audio - Solved wbecks 12 16,786 08-13-2021, 01:23 PM
Last Post: blakeadam
Question Hardware issues with Rock64 grobbs 11 2,415 07-24-2021, 10:23 AM
Last Post: robinkyle11
  Trustzone support for Rock64 capablegh 1 284 07-17-2021, 10:15 AM
Last Post: capablegh
  rock64, compile problems "illegal instruction", "memory fault" -> ddr_333Mhz? klausfelix 0 254 07-02-2021, 03:13 PM
Last Post: klausfelix
Information Serial Console for the Rock64 MarkHaysHarris777 33 33,310 06-24-2021, 12:24 PM
Last Post: mikeklien
  lost eletronic component rock64 marvin1986 1 518 06-01-2021, 06:27 PM
Last Post: 8bit
Shocked Rock64 - Reboots after few minutes addezai 2 735 04-22-2021, 07:03 PM
Last Post: addezai
  Rock64 Long Term stability ramprasad 4 2,341 03-16-2021, 07:23 PM
Last Post: Rocklobster
  Safest way to send shutdown signal to headless Rock64 SMB server? bmurphr1 3 1,515 03-14-2021, 06:01 PM
Last Post: clach04

Forum Jump:


Users browsing this thread: 1 Guest(s)