This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
GPIO Problem
#1
Hi there !

Just bought the ASUS tinker board and I want to use it for python programming moving servos and stuff.
I wrote a code sample to move the servo using PWM but I got an error on the GPIO.

The error is: "import ASUS.GPIO as GPIO, ImportError: No module named GPIO"

The thing is I installed the API for the GPIOs for python that ASUS says in the board site and followed the instructions step by step, but I'm still getting the same error.

Any answer may help!

Thank you in advance!
Reply
#2
I was also facing similar issue. But at the end, found a simple solution.

1. Download from this official ASUS LINK at this page.  (look for the file " Version -2017/08/16       310.63 KBytes                                                                                                GPIO_API_for_Python).
2. Extract it at any location say Downloads/gpio.
3. cd gpio
4. sudo python setup.py install   ( use python3 in case of python 3)
5. copy GPIO.so from ASUS folder, and paste it inside /home/linaro/ASUS/
6. Thats it !!

try giving import ASUS.GPIO as GPIO in python .
Reply
#3
(01-06-2018, 06:41 PM)paa_wan Wrote: I was also facing similar issue. But at the end, found a simple solution.

1. Download from this official ASUS at this (look for the file " Version -2017/08/16       310.63 KBytes                                                                                                GPIO_API_for_Python).
2. Extract it at any location say Downloads/gpio.
3. cd gpio
4. sudo python setup.py install   ( use python3 in case of python 3)
5. copy GPIO.so from ASUS folder, and paste it inside /home/linaro/ASUS/
6. Thats it !!

try giving import ASUS.GPIO as GPIO in python .

Hello, this method don't work Sad
Error: "The error is: "import ASUS.GPIO as GPIO, ImportError: No module named GPIO"" - are stays

Test on a TinkerOS_Debian V2.0.7
Reply
#4
Please take a try with below library

https://github.com/TinkerBoard/gpio_lib_python
https://github.com/TinkerBoard/gpio_lib_c
(and install them both.)
[-] The following 1 user Likes Tinker Board's post:
  • Germidar
Reply
#5
You may check where the package is installed
Code:
$ find /usr/ -iname *gpio*
I've just tried for myself and I done:
  • Extract the file
  • cd where the package is estracted
  • Code:
    $ make
  • Verify
    Code:
    python
  • Code:
    >>> import Rpi.GPIO as GPIO
The import ASUS.GPIO as GPIO didn't work.
Reply
#6
(09-12-2018, 03:58 AM)Tinker Board Wrote: Please take a try with below library

link://github.com/TinkerBoard/gpio_lib_python
link://github.com/TinkerBoard/gpio_lib_c
(and install them both.)

After reinstall libs by your links, my programs that were written on the "С" started working. Thanks you.


(09-12-2018, 04:22 AM)Im4Tinker Wrote: You may check where the package is installed
Code:
$ find /usr/ -iname *gpio*
I've just tried for myself and I done:
  • Extract the file
  • cd where the package is estracted
  • Code:
    $ make
  • Verify
    Code:
    python
  • Code:
    >>> import Rpi.GPIO as GPIO
The import ASUS.GPIO as GPIO didn't work.

1. I did not find make file in the folders under your instructions.
2. Change "ASUS.GPIO" on "Rpi.GPIO" did not give results.

UPD: Thanks, Im4Tinker it is worker if wirite "RPi". "Rpi" dosn't worked.
Reply
#7
I downloaded as per the above mentioned link. I downloaded in a zip file. Once unpacked I got in the directory and issue a make. That did the whole job for me.
I wonder why is not import ASUS.GPIO, which is there in the directory, too.
Sorry for misleading you by the typo Sad

Anyway, I repeat it, but I think it's not fully working on python3.7 and Archlinuxarm, as I have. I can import ASUS without .GPIO, but no working.
Well, the new download is not working either. The original installation contains already a setup and it's working as stated.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)