05-11-2018, 02:56 AM
(04-27-2018, 03:04 PM)Leapo Wrote: Looking over their code... might be useful, but their interrupt implementation is pretty thin compared to RPi.GPIO
Current progress: One interrupt feature is in. The background threading required to implement the others is slowing me down a bit, but I'm still working on it.
Hi Leapo,
First off, thanks for taking the time to port RPi.GPIO lib to Rock64 !
I have a Rock64, running Armbian 5.42 Ubuntu Xenial minimal (4.4.124-rk3328) and trying to use the R64 GPIO lib .
I read your note, stating testing was done on using Ayufan's release 0.5.15 and other distros/versions are not guaranteed to work, yet I want to inquire of a certain error I am receiving.
I used the "prefered" way of getting the lib, downloading the R64 directory and running the script in the same path as it.
The module seems to be imported, yet I get some errors when exporting the the GPIO pin, like below:
root@rock64:/home/pi/projects# cat gpio_test.py
import R64.GPIO as GPIO
pin = 16
GPIO.setmode(GPIO.BOARD)
GPIO.setup(pin, GPIO.OUT, initial=GPIO.HIGH)
#GPIO.setwarnings(False)
root@rock64:/home/pi/projects# python gpio_test.py
Error: Unable to export GPIO
Error: Unable to set GPIO direction
root@rock64:/home/pi/project
I want to add , I tried the script as 'root', as at first I believed it could not write tot he '/sys/class/gpio/export' file. I tried mode BCM (pin=23), ROCK(pin=101), BOARD(pin=16), always getting the same error.
If I try to set pin 16 to "out" via bash, it works, but only If I add an offset of 1000, i.e 101 becomes 1101. Could this be the reason why the R64.GPIO lib fails, where should I go about to add this offset in the lib if possible ?
Thanks!