TinkerBoard / gpio_lib_python

MIT License
40 stars 19 forks source link

ASUS tinker board 2s, GPIO runtime error #7

Open tangochuynam opened 2 years ago

tangochuynam commented 2 years ago

after installing asus gpio and I import ASUS.GPIO as GPIO, it shows this error RuntimeError: This module can only be run on a ASUS Pi!

tangochuynam commented 2 years ago

I check the py_gpio.c and found this error. // detect board revision and set up accordingly

if (get_asuspi_info(&asuspiinfo))
{
    PyErr_SetString(PyExc_RuntimeError, "This module can only be run on a ASUS Pi!");
    setup_error = 1;

check code in cpuinfo.c, this snippet code I don't understand it involves for older tinkerboard, maybe not work for tinker board2s if (!found) return -1; info->p1_revision = 3; strcpy(info->revision, revision); info->type = "Tinker Board"; info->processor = "ROCKCHIP3288"; info->manufacturer = "ASUS"; info->ram = "1024M";

wzerowx commented 2 years ago

I use the latest version(Debian-Buster-v2.0.0),The same problem is not fixed.

JasonShiao commented 2 years ago

I think it'd be better to use /proc/device-tree/model for board identification instead of /proc/cpuinfo, whose display format is more likely to change.

dpergarc commented 2 years ago

I have "Tinker Board 2 Debian 10 V2.0.4" OS for the 2S board and the GPIO driver is not working either, is there any solution to make a simple led on/off test?

JasonShiao commented 2 years ago

As a workaround, you can simply modify the get_asuspi_info function in source/cpuinfo.c and make it return 0.

dpergarc commented 2 years ago

I have just tried that workaround, and despite the fact that it compiles and executes the script, the operation of switching on/off the led is not executed.

yishinhung commented 2 years ago

Hi @tangochuynam ,. @JasonShiao @dpergarc : The gpio python library of ASUS tinker board 2s(RK3399) preinstall in the image by default. Don't reinstall and compiler the source by the github because the github library is for Tinker Board S(rk3288). Please reference the related source path for Tinker board 2s in /usr/local/share/gpio_lib_python_rk3399/

Thank a lot!