Python GPIO Library for the Rock64 (R64.GPIO)
#31
I can run under Ubuntu, but can't run the test script under Armbian. Using python3 I get:

Code:
root@rock64:/home/sas# python3 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  {'RAM': '1024M', 'PROCESSOR': 'BCM2837', 'TYPE': 'Pi 3 Model B', 'REVISION': 'a22082', 'P1_REVISION': 3, '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 ({0} {1}) first
Traceback (most recent call last):
  File "gpio_test.py", line 42, in <module>
    var_gpio_state = GPIO.input(var_gpio_out)                   # Return state of GPIO
  File "/home/sas/R64/_GPIO.py", line 210, in input
    if validate_direction(channel, 'both') == 0:
  File "/home/sas/R64/_GPIO.py", line 118, in validate_direction
    print("You must setup() the GPIO channel ({0} {1}) first").format(gpio_mode, channel)
AttributeError: 'NoneType' object has no attribute 'format'
  Reply
#32
Heads up: I'm not dead, and I'm actively working on this library again.

Just updated with bug fixes:
1. Improved GPIO.input compatibility (now returns an int rather than a string).
2. Fixed Python3 compatibility.
3. Updated install instructions in the Github wiki.

I'm working on RockPro64 support now.
  Reply
#33
(05-06-2019, 11:17 AM)Leapo Wrote: Heads up: I'm not dead, and I'm actively working on this library again.

Just updated with bug fixes:
1. Improved GPIO.input compatibility (now returns an int rather than a string).
2. Fixed Python3 compatibility.
3. Updated install instructions in the Github wiki.

I'm working on RockPro64 support now.

Appreciate and thanks on working at ROCKPro64 support. Please PM your shipping address (include phone number for shipping purpose), I will send a Rock64 v3 SBC to you.
  Reply
#34
(11-20-2018, 01:55 PM)pantera Wrote: I can run under Ubuntu, but can't run the test script under Armbian. Using python3 I get:

Code:
root@rock64:/home/sas# python3 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  {'RAM': '1024M', 'PROCESSOR': 'BCM2837', 'TYPE': 'Pi 3 Model B', 'REVISION': 'a22082', 'P1_REVISION': 3, '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 ({0} {1}) first
Traceback (most recent call last):
  File "gpio_test.py", line 42, in <module>
    var_gpio_state = GPIO.input(var_gpio_out)                   # Return state of GPIO
  File "/home/sas/R64/_GPIO.py", line 210, in input
    if validate_direction(channel, 'both') == 0:
  File "/home/sas/R64/_GPIO.py", line 118, in validate_direction
    print("You must setup() the GPIO channel ({0} {1}) first").format(gpio_mode, channel)
AttributeError: 'NoneType' object has no attribute 'format'

I was getting a similar error when running the test Python file from the terminal using the Armbian_20.08.1_Rock64_bionic_legace_4.4.213_desktop image. I did get it to work using sudo.

To get it to work without sudo I ran the following command from the terminal based on the discussion at https://forum.armbian.com/topic/8714-gpi...-non-root/:

chmod 4775 
/usr/bin/python

I don't know secure this is but it worked.

I tried the steps from https://forum.pine64.org/showthread.php?tid=2233 without success.
  Reply
#35
I'm trying to get a Filament-Sensor working on my rock64 with armbian installed and octoprint. Any help? Gpio Kris saying failed not a pi device.
  Reply
#36
I'm trying to get a Filament-Sensor working on my rock64 with armbian installed and octoprint. Any help? Gpio Kris saying failed not a pi device.
  Reply
#37
(03-21-2021, 11:14 PM)Impaled Wrote: I'm trying to get a Filament-Sensor working on my rock64 with armbian installed and octoprint. Any help? Gpio Kris saying failed not a pi device.
Sometimes you can get past this by renaming R64.GPIO to RPi.GPIO.
  Reply
#38
Internal SoC PullUps are usually between 20K to 100K.

So, using a external PullDown to put it low is like creating a voltage divider with the internal pullup, therefore with a external 20K, you get a voltage that is neither a LOW or a HIGH, explaining why you get interrupts triggered repeatedly.

If you use a external 1K as a pulldown instead, you will see that will be close to 0V ...
__________________________
First Motion Products
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Rock64 bricked shawwwn 0 1 50 minutes ago
Last Post: shawwwn
  Are you guys still using Ayufan's OMV on your Rock64? AkiraSensei 0 62 11-26-2021, 07:01 PM
Last Post: AkiraSensei
  Rock64 kernel panics clay 15 984 10-17-2021, 06:30 PM
Last Post: Rocklobster
  Pine Rock64 eMMC lifespan moonspell79 3 743 08-19-2021, 06:46 PM
Last Post: bcnaz
  Rock64 No Audio - Solved wbecks 12 18,671 08-13-2021, 01:23 PM
Last Post: blakeadam
  Trustzone support for Rock64 capablegh 1 546 07-17-2021, 10:15 AM
Last Post: capablegh
  rock64, compile problems "illegal instruction", "memory fault" -> ddr_333Mhz? klausfelix 0 449 07-02-2021, 03:13 PM
Last Post: klausfelix
Information Serial Console for the Rock64 MarkHaysHarris777 33 36,684 06-24-2021, 12:24 PM
Last Post: mikeklien
  lost eletronic component rock64 marvin1986 1 769 06-01-2021, 06:27 PM
Last Post: 8bit
Shocked Rock64 - Reboots after few minutes addezai 2 1,101 04-22-2021, 07:03 PM
Last Post: addezai

Forum Jump:


Users browsing this thread: 1 Guest(s)