Tinker Board, Lakka on eMMC, Python GPIO, and You

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)

  1. Download my already installed GPIO zip file here.
  2. Put the ZIP file onto your Lakka OS memory card.
  3. Enable SSH in Lakka OS by going to Settings->Services.
  4. SSH into your Tinker Board. Default login is root/root.
  5. Make a directory in an easy to remember place (in my case, /storage/GPIO).
  6. Extract the ZIP file in the previously created directory.
  7. 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)

  1. Download the zip file from Asus’ Tinker Board GitHub ( https://github.com/TinkerBoard/gpio_lib_python/archive/sbc/tinkerboard/python.zip ).
  2. Download a new OS that is compatible with Tinker Board.
  3. 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).
  4. Place the python GPIO library on your micro SD.
  5. Switch your jumper from Parking to Maskrom mode.
  6. Insert your micro SD into your Tinker Board.
  7. Boot into the new OS.
  8. Perform the following from a terminal window: sudo apt-get update sudo apt-get install python2.7 python3 python-dev gcc
  9. Unzip the python GPIO library ZIP.
  10. Change into the newly created directory.
  11. Execute python setup.py install (or python3 setup.py install).
  12. 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.
  13. Shutdown the Tinker Board.
  14. Switch the jumper back into parking mode.
  15. Boot up the Tinker Board into Lakka OS.
  16. Enable SSH in Lakka OS by going to Settings->Services.
  17. SSH into your Tinker Board. Default login is root/root.
  18. Make a directory in an easy to remember place (in my case, /storage/GPIO).
  19. Extract the ZIP file in the previously created directory.
  20. 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.