[Aug 6] Debian Stretch Minimal 64bit (0.7.8) / Ubuntu 18.04 Bionic LXDE Desktop Image (0.7.8) / Ubuntu 18.04 Bionic minimal 64bit / 32bit Image (0.7.8) / Ubuntu 18.04 Bionic Containers Image (0.7.8) / Stretch OpenMediaVault OS Image armhf / Stretch OpenMediaVault OS Image arm64 ( 0.7.8) - ROCK64 | [June 25] Stock Android 8.1 - ROCK64 | [June 19] Armbian (5.42) - ROCK64 | [June 19] Armbian (5.38) - PINE A64(+) / PINE A64-LTS / SOPINE

Project Inspiration | Get Started | IRC Logs | Forum Rules/Policy


Python GPIO Library for the Rock64 (R64.GPIO)
#21
Hey all -

I was referred here by lukasz after posting this thread wondering about using an RPi GPIO-based LCD screen.

Would installing the python GPIO library help with their drivers, which seem to be RPi-specific binaries?  

It seems to me they're apples and oranges, but I'm not a low-level h/w or s/w guy, so...

I just want a small display to show me what's happening during boot of an otherwise headless system.
Reply
#22
(04-08-2018, 04:11 AM)i69fstop Wrote: Hi @Leapo

I have this error..running
Code:
R64-GPIO-test.py



Code:
[email protected]:/home/Rock64-R64.GPIO# sudo python R64-GPIO-test.py
Testing R64.GPIO Module...

Module Variables:
Name           Value
----           -----
GPIO.ROCK      ROCK
GPIO.BOARD     BOARD
GPIO.BCM       BCM
GPIO.OUT       out
GPIO.IN        in
GPIO.HIGH      1
GPIO.LOW       0
GPIO.PUD_UP    0
GPIO.PUD_DOWN  1
GPIO.VERSION   0.6.3
GPIO.RPI_INFO  {'P1_REVISION': 3, 'RAM': '1024M', 'REVISION': 'a22082', 'TYPE': 'Pi 3 Model B', 'PROCESSOR': 'BCM2837', 'MANUFACTURER': 'Embest'}
Error: Unable to export GPIO
Error: Unable to set GPIO direction
Error: Unable to export GPIO
Error: Unable to set GPIO direction

Testing GPIO Input/Output:
You must setup() the GPIO channel first
Output State : None
You must setup() the GPIO channel as an output first
You must setup() the GPIO channel first
Input State  : None
You must setup() the GPIO channel as an output first

Testing PWM Output - DutyCycle - High Precision:
60Hz at 50% duty cycle for 1 second
Traceback (most recent call last):
  File "R64-GPIO-test.py", line 58, in <module>
    p.start(50)
  File "/home/Rock64-R64.GPIO/R64/_GPIO.py", line 333, in start
    self.pwm_calc()
  File "/home/Rock64-R64.GPIO/R64/_GPIO.py", line 350, in pwm_calc
    self.sleep_low = (1.0 / self.freq) * ((100 - self.dutycycle) / 100.0)
AttributeError: PWM instance has no attribute 'freq'
[email protected]:/home/Rock64-R64.GPIO# uname -a
Linux rock64 4.4.114-rockchip-ayufan-193 #1 SMP Sun Mar 4 20:24:21 UTC 2018 aarch64 GNU/Linux

@Leapo

I update to 4.4.120, it fixed the issue with IO  error


Code:
Linux rock64 4.4.120-rockchip-ayufan-209 #1 SMP Mon Apr 2 16:05:07 UTC 2018 aarch64 GNU/Linux

Hi,

I had rock64 4.4.77 image. I faced the same issue with python GPIO lib. So I tried upgrading with "sudo apt-get upgrade" and sudo apt-get dist-upgrade".
After when I tried to reboot, it wasn't booting up.

Can you please share the link of the OS which is working for python GPIO library.


Regards
Reply
#23
Add me to the "interested but not working" list. Debian Stretch 4.4.124, tried the original and the AnythingIsFine version that was edited for newer kernels. Still the same errors, unable to export GPIO and unable to set GPIO direction.
Reply
#24
Actually, I just got it working using AnythingIsFine's modified version. For anyone else having issues (and maybe this was mentioned and I just missed it), try running it as root.
Reply
#25
Hi,
using informations found on this forum, i made a little app in C++ to use gpio lines. This works, but root is required, which is embarrassing.
I tried to add my user (rock64) on the sudo group as i've read elsewhere (§sudo usermod -a -G sudo rock64 ), but this has no effect.

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?

regards
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  How can I install tvheadend server un rock64? gedas07 8 287 10 hours ago
Last Post: gedas07
  Ubuntu core porting on rock64 devangpanchal90 3 173 08-11-2018, 10:37 PM
Last Post: devangpanchal90
Question [Help Needed] Vehicle infotainment system using Rock64 fender90 1 100 08-11-2018, 02:03 AM
Last Post: evinrude
  GPIO LED blinker using SYSFS on the Rock64 MarkHaysHarris777 20 4,033 08-09-2018, 10:52 AM
Last Post: ulysse132
  RFE for next ROCK64 mcerveny 3 300 08-08-2018, 06:13 AM
Last Post: qux
  Compatible WiFi modules for Rock64 j3eeenet 8 1,819 08-08-2018, 02:06 AM
Last Post: AnythingIsFine
  ROCK64 RTC Avengerman14s 8 388 08-06-2018, 03:01 PM
Last Post: petec
  Rock64 missing /sys/bus/platform/drivers/rockchip-dmc/dmc? tocirahl 2 95 08-04-2018, 05:07 PM
Last Post: tocirahl
  My Rock64 no power or light issue Nolaboy406 3 224 07-24-2018, 12:52 AM
Last Post: Luke
  Most stable OS for Kodi on Rock64? Sauromayne 19 6,708 07-14-2018, 06:44 PM
Last Post: levinliaw

Forum Jump:


Users browsing this thread: 1 Guest(s)