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
  Rock64 won't boot luminosity7 7 1,033 01-30-2023, 12:43 PM
Last Post: fxc
  Rock64 board not working, no HDMI no Ethernet. EDited 3 2,122 01-17-2023, 02:31 PM
Last Post: Flagtrax
  How well does Rock64 deal with HDR and Atmos on Kodi? drvlikhell 2 534 12-16-2022, 09:51 PM
Last Post: drvlikhell
  ROCK64 v3 can it boot from USB? Tsagualsa 4 592 11-29-2022, 11:31 AM
Last Post: Macgyver
  rock64 v3 spiflash Macgyver 0 251 11-28-2022, 02:18 PM
Last Post: Macgyver
  OpenWRT on the Rock64 CanadianBacon 9 4,018 11-05-2022, 03:07 PM
Last Post: wilsonYan
  my rock64 dosen't work rookie_267 0 435 10-07-2022, 07:50 PM
Last Post: rookie_267
  Rock64 u-boot for eMMC Build Error mexicanflyer 0 494 09-18-2022, 02:29 PM
Last Post: mexicanflyer
  ROCK64 - Not start mathieu 0 697 07-11-2022, 03:49 AM
Last Post: mathieu
  Rock64 bricked shawwwn 6 3,715 01-29-2022, 05:49 AM
Last Post: shawwwn

Forum Jump:


Users browsing this thread: 1 Guest(s)