Good morning, all, and thank you for allowing me to be a part of this community.
This is my first post and I was wanting to use it to assist everyone in getting GPIO working for Tinker Board with Lakka. I had been searching all over the web for how to do this and not having much luck. Finally, after much tribulation, I got it working.
First, my current setup is an Asus Tinker Board S with Lakka OS installed on the eMMC and a 128 GB Samsung micro SD (for storage).
Now, on to the gooey parts.
EASY WAY (eMMC)
- Download my already installed GPIO zip file here.
- Put the ZIP file onto your Lakka OS memory card.
- Enable SSH in Lakka OS by going to Settings->Services.
- SSH into your Tinker Board. Default login is root/root.
- Make a directory in an easy to remember place (in my case, /storage/GPIO).
- Extract the ZIP file in the previously created directory.
- When you make a call to the GPIO in your Python script, ensure the following is added to your file: import sys sys.append.path(’/storage/GPIO’) import ASUS.GPIO as GPIO
NOT-SO-EASY WAY (eMMC)
- Download the zip file from Asus’ Tinker Board GitHub ( https://github.com/TinkerBoard/gpio_lib_python/archive/sbc/tinkerboard/python.zip ).
- Download a new OS that is compatible with Tinker Board.
- Use your favorite bootable SD maker to create a bootable micro SD card (I use Balena Etcher) with the OS you just downloaded (for this purpose, I used Tinker OS).
- Place the python GPIO library on your micro SD.
- Switch your jumper from Parking to Maskrom mode.
- Insert your micro SD into your Tinker Board.
- Boot into the new OS.
- Perform the following from a terminal window: sudo apt-get update sudo apt-get install python2.7 python3 python-dev gcc
- Unzip the python GPIO library ZIP.
- Change into the newly created directory.
- Execute python setup.py install (or python3 setup.py install).
- Once the install is completed, find where the installer stored the GPIO package (should be in /usr/lib/python2.7/dist-packages/ASUS or /usr/lib/python3/dist-packages/ASUS) and perform the following: cp -r /usr/lib/pythonx/dist-packages/ASUS /home/linaro/ Where “x” is the version of python you used to install the package, either 2.7 or 3. Just using python for the install will default to version 2.7.
- Shutdown the Tinker Board.
- Switch the jumper back into parking mode.
- Boot up the Tinker Board into Lakka OS.
- Enable SSH in Lakka OS by going to Settings->Services.
- SSH into your Tinker Board. Default login is root/root.
- Make a directory in an easy to remember place (in my case, /storage/GPIO).
- Extract the ZIP file in the previously created directory.
- When you make a call to the GPIO in your Python script, ensure the following is added to your file: import sys sys.append.path(’/storage/GPIO’) import ASUS.GPIO as GPIO
If you’re running Lakka on an SD card, you’re going to have an even better time, as you’re either going to need multiple SD cards or keep reformatting the same one. I was unable to get Lakka to successfully use wget to fetch the GPIO file. Kept passing a 404 error.