Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rock64 Armbian #3

Open
chazhenry opened this issue Nov 26, 2018 · 8 comments
Open

Rock64 Armbian #3

chazhenry opened this issue Nov 26, 2018 · 8 comments

Comments

@chazhenry
Copy link

chazhenry commented Nov 26, 2018

I've git cloned, but can't get this working under Armbian for Rock64. The /sys/class/gpio/export file is present, but not accessible. The gpio101 and gpio102 files are not present. Stuck on this for days. Tried Ubuntu, but it's unstable. Get constant seg faults.

`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
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'`

@ghost
Copy link

ghost commented Dec 14, 2018

There are a couple of typos in _GPIO.py when using the format function
print("You must setup() the GPIO channel ({0} {1}) first").format(gpio_mode, channel)
and others have to be changed to
print("You must setup() the GPIO channel ({0} {1}) first".format(gpio_mode, channel))

@Leapo
Copy link
Owner

Leapo commented Apr 27, 2019

Those aren't typos... it was written that way intentionally, and runs just fine. I even flashed the latest version of Armbian on my Rock64 to test, and had no issues with my current code.

In fact, making your suggested changes causes the library to become completely non-functional on my Rock64. Can you explain why this might be happening?

Edit: Also, chazhenry's post shows that the command runs fine, without modification. It's printing the expected debug text to screen.

@ghost
Copy link

ghost commented Apr 27, 2019

It's printing the expected debug text to screen.

Actually I don't think so, it is a traceback message. See the last line, it states it is an attribute error.
The NoneType is the result of the print function. The code is, as far as I'm aware, only valid
python2 code if standard print statement is used but it throws this execption if python3, or python3 like print function, would be used.

@Leapo
Copy link
Owner

Leapo commented May 5, 2019

I'll note, even if the suggested code needs to be changed, it doesn't solve his problem. Python is only trying to execute the debug text because no GPIO is set up. We need to figure out why GPIO setup is failing to actually solve chazhenry's problem.

@chazhenry Can you try to export the GPIO manually from Bash and see if it works?

@Leapo
Copy link
Owner

Leapo commented May 5, 2019

@ClaudiaFrank After testing with both the Python2 and Python3 console, you're right about the debug text failing under Python3. I'll work on that.

Edit: Updated master with fixed print statements. Thanks for the suggestion!

@ghost
Copy link

ghost commented May 6, 2019

@Leapo, at the moment, I don't have access to a Rock64, the one I was testing is in use by a friend of mine.
I will ask him if he still needs it or whether I can borrow it to make some tests. I will let you know.

@ghost
Copy link

ghost commented May 27, 2019

Sorry, I received the rock64 but it seems broken, so I can't be any help in testing.

@limpid-kzonix
Copy link

limpid-kzonix commented Jun 9, 2019

I can say that everything works fine on Rock64. I had checked GPIO Model on ROCK64 Ver3 in my nodejs project by using basic-gpio package...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants