debian-on-Termux via debootstrap & proot working on TinkerOS_Android 7 Nougat V14.3.2.82
following Termux Wiki Debian - from https://wiki.termux.com/wiki/PRoot
From
Termux Wiki Debian, You can also install Debian with this method..
debian-on-termux
HOWTO install Debian 9 (stretch) on your Android smartphone by sp4rkie
this installs Debian Buster 10.1 ;-]....
change to home folder to install...
Code:
cd ~/
apt update
apt install wget
hash -r
wget https://raw.githubusercontent.com/sp4rkie/debian-on-termux/master/debian_on_termux.sh
this downloads the install shell script to the home folder..
update - download to home folder..
The
Debian 10/buster release key is 6D33 866E DD8F FA41 C014 3AED DCC9 EFBF 77E1 1517
Code:
wget https://ftp-master.debian.org/keys/release-10.asc
now check top of debian_on_termux.sh file.. has
#!/data/data/com.termux/files/usr/bin/sh
& you have to edit section.. # add the key for stable (Debian Stable Release Key) to..
Code:
...
# add the key for stable (Debian Stable Release Key)
apt-key add /data/data/com.termux/files/home/release-10.asc
# add the keys for testing, unstable (Debian Archive Automatic Signing Key)
#apt-key adv --recv-keys 648ACFD622F3D138
...
save file.. ;-]... comment out the keys for testing,.
execute the script..
Code:
sh debian_on_termux.sh
after some time.. 11mins for me... ]]..
list home folder..
Code:
bash:5.0][u0_a60]@~:$ ll
total 114K
drwx------ 17 u0_a60 u0_a60 3.5K Oct 29 01:43 ./
drwx------ 18 u0_a60 u0_a60 3.5K Sep 14 02:03 ../
-rw------- 1 u0_a60 u0_a60 235 Oct 28 03:35 .bash_aliases
-rw------- 1 u0_a60 u0_a60 26K Oct 29 01:43 .bash_history
-rw------- 1 root root 3.8K Oct 28 03:44 .bash_history_root
-rw------- 1 u0_a60 u0_a60 254 Sep 2 07:11 .bash_logout
-rw------- 1 u0_a60 u0_a60 4.9K Oct 21 12:55 .bashrc
drwx------ 4 u0_a60 u0_a60 3.5K Sep 18 10:35 .cache/
drwx------ 5 u0_a60 u0_a60 3.5K Sep 2 07:30 .config/
drwx------ 3 u0_a60 u0_a60 3.5K Sep 2 07:30 .local/
-rw------- 1 u0_a60 u0_a60 49 Oct 20 18:58 .python_history
drwx------ 2 u0_a60 u0_a60 3.5K Sep 17 01:10 .screen/
drwx------ 2 u0_a60 u0_a60 3.5K Sep 2 06:46 .ssh/
drwx------ 2 u0_a60 u0_a60 3.5K Sep 2 07:44 .termux/
drwx------ 2 u0_a60 u0_a60 3.5K Oct 22 16:15 .w3m/
-rw------- 1 u0_a60 u0_a60 219 Oct 29 01:27 .wget-hsts
drwx------ 2 u0_a60 u0_a60 3.5K Oct 26 12:31 bin/
drwx------ 8 u0_a60 u0_a60 3.5K Oct 25 03:23 code/
-rw------- 1 u0_a60 u0_a60 8.6K Oct 29 01:20 debian_on_termux.sh
drwxr-xr-x 17 u0_a60 u0_a60 3.5K Oct 29 01:36 deboot_debian/
lrwxrwxrwx 1 u0_a60 u0_a60 19 Oct 29 01:21 debootstrap -> debootstrap-1.0.116/
drwx------ 4 u0_a60 u0_a60 3.5K Oct 29 01:21 debootstrap-1.0.116/
drwx------ 3 u0_a60 u0_a60 3.5K Sep 2 07:29 kPATH/
drwx------ 2 u0_a60 u0_a60 3.5K Sep 2 07:29 notes/
drwx------ 2 u0_a60 u0_a60 3.5K Sep 2 07:04 storage/
drwx------ 3 u0_a60 u0_a60 3.5K Oct 28 04:26 temp/
bash:5.0][u0_a60]@~:$
there is now new folder bin, that contains the startup shell script for Debian..
and deboot_debian folder, that contains the debian file system Folders..
list bin folder, get file stat of starup file deboot_debian
Code:
bash:5.0][u0_a60]@~:$ cd bin/
bash:5.0][u0_a60]@~/bin:$ ll
total 8.0K
drwx------ 2 u0_a60 u0_a60 3.5K Oct 26 12:31 ./
drwx------ 17 u0_a60 u0_a60 3.5K Oct 29 01:43 ../
-rwxr-xr-x 1 u0_a60 u0_a60 1009 Oct 29 01:36 enter_deb*
bash:5.0][u0_a60]@~/bin:$
bash:5.0][u0_a60]@~:$ stat ./bin/enter_deb
File: ./bin/enter_deb
Size: 1009 Blocks: 2 IO Block: 4096 regular file
Device: b30eh/45838d Inode: 218297 Links: 1
Access: (0755/-rwxr-xr-x) Uid: (10060/ u0_a60) Gid: (10060/ u0_a60)
Access: 2019-10-26 12:31:58.539367722 +0100
Modify: 2019-10-29 01:36:24.007199804 +0000
Change: 2019-10-29 01:36:24.017199805 +0000
Birth: -
bash:5.0][u0_a60]@~:$
now check and edit startup file with.. nano enter_deb
Code:
#!/data/data/com.termux/files/usr/bin/sh
unset LD_PRELOAD
SHELL_=/bin/bash
ROOTFS_TOP_=deboot_debian
ROOT_=1
USER_=u0_a60
SCRIPTNAME=enter_deb
show_usage () {
echo "Usage: $SCRIPTNAME [options] [command]"
echo "$SCRIPTNAME: enter the installed debian guest system"
echo ""
echo " -0 - mimic root (default)"
echo " -n - prefer regular termux uid ($USER_)"
exit 0
}
while getopts :h0n option
do
case "$option" in
h) show_usage;;
0) ;;
n) ROOT_=0;;
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
esac
done
shift $(($OPTIND-1))
HOMEDIR_=/home/$USER_
[ $ROOT_ = 1 ] && {
CAPS_=$CAPS_"-0 "
HOMEDIR_=/root
}
CMD_="$SHELL_ -l"
[ -z "$*" ] || {
CMD_='sh -c "$*"'
}
eval $PREFIX/bin/proot \
-b /dev \
-b /proc \
-b /sys \
-b /data/data/com.termux/files/home \
-b /data/data/com.termux/files/usr \
-b /storage \
-b /system \
-b /mnt \
-r $HOME/$ROOTFS_TOP_ \
-w $HOMEDIR_ \
$CAPS_ \
--link2symlink \
/usr/bin/env -i HOME=$HOMEDIR_ TERM=$TERM LANG=$LANG $CMD_
please note
USER_=u0_a60 will be different for you....
to start termux Debian from home folder..
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb
root@localhost:~#
root@localhost:~# exit
logout
bash:5.0][u0_a60]@~:$
use exit to quit and return to termux bash... ;-]..
Quick test...
./bin/enter_deb -n id\; hostname\; pwd\; cat /etc/debian_\*
Code:
uid=10060(u0_a60) gid=10060(u0_a60) groups=10060(u0_a60),3003,9997,50060
localhost
/home/u0_a60
10.1
bash:5.0][u0_a60]@~:$
./bin/enter_deb -0 id\; hostname\; pwd\; cat /etc/debian_\*
Code:
uid=0(root) gid=0(root) groups=0(root),3003,9997,50060
localhost
/root
10.1
bash:5.0][u0_a60]@~:$
note.. some group ids need to be fixed..
from android adb shell login..
Code:
rk3288:/ $ id
uid=2000(shell) gid=2000(shell) groups=2000(shell),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc) context=u:r:shell:s0
rk3288:/ $
and from android adb root login...
Code:
rk3288:/ # id
uid=0(root) gid=0(root) groups=0(root),1004(input),1007(log),1011(adb),1015(sdcard_rw),1028(sdcard_r),3001(net_bt_admin),3002(net_bt),3003(inet),3006(net_bw_stats),3009(readproc) context=u:r:su:s0
rk3288:/ #
..check android termux username with
as you will need this when editing /etc/group in Debian
start Debian as mimic root with
./bin/enter_deb and then
nano /etc/group file...
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb
root@localhost:~# nano /etc/group
root:x:0:
daemon:x:1:
bin:x:2:
sys:x:3:
adm:x:4:
tty:x:5:
disk:x:6:
lp:x:7:
mail:x:8:
news:x:9:
uucp:x:10:
man:x:12:
proxy:x:13:
kmem:x:15:
dialout:x:20:
fax:x:21:
voice:x:22:
cdrom:x:24:
floppy:x:25:
tape:x:26:
sudo:x:27:
audio:x:29:
dip:x:30:
www-data:x:33:
backup:x:34:
operator:x:37:
list:x:38:
irc:x:39:
src:x:40:
gnats:x:41:
shadow:x:42:
utmp:x:43:
video:x:44:
sasl:x:45:
plugdev:x:46:
staff:x:50:
games:x:60:
users:x:100:
nogroup:x:65534:
systemd-journal:x:101:
systemd-timesync:x:102:
systemd-network:x:103:
systemd-resolve:x:104:
input:x:105:
kvm:x:106:
render:x:107:
crontab:x:108:
netdev:x:109:
u0_a60:x:10060:
log:x:1007:root,u0_a60
adb:x:1011:root,u0_a60
sdcard_rw:x:1015:root,u0_a60
sdcard_r:x:1028:root,u0_a60
net_bt_admin:x:3001:root,u0_a60
net_bt:x:3002:root,u0_a60
inet:x:3003:root,u0_a60
net_bw_stats:x:3006:root,u0_a60
readproc:x:3009:root,u0_a60
everybody:x:9997:
all_a60:x:50060:
ssh:x:110:
messagebus:x:111:
root@localhost:~#
please remember to replace u0_a60 with your own termux username...
exit debain and run quick test again..
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb -n id\; hostname\; pwd\; cat /etc/debian_\*
uid=10060(u0_a60) gid=10060(u0_a60) groups=10060(u0_a60),3003(inet),9997(everybody),50060(all_a60)
localhost
/home/u0_a60
10.1
bash:5.0][u0_a60]@~:$ ./bin/enter_deb -0 id\; hostname\; pwd\; cat /etc/debian_\*
uid=0(root) gid=0(root) groups=0(root),3003(inet),9997(everybody),50060(all_a60)
localhost
/root
10.1
bash:5.0][u0_a60]@~:$
ids now fixed ;-]...
notes.. Android Users and Groups ID -
Android Security: An Overview Of Application Sandbox
now start termux Debian & update..
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb
root@localhost:~# apt-get update
Hit:1 https://cdn-aws.deb.debian.org/debian stable InRelease
Reading package lists... Done
root@localhost:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@localhost:~# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@localhost:~# apt-get autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@localhost:~# apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
root@localhost:~# apt-get clean
root@localhost:~#
use apt to install lsb-release
Code:
root@localhost:~# apt update
Hit:1 https://cdn-aws.deb.debian.org/debian stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@localhost:~# apt install lsb-release -y
get some system info...
Code:
root@localhost:~# lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 10 (buster)
Release: 10
Codename: buster
root@localhost:~#
root@localhost:~# uname -a
Linux localhost 4.4.112 #1 SMP PREEMPT Wed May 15 10:33:31 CST 2019 armv7l GNU/Linux
root@localhost:~#
root@localhost:~# cat /proc/version
Linux version 4.4.112 (jenkins@fdc-06) (gcc version 4.9 20150123 (prerelease) (GCC) ) #1 SMP PREEMPT Wed May 15 10:33:31 CST 2019
root@localhost:~#
root@localhost:~# cat /etc/issue
Debian GNU/Linux 10 \n \l
root@localhost:~#
then.. mkdir -p ~/code/kTest folders...
now create .profile and .bashrc files.. for mimic root user..
nano ~/.profile
Code:
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
nano ~/.bashrc
Code:
# ~/.bashrc: executed by bash(1) for non-login shells.
# Note: PS1 and umask are already set in /etc/profile. You should not
# need this unless you want different defaults for root.
# PS1='${debian_chroot:+($debian_chroot)}\h:\w\$ '
# umask 022
# fix keyboard uk layout...
#export LANG=en_GB.UTF-8
#export LANGUAGE=en_GB:en
# You may uncomment the following lines if you want `ls' to be colorized:
# export LS_OPTIONS='--color=auto'
# eval "`dircolors`"
# alias ls='ls $LS_OPTIONS'
#
# enable color support of ls and also add handy aliases
if [ $SHELL = "/bin/bash" -a -x /usr/bin/dircolors ]; then
test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)"
alias ls='ls --color=auto'
#alias dir='dir --color=auto'
#alias vdir='vdir --color=auto'
#alias grep='grep --color=auto'
#alias fgrep='fgrep --color=auto'
#alias egrep='egrep --color=auto'
fi
#
alias ll='ls -Flah'
alias lla='ls -FlAh'
alias l='ls -CF'
alias la='ls -ACF'
#
alias lld='ls -lah -d */'
alias ..='cd ..'
alias ,,='cd -'
alias cls='clear'
#
# Some more alias to avoid making mistakes:
# alias rm='rm -i'
# alias cp='cp -i'
# alias mv='mv -i'
# Customizing colors - directory that is world writable
export LS_COLORS=$LS_COLORS:'ow=30;42'
exit, to quit Debian...& re-run ./bin/enter_deb again..
then list debian root folder...
Code:
root@localhost:~# cd /
root@localhost:/# ll
total 53K
drwxr-xr-x. 20 root root 3.5K Oct 29 03:12 ./
drwxr-xr-x. 20 root root 3.5K Oct 29 03:12 ../
lrwxrwxrwx. 1 root root 7 Oct 29 01:27 bin -> usr/bin/
drwxr-xr-x. 2 root root 3.5K Aug 30 13:31 boot/
drwx------. 3 root root 3.5K Oct 29 03:12 data/
drwxr-xr-x. 18 root root 1.8K Oct 29 02:52 dev/
drwxr-xr-x. 50 root root 3.5K Oct 29 02:21 etc/
drwxr-xr-x. 3 root root 3.5K Oct 29 01:36 home/
lrwxrwxrwx. 1 root root 7 Oct 29 01:27 lib -> usr/lib/
drwxr-xr-x. 2 root root 3.5K Oct 29 01:28 media/
drwxr-xr-x. 11 root 1000 240 Oct 29 02:52 mnt/
drwxr-xr-x. 2 root root 3.5K Oct 29 01:28 opt/
dr-xr-xr-x. 224 root root 0 Jan 1 1970 proc/
drwx------. 3 root root 3.5K Oct 29 02:38 root/
drwxr-xr-x. 3 root root 3.5K Oct 29 01:28 run/
lrwxrwxrwx. 1 root root 8 Oct 29 01:27 sbin -> usr/sbin/
drwxr-xr-x. 2 root root 3.5K Oct 29 01:28 srv/
drwxr-xr-x. 5 root root 100 Oct 29 02:52 storage/
dr-xr-xr-x. 13 root root 0 Oct 29 03:15 sys/
drwxr-xr-x. 16 root root 4.0K Jan 1 1970 system/
drwxrwxrwt. 2 root root 3.5K Oct 29 02:21 tmp/
drwxr-xr-x. 10 root root 3.5K Oct 29 01:28 usr/
drwxr-xr-x. 11 root root 3.5K Oct 29 01:28 var/
root@localhost:/#
restart tinker Board and check to see if sysfs control of GPIO is possible..
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb
root@localhost:~# echo 17 > /sys/class/gpio/export
bash: /sys/class/gpio/export: Permission denied
root@localhost:~# exit
logout
bash:5.0][u0_a60]@~:$
noooo.. joy... [[[...
need root access to tinker Board GPIOs..
so use sudo to start termux Debian...
Code:
sudo ./bin/enter_deb
NOTE.. IF YOU EVER RUN APT AS ROOT ###
THIS Breaks apt update & install for enter_debian -0 & -n [[[....
so.. you will always have to use sudo to start script from termux bash shell..
### have found fix by adb root connect and remount then drop into android shell...
chmod -R termuxUSER:termuxUSER debianRootFolder...
Code:
cd /data/data/com.termux/files/home
chmod -R u0_a60:u0_a60 deboot_debian/
to fix apt update.. for termux debian user.. after running apt as root by mistake...
Code:
adb connect 192.168.0.21
adb root
adb connect 192.168.0.21
adb remount
adb shell
cd /data/data/com.termux/files/home/
chown -R u0_a60:u0_a60 deboot_debian/
exit
sysfs access to GPIOs... connect Pibrella to tinker Board,
and test
Bash scripts access control of tinker board's GPIO pins using sysfs.
GPIO API Shell
GPIO can be used direct from the shell:
sudo ./bin/enter_deb
test Pibrella greenLED..
Code:
echo 17 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio17/direction
echo 0 > /sys/class/gpio/gpio17/value
check to see /sys/ folder from android termux, has been mounted onto Debian file system..
Code:
root@localhost:~# ll /sys/class/gpio/
total 0
drwxr-xr-x. 2 root root 0 Oct 29 03:34 ./
drwxr-xr-x. 74 root root 0 Oct 29 02:52 ../
--w-------. 1 root root 4.0K Oct 29 03:32 export
lrwxrwxrwx. 1 root root 0 Oct 29 03:33 gpio17 -> ../../devices/platform/pinctrl/gpio/gpio17/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpio220 -> ../../devices/platform/pinctrl/gpio/gpio220/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip0 -> ../../devices/platform/pinctrl/gpio/gpiochip0/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip120 -> ../../devices/platform/pinctrl/gpio/gpiochip120/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip152 -> ../../devices/platform/pinctrl/gpio/gpiochip152/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip184 -> ../../devices/platform/pinctrl/gpio/gpiochip184/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip216 -> ../../devices/platform/pinctrl/gpio/gpiochip216/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip24 -> ../../devices/platform/pinctrl/gpio/gpiochip24/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip248 -> ../../devices/platform/pinctrl/gpio/gpiochip248/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip56 -> ../../devices/platform/pinctrl/gpio/gpiochip56/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip88 -> ../../devices/platform/pinctrl/gpio/gpiochip88/
--w-------. 1 root root 4.0K Oct 29 03:34 unexport
root@localhost:~#
ll /sys/class/gpio/gpio17/
Code:
root@localhost:~# ll /sys/class/gpio/gpio17/
total 0
drwxr-xr-x. 3 root root 0 Oct 29 03:34 ./
drwxr-xr-x. 13 root root 0 Oct 29 02:52 ../
-rw-r--r--. 1 root root 4.0K Oct 29 03:34 active_low
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 device -> ../../../pinctrl/
-rw-r--r--. 1 root root 4.0K Oct 29 03:33 direction
-rw-r--r--. 1 root root 4.0K Oct 29 03:34 edge
drwxr-xr-x. 2 root root 0 Oct 29 03:34 power/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 subsystem -> ../../../../../class/gpio/
-rw-r--r--. 1 root root 4.0K Oct 29 03:34 uevent
-rw-r--r--. 1 root root 4.0K Oct 29 03:33 value
root@localhost:~#
cat /sys/class/gpio/gpio17/direction
Code:
root@localhost:~# cat /sys/class/gpio/gpio17/direction
out
root@localhost:~# cat /sys/class/gpio/gpio17/value
0
root@localhost:~#
echo 1 > /sys/class/gpio/gpio17/value
Pibrella greenLED on.. ;-]..
Code:
root@localhost:~# cat /sys/class/gpio/gpio17/value
1
root@localhost:~#
& value reads 1..
then switch LED off with..
echo 0 > /sys/class/gpio/gpio17/value
now
test GPIO input - with push button...
Code:
echo 238 > /sys/class/gpio/export
echo in > /sys/class/gpio/gpio238/direction
check GPIO pin 238 direction & value...
Code:
root@localhost:~# cat /sys/class/gpio/gpio238/direction
in
root@localhost:~# cat /sys/class/gpio/gpio238/value
1
root@localhost:~#
so.. when button is not pressed.. value is High..
now press and hold button down then read PIN value again..
Code:
root@localhost:~# cat /sys/class/gpio/gpio238/direction
in
root@localhost:~# cat /sys/class/gpio/gpio238/value
0
root@localhost:~#
now when button is pressed.. PIN value is Low...
all is well with sysfs access to GPIOs ]]]]....
clean up PINs setup with.. echo 17 > /sys/class/gpio/unexport & echo 238 > /sys/class/gpio/unexport
Code:
root@localhost:~# ll /sys/class/gpio/
total 0
drwxr-xr-x. 2 root root 0 Oct 29 03:40 ./
drwxr-xr-x. 74 root root 0 Oct 29 03:34 ../
--w-------. 1 root root 4.0K Oct 29 03:40 export
lrwxrwxrwx. 1 root root 0 Oct 29 03:33 gpio17 -> ../../devices/platform/pinctrl/gpio/gpio17/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpio220 -> ../../devices/platform/pinctrl/gpio/gpio220/
lrwxrwxrwx. 1 root root 0 Oct 29 03:40 gpio238 -> ../../devices/platform/pinctrl/gpio/gpio238/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip0 -> ../../devices/platform/pinctrl/gpio/gpiochip0/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip120 -> ../../devices/platform/pinctrl/gpio/gpiochip120/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip152 -> ../../devices/platform/pinctrl/gpio/gpiochip152/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip184 -> ../../devices/platform/pinctrl/gpio/gpiochip184/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip216 -> ../../devices/platform/pinctrl/gpio/gpiochip216/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip24 -> ../../devices/platform/pinctrl/gpio/gpiochip24/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip248 -> ../../devices/platform/pinctrl/gpio/gpiochip248/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip56 -> ../../devices/platform/pinctrl/gpio/gpiochip56/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip88 -> ../../devices/platform/pinctrl/gpio/gpiochip88/
--w-------. 1 root root 4.0K Oct 29 03:34 unexport
root@localhost:~# echo 17 > /sys/class/gpio/unexport
root@localhost:~# echo 238 > /sys/class/gpio/unexport
root@localhost:~# ll /sys/class/gpio/
total 0
drwxr-xr-x. 2 root root 0 Oct 29 03:48 ./
drwxr-xr-x. 74 root root 0 Oct 29 03:34 ../
--w-------. 1 root root 4.0K Oct 29 03:40 export
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpio220 -> ../../devices/platform/pinctrl/gpio/gpio220/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip0 -> ../../devices/platform/pinctrl/gpio/gpiochip0/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip120 -> ../../devices/platform/pinctrl/gpio/gpiochip120/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip152 -> ../../devices/platform/pinctrl/gpio/gpiochip152/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip184 -> ../../devices/platform/pinctrl/gpio/gpiochip184/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip216 -> ../../devices/platform/pinctrl/gpio/gpiochip216/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip24 -> ../../devices/platform/pinctrl/gpio/gpiochip24/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip248 -> ../../devices/platform/pinctrl/gpio/gpiochip248/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip56 -> ../../devices/platform/pinctrl/gpio/gpiochip56/
lrwxrwxrwx. 1 root root 0 Oct 29 03:34 gpiochip88 -> ../../devices/platform/pinctrl/gpio/gpiochip88/
--w-------. 1 root root 4.0K Oct 29 03:48 unexport
root@localhost:~#
create code/pibrella & temp folders in root home...
Code:
mkdir -p ~/code/pibrella/
mkdir ~/temp
cd ~/code/pibrella/
use nano to make
trafficlights.sh, gpioTB, bincount.sh, chaser.sh, blinkLED.sh, button.sh & buzzer.sh files..
make sure to chmod +x them... and check top of files for..
#!/usr/bin/bash
Code:
root@localhost:~/code/pibrella# ll
total 28K
drwx------. 2 root root 3.5K Oct 26 19:25 ./
drwx------. 6 u0_a60 u0_a60 3.5K Oct 26 17:20 ../
-rwx------. 1 root root 942 Oct 26 19:18 bincount.sh*
-rwx------. 1 root root 756 Oct 26 19:20 chaser.sh*
-rwx------. 1 root root 1.8K Oct 26 19:19 gpioTB*
-rwx------. 1 root root 8.1K Oct 26 16:58 led*
-rwx------. 1 root root 678 Oct 26 17:49 ledblink.py*
-rw-------. 1 root root 550 Oct 26 16:56 led.c
-rwx------. 1 root root 382 Oct 26 17:33 pwmLED.py*
-rwx------. 1 root root 1.7K Oct 26 19:13 trafficlights.sh*
root@localhost:~/code/pibrella#
list debian env..
Code:
root@localhost:~/code/pibrella# env
PWD=/root/code/pibrella
HOME=/root
LANG=en_US.UTF-8
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36::ow=30;42
TERM=xterm-256color
SHLVL=1
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env
OLDPWD=/root/code
root@localhost:~/code/pibrella#
from env.. copy gpioTB function to /usr/bin....
Code:
cp gpioTB /usr/bin/
cd /usr/bin
chmod 0755 gpioTB
cd ~/code
chmod 0777 -Rv pibrella
change to home folder, cd ~/ and check gpioTB....
Code:
root@localhost:~# cd ~
root@localhost:~# gpioTB
Control the GPIO pins of the tinker board
Usage: /usr/bin/gpioTB mode [pin] [in|out]
/usr/bin/gpioTB read [pin]
/usr/bin/gpioTB write [pin] [0|1]
/usr/bin/gpioTB state [pin]
/usr/bin/gpioTB clean [pin]
If GPIO_PINS is an environment variable containing
a space-delimited list of integers, then up to 17
logical pins (0-16) will map to the physical pins
specified in the list.
root@localhost:~# gpioTB mode 17 out
root@localhost:~# gpioTB write 17 1
root@localhost:~# gpioTB write 17 0
root@localhost:~# gpioTB clean 17
root@localhost:~# exit
logout
bash:5.0][u0_a60]@~:$
use exit to quit debian and return to termux bash...
run deboot_deb without sudo to update and install Apps,
C GPIO library & Python GPIO library for tinker board...
apt update
apt install tmux -y
C
Open a terminal and download
C GPIO library
cd code...
ERROR...... ;-]..
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb
root@localhost:~#
root@localhost:~# ll
total 23K
drwx------. 5 root root 3.5K Oct 29 03:54 ./
drwxr-xr-x. 20 root root 3.5K Oct 29 04:35 ../
-rw-------. 1 root root 2.9K Oct 29 04:32 .bash_history
-rw-r--r--. 1 root root 1.3K Oct 29 02:38 .bashrc
drwx------. 3 root root 3.5K Oct 29 03:54 code/
drwx------. 3 root root 3.5K Oct 29 01:57 .local/
-rw-r--r--. 1 root root 132 Oct 29 01:36 .profile
drwx------. 2 root root 3.5K Oct 29 03:54 temp/
root@localhost:~# cd code/
bash: cd: code/: Operation not permitted
root@localhost:~# ???????
exit
seems like, if you create folders when sudo ./bin/enter_deb is used..
you will not be able to access them with ./bin/enter_deb -0 or ./bin/enter_deb -n
hmmmmmmmm.. fix from termux bash..
Code:
bash:5.0][u0_a60]@~:$
bash:5.0][u0_a60]@~:$ cd deboot_debian/root
bash:5.0][u0_a60]@~/deboot_debian/root:$ ll
total 23K
drwx------ 5 u0_a60 u0_a60 3.5K Oct 29 03:54 ./
drwxr-xr-x 17 u0_a60 u0_a60 3.5K Oct 29 04:42 ../
-rw------- 1 u0_a60 u0_a60 2.9K Oct 29 04:41 .bash_history
-rw-r--r-- 1 u0_a60 u0_a60 1.3K Oct 29 02:38 .bashrc
drwx------ 3 u0_a60 u0_a60 3.5K Oct 29 01:57 .local/
-rw-r--r-- 1 u0_a60 u0_a60 132 Oct 29 01:36 .profile
drwx------ 3 u0_a60 u0_a60 3.5K Oct 29 03:54 code/
drwx------ 2 u0_a60 u0_a60 3.5K Oct 29 03:54 temp/
bash:5.0][u0_a60]@~/deboot_debian/root:$
make sure code & temp folders are both owned by android termux user..
Code:
sudo chown -R u0_a60:u0_a60 code/
sudo chown -R u0_a60:u0_a60 temp/
cd ~/
run start script as mimic root with ./bin/enter_deb -0 and check if you can access code folder.. cd ~/code
Code:
root@localhost:~/code# ll
total 11K
drwx------. 3 root root 3.5K Oct 29 03:54 ./
drwx------. 5 root root 3.5K Oct 29 03:54 ../
drwxrwxrwx. 2 root root 3.5K Oct 29 04:00 pibrella/
root@localhost:~/code#
root@localhost:~/code# apt update
Hit:1 https://cdn-aws.deb.debian.org/debian stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
root@localhost:~/code#
apt update Debian system, ready to install GPIO_API_for_C..
apt install git -y
git clone
http://github.com/TinkerBoard/gpio_lib_c --depth 1 GPIO_API_for_C
Code:
root@localhost:~/code# git clone http://github.com/TinkerBoard/gpio_lib_c --depth 1 GPIO_API_for_C
Cloning into 'GPIO_API_for_C'...
warning: redirecting to https://github.com/TinkerBoard/gpio_lib_c/
remote: Enumerating objects: 183, done.
remote: Counting objects: 100% (183/183), done.
remote: Compressing objects: 100% (104/104), done.
remote: Total 183 (delta 82), reused 158 (delta 73), pack-reused 0
Receiving objects: 100% (183/183), 174.42 KiB | 1.32 MiB/s, done.
Resolving deltas: 100% (82/82), done.
Checking out files: 100% (174/174), done.
root@localhost:~/code# mkdir kTest
root@localhost:~/code# ll
total 18K
drwx------. 5 root root 3.5K Oct 29 05:00 ./
drwx------. 5 root root 3.5K Oct 29 03:54 ../
drwx------. 9 root root 3.5K Oct 29 05:00 GPIO_API_for_C/
drwx------. 2 root root 3.5K Oct 29 05:00 kTest/
drwxrwxrwx. 2 root root 3.5K Oct 29 04:00 pibrella/
root@localhost:~/code#
also... mkdir kTest
list files in C GPIO library...
Code:
root@localhost:~/code# cd GPIO_API_for_C/
root@localhost:~/code/GPIO_API_for_C# ll
total 60K
drwx------. 9 root root 3.5K Oct 29 05:00 ./
drwx------. 5 root root 3.5K Oct 29 05:00 ../
-rwx------. 1 root root 5.5K Oct 29 05:00 build*
-rwx------. 1 root root 7.5K Oct 29 05:00 COPYING.LESSER*
drwx------. 2 root root 3.5K Oct 29 05:00 debian/
drwx------. 2 root root 3.5K Oct 29 05:00 devLib/
drwx------. 6 root root 3.5K Oct 29 05:00 examples/
drwx------. 8 root root 3.5K Oct 29 05:00 .git/
drwx------. 2 root root 3.5K Oct 29 05:00 gpio/
-rwx------. 1 root root 686 Oct 29 05:00 INSTALL*
-rwx------. 1 root root 1.7K Oct 29 05:00 newVersion*
-rwx------. 1 root root 865 Oct 29 05:00 People*
drwx------. 2 root root 3.5K Oct 29 05:00 pins/
-rw-------. 1 root root 3.1K Oct 29 05:00 README.md
-rwx------. 1 root root 606 Oct 29 05:00 README.TXT*
-rwx------. 1 root root 3.0K Oct 29 05:00 'release functioon.txt'*
-rwx------. 1 root root 5 Oct 29 05:00 VERSION*
drwx------. 2 root root 3.5K Oct 29 05:00 wiringPi/
root@localhost:~/code/GPIO_API_for_C#
make sure build file is executable and check file..
chmod +x build
now.. make sure debain is up to date
Code:
apt-get update -y
apt-get upgrade -y
apt-get dist-upgrade -y
apt-get autoremove -y
notes..
Debian Linux Install GNU GCC Compiler and Development Environment
apt update
apt install build-essential -y
Verify installation...
Code:
root@localhost:~/code/GPIO_API_for_C# which gcc make
/usr/bin/gcc
/usr/bin/make
root@localhost:~/code/GPIO_API_for_C#
root@localhost:~/code/GPIO_API_for_C# whereis gcc make
gcc: /usr/bin/gcc /usr/lib/gcc
make: /usr/bin/make /usr/share/man/man1/make.1.gz
root@localhost:~/code/GPIO_API_for_C#
root@localhost:~/code/GPIO_API_for_C# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/8/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 8.3.0-6' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --program-prefix=arm-linux-gnueabihf- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libitm --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --disable-werror --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 8.3.0 (Debian 8.3.0-6)
root@localhost:~/code/GPIO_API_for_C#
root@localhost:~/code/GPIO_API_for_C# make -v
GNU Make 4.2.1
Built for arm-unknown-linux-gnueabihf
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
root@localhost:~/code/GPIO_API_for_C#
which & whereis gcc make...
now ready to build C library... with
./build
Code:
root@localhost:~/code/GPIO_API_for_C# ./build
wiringPi Build script
=====================
WiringPi Library
[UnInstall]
[Compile] wiringPi.c
[Compile] wiringTB.c
[Compile] wiringSerial.c
[Compile] wiringShift.c
[Compile] piHiPri.c
[Compile] piThread.c
[Compile] wiringPiSPI.c
[Compile] wiringPiI2C.c
[Compile] softPwm.c
[Compile] softTone.c
[Compile] mcp23008.c
[Compile] mcp23016.c
[Compile] mcp23017.c
[Compile] mcp23s08.c
[Compile] mcp23s17.c
[Compile] sr595.c
[Compile] pcf8574.c
[Compile] pcf8591.c
[Compile] mcp3002.c
[Compile] mcp3004.c
[Compile] mcp4802.c
[Compile] mcp3422.c
[Compile] max31855.c
[Compile] max5322.c
[Compile] sn3218.c
[Compile] drcSerial.c
[Compile] wpiExtensions.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]
WiringPi Devices Library
[UnInstall]
[Compile] ds1302.c
[Compile] maxdetect.c
[Compile] piNes.c
[Compile] gertboard.c
[Compile] piFace.c
[Compile] lcd128x64.c
[Compile] lcd.c
[Compile] piGlow.c
[Link (Dynamic)]
[Install Headers]
[Install Dynamic Lib]
GPIO Utility
[Compile] gpio.c
[Compile] readall.c
[Compile] pins.c
[Link]
[Install]
All Done.
NOTE: To compile programs with wiringPi, you need to add:
-lwiringPi
to your compile line(s) To use the Gertboard, MaxDetect, etc.
code (the devLib), you need to also add:
-lwiringPiDev
to your compile line(s).
root@localhost:~/code/GPIO_API_for_C#
looks like it compiled ok ;-]...
Simple LED blink
cd ~/code/pibrella
nano led.c
Code:
#include <stdio.h>
#include <wiringPi.h>
// #define LED 0 matches with ASUS_GPIO 164! This can be checked with command 'sudo gpio readall'.
#define LED 0
int main (void)
{
printf ("TB blink\n");
wiringPiSetup ();
pinMode (LED, OUTPUT);
for (;;)
{
printf ("led on\n");
digitalWrite (LED, HIGH);
delay (500);
printf ("led off\n");
digitalWrite (LED, LOW);
delay (500);
}
return 0;
}
To run the led script first compile with gcc..
gcc -o led led.c -lwiringPi & run with ./led
Code:
root@localhost:~/code/pibrella# ll
total 20K
drwx------. 2 root root 3.5K Oct 26 16:58 ./
drwx------. 5 u0_a60 u0_a60 3.5K Oct 26 16:55 ../
-rwx------. 1 root root 8.1K Oct 26 16:58 led*
-rw-------. 1 root root 550 Oct 26 16:56 led.c
root@localhost:~/code/pibrella#
root@localhost:~/code/pibrella# ./led
TB blink
led on
led off
led on
led off
led on
led off
led on
led off
led on
led off
^C
root@localhost:~/code/pibrella#
;-]... pibrella yellowLED blink ctrl +c to quit...
now test gpio..
Code:
root@localhost:~/code/pibrella# gpio
Usage: gpio -v
gpio -h
gpio [-g|-1] [-x extension:params] ...
gpio [-p] <read/write/wb> ...
gpio <read/write/pwm/mode> ...
gpio readall/reset
gpio unexportall/exports
gpio export/edge/unexport ...
gpio pwmr <range>
gpio pwmc <divider>
gpio load spi/i2c
gpio unload spi/i2c
gpio i2cd/i2cdetect
root@localhost:~/code/pibrella#
check gpio version..
Code:
root@localhost:~/code/pibrella# gpio -v
gpio version: 2.31
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty
TinkerBoard Details:
Type: ASUS pi, Revision: 02, Memory: 2048MB, Maker: Asus
root@localhost:~/code/pibrella#
test gpio write.. can control pibrella yellowLED..
Code:
root@localhost:~/code/pibrella# gpio mode 0 out
root@localhost:~/code/pibrella# gpio write 0 1
root@localhost:~/code/pibrella# gpio write 0 0
root@localhost:~/code/pibrella# id
uid=0(root) gid=0(root) groups=0(root),3003(inet),9997(everybody),50060(all_a60)
root@localhost:~/code/pibrella#
test gpio readall..
Code:
root@localhost:~/code/pibrella# gpio readall
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
| CPU | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | CPU |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 252 | 8 | SDA.1 | I2C | 1 | 3 || 4 | | | 5v | | |
| 253 | 9 | SCL.1 | I2C | 1 | 5 || 6 | | | 0v | | |
| 17 | 7 | GPIO0C1 | OUT | 0 | 7 || 8 | 1 | SERL | TxD.1 | 15 | 161 |
| | | 0v | | | 9 || 10 | 1 | SERL | RxD.1 | 16 | 160 |
| 164 | 0 | GPIO5B4 | OUT | 0 | 11 || 12 | 1 | I2S | I2S_CLK | 1 | 184 |
| 166 | 2 | GPIO5B6 | OUT | 0 | 13 || 14 | | | 0v | | |
| 167 | 3 | GPIO5B7 | OUT | 0 | 15 || 16 | 0 | OUT | GPIO5B2 | 4 | 162 |
| | | 3.3v | | | 17 || 18 | 0 | OUT | GPIO5B3 | 5 | 163 |
| 257 | 12 | MOSI.2 | SPI | 0 | 19 || 20 | | | 0v | | |
| 256 | 13 | MISO.2 | SPI | 1 | 21 || 22 | 0 | OUT | GPIO5C3 | 6 | 171 |
| 254 | 14 | SCLK.2 | SPI | 1 | 23 || 24 | 1 | SPI | CE0.2 | 10 | 255 |
| | | 0v | | | 25 || 26 | 1 | IN | GPIO8A3 | 11 | 251 |
| 233 | 30 | SDA.4 | I2C | 1 | 27 || 28 | 1 | I2C | SCL.4 | 31 | 234 |
| 165 | 21 | RTSN.4 | SERL | 1 | 29 || 30 | | | 0v | | |
| 168 | 22 | GPIO5C0 | OUT | 0 | 31 || 32 | 1 | SERL | GPIO7C7 | 26 | 239 |
| 238 | 23 | GPIO7C6 | IN | 1 | 33 || 34 | | | 0v | | |
| 185 | 24 | I2S_FS | I2S | 0 | 35 || 36 | 1 | SERL | RxD.3 | 27 | 223 |
| 224 | 25 | TxD.3 | SERL | 1 | 37 || 38 | 1 | I2S | I2S_SDI | 28 | 187 |
| | | 0v | | | 39 || 40 | 0 | I2S | I2S_SDO | 29 | 188 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| CPU | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | CPU |
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
root@localhost:~/code/pibrella#
GPIO_API_for_C# working with ./bin/enter_deb -0 / NO Need for sudo ..;-]...
restart tinker Board....
Python - Setup Python GPIO library for tinker board
Python GPIO library
install Python3 and
Set Up a Programming Environment on Debian 10
Code:
bash:5.0][u0_a60]@~:$ ./bin/enter_deb -0
root@localhost:~# cd code/
root@localhost:~/code# apt update -y
Hit:1 https://cdn-aws.deb.debian.org/debian stable InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date
apt install python3
Code:
root@localhost:~/code# apt install python3
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3 is already the newest version (3.7.3-1).
python3 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
root@localhost:~/code# python3 -V
Python 3.7.3
root@localhost:~/code#
apt install -y python3-pip
apt install build-essential libssl-dev libffi-dev python3-dev
cd ~/code
git clone
http://github.com/TinkerBoard/gpio_lib_python --depth 1 GPIO_API_for_Python
Code:
root@localhost:~/code# git clone http://github.com/TinkerBoard/gpio_lib_python --depth 1 GPIO_API_for_Python
Cloning into 'GPIO_API_for_Python'...
warning: redirecting to https://github.com/TinkerBoard/gpio_lib_python/
remote: Enumerating objects: 45, done.
remote: Counting objects: 100% (45/45), done.
remote: Compressing objects: 100% (41/41), done.
remote: Total 45 (delta 10), reused 20 (delta 3), pack-reused 0
Unpacking objects: 100% (45/45), done.
root@localhost:~/code#
list folder..
Code:
root@localhost:~/code# cd GPIO_API_for_Python/
root@localhost:~/code/GPIO_API_for_Python# ll
total 121K
drwx------. 7 root root 3.5K Oct 29 07:42 ./
drwx------. 6 root root 3.5K Oct 29 07:42 ../
drwx------. 2 root root 3.5K Oct 29 07:42 ASUS/
-rw-------. 1 root root 4.7K Oct 29 07:42 CHANGELOG.txt
drwx------. 8 root root 3.5K Oct 29 07:42 .git/
-rw-------. 1 root root 72K Oct 29 07:42 GPIOLIST.ods
-rw-------. 1 root root 589 Oct 29 07:42 INSTALL.txt
-rw-------. 1 root root 1.1K Oct 29 07:42 LICENCE.txt
-rw-------. 1 root root 139 Oct 29 07:42 Makefile
-rw-------. 1 root root 7.7K Oct 29 07:42 PKG-INFO
-rw-------. 1 root root 469 Oct 29 07:42 README.md
-rw-------. 1 root root 942 Oct 29 07:42 README.txt
drwx------. 2 root root 3.5K Oct 29 07:42 RPi/
-rw-------. 1 root root 3.1K Oct 29 07:42 setup.py
drwx------. 2 root root 3.5K Oct 29 07:42 source/
drwx------. 2 root root 3.5K Oct 29 07:42 test/
root@localhost:~/code/GPIO_API_for_Python#
cd GPIO_API_for_Python/
python3 setup.py install
Code:
root@localhost:~/code/GPIO_API_for_Python# python3 setup.py install
running install
running build
running build_py
creating build
creating build/lib.linux-armv7l-3.7
creating build/lib.linux-armv7l-3.7/ASUS
copying ASUS/__init__.py -> build/lib.linux-armv7l-3.7/ASUS
running build_ext
building 'ASUS.GPIO' extension
creating build/temp.linux-armv7l-3.7
creating build/temp.linux-armv7l-3.7/source
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/py_gpio.c -o build/temp.linux-armv7l-3.7/source/py_gpio.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/c_gpio.c -o build/temp.linux-armv7l-3.7/source/c_gpio.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/cpuinfo.c -o build/temp.linux-armv7l-3.7/source/cpuinfo.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/event_gpio.c -o build/temp.linux-armv7l-3.7/source/event_gpio.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/soft_pwm.c -o build/temp.linux-armv7l-3.7/source/soft_pwm.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/py_pwm.c -o build/temp.linux-armv7l-3.7/source/py_pwm.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/common.c -o build/temp.linux-armv7l-3.7/source/common.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/constants.c -o build/temp.linux-armv7l-3.7/source/constants.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/wiringTB.c -o build/temp.linux-armv7l-3.7/source/wiringTB.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.7/source/py_gpio.o build/temp.linux-armv7l-3.7/source/c_gpio.o build/temp.linux-armv7l-3.7/source/cpuinfo.o build/temp.linux-armv7l-3.7/source/event_gpio.o build/temp.linux-armv7l-3.7/source/soft_pwm.o build/temp.linux-armv7l-3.7/source/py_pwm.o build/temp.linux-armv7l-3.7/source/common.o build/temp.linux-armv7l-3.7/source/constants.o build/temp.linux-armv7l-3.7/source/wiringTB.o -o build/lib.linux-armv7l-3.7/ASUS/GPIO.cpython-37m-arm-linux-gnueabihf.so
running install_lib
creating /usr/local/lib/python3.7/dist-packages/ASUS
copying build/lib.linux-armv7l-3.7/ASUS/__init__.py -> /usr/local/lib/python3.7/dist-packages/ASUS
copying build/lib.linux-armv7l-3.7/ASUS/GPIO.cpython-37m-arm-linux-gnueabihf.so -> /usr/local/lib/python3.7/dist-packages/ASUS
byte-compiling /usr/local/lib/python3.7/dist-packages/ASUS/__init__.py to __init__.cpython-37.pyc
running install_egg_info
Writing /usr/local/lib/python3.7/dist-packages/ASUS.GPIO-0.1.egg-info
running install
running build
running build_py
creating build/lib.linux-armv7l-3.7/RPi
copying RPi/__init__.py -> build/lib.linux-armv7l-3.7/RPi
running build_ext
building 'RPi.GPIO' extension
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/py_gpio_RPi.c -o build/temp.linux-armv7l-3.7/source/py_gpio_RPi.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/c_gpio.c -o build/temp.linux-armv7l-3.7/source/c_gpio.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/cpuinfo.c -o build/temp.linux-armv7l-3.7/source/cpuinfo.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/event_gpio.c -o build/temp.linux-armv7l-3.7/source/event_gpio.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/soft_pwm.c -o build/temp.linux-armv7l-3.7/source/soft_pwm.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/py_pwm.c -o build/temp.linux-armv7l-3.7/source/py_pwm.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/common.c -o build/temp.linux-armv7l-3.7/source/common.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/constants.c -o build/temp.linux-armv7l-3.7/source/constants.o
arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.7m -c source/wiringTB.c -o build/temp.linux-armv7l-3.7/source/wiringTB.o
arm-linux-gnueabihf-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-armv7l-3.7/source/py_gpio_RPi.o build/temp.linux-armv7l-3.7/source/c_gpio.o build/temp.linux-armv7l-3.7/source/cpuinfo.o build/temp.linux-armv7l-3.7/source/event_gpio.o build/temp.linux-armv7l-3.7/source/soft_pwm.o build/temp.linux-armv7l-3.7/source/py_pwm.o build/temp.linux-armv7l-3.7/source/common.o build/temp.linux-armv7l-3.7/source/constants.o build/temp.linux-armv7l-3.7/source/wiringTB.o -o build/lib.linux-armv7l-3.7/RPi/GPIO.cpython-37m-arm-linux-gnueabihf.so
running install_lib
creating /usr/local/lib/python3.7/dist-packages/RPi
copying build/lib.linux-armv7l-3.7/RPi/__init__.py -> /usr/local/lib/python3.7/dist-packages/RPi
copying build/lib.linux-armv7l-3.7/RPi/GPIO.cpython-37m-arm-linux-gnueabihf.so -> /usr/local/lib/python3.7/dist-packages/RPi
byte-compiling /usr/local/lib/python3.7/dist-packages/RPi/__init__.py to __init__.cpython-37.pyc
running install_egg_info
Writing /usr/local/lib/python3.7/dist-packages/RPi.GPIO-0.1.egg-info
root@localhost:~/code/GPIO_API_for_Python#
cd ~/code/pibrella/
cp ~/code/GPIO_API_for_Python/test/pwm.py pwmLED.py
gpio readall
Code:
root@localhost:~/code/pibrella# gpio readall
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
| CPU | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | CPU |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| | | 3.3v | | | 1 || 2 | | | 5v | | |
| 252 | 8 | SDA.1 | I2C | 1 | 3 || 4 | | | 5v | | |
| 253 | 9 | SCL.1 | I2C | 1 | 5 || 6 | | | 0v | | |
| 17 | 7 | GPIO0C1 | OUT | 0 | 7 || 8 | 1 | SERL | TxD.1 | 15 | 161 |
| | | 0v | | | 9 || 10 | 1 | SERL | RxD.1 | 16 | 160 |
| 164 | 0 | CTSN.4 | SERL | 1 | 11 || 12 | 1 | I2S | I2S_CLK | 1 | 184 |
| 166 | 2 | GPIO5B6 | OUT | 0 | 13 || 14 | | | 0v | | |
| 167 | 3 | GPIO5B7 | OUT | 0 | 15 || 16 | 0 | OUT | GPIO5B2 | 4 | 162 |
| | | 3.3v | | | 17 || 18 | 0 | OUT | GPIO5B3 | 5 | 163 |
| 257 | 12 | MOSI.2 | SPI | 0 | 19 || 20 | | | 0v | | |
| 256 | 13 | MISO.2 | SPI | 1 | 21 || 22 | 0 | OUT | GPIO5C3 | 6 | 171 |
| 254 | 14 | SCLK.2 | SPI | 1 | 23 || 24 | 1 | SPI | CE0.2 | 10 | 255 |
| | | 0v | | | 25 || 26 | 1 | IN | GPIO8A3 | 11 | 251 |
| 233 | 30 | SDA.4 | I2C | 1 | 27 || 28 | 1 | I2C | SCL.4 | 31 | 234 |
| 165 | 21 | RTSN.4 | SERL | 1 | 29 || 30 | | | 0v | | |
| 168 | 22 | GPIO5C0 | OUT | 0 | 31 || 32 | 1 | SERL | GPIO7C7 | 26 | 239 |
| 238 | 23 | GPIO7C6 | SERL | 1 | 33 || 34 | | | 0v | | |
| 185 | 24 | I2S_FS | I2S | 0 | 35 || 36 | 1 | SERL | RxD.3 | 27 | 223 |
| 224 | 25 | TxD.3 | SERL | 1 | 37 || 38 | 1 | I2S | I2S_SDI | 28 | 187 |
| | | 0v | | | 39 || 40 | 0 | I2S | I2S_SDO | 29 | 188 |
+-----+-----+---------+------+---+----++----+---+------+---------+-----+-----+
| CPU | wPi | Name | Mode | V | Physical | V | Mode | Name | wPi | CPU |
+-----+-----+---------+------+---+--Tinker--+---+------+---------+-----+-----+
root@localhost:~/code/pibrella#
pibrella yellowLED is GPIO 164 / wPi 0 / Physical 11
nano pwmLED.py add to top of file... #!/usr/bin/env python3
Code:
#!/usr/bin/env python3
#Testing for software PWM
import ASUS.GPIO as GPIO
import unittest
import time
LED = 164
GPIO.setmode(GPIO.ASUS)
GPIO.setup(LED, GPIO.OUT)
pwm = GPIO.PWM(LED, 50)
pwm.start(100)
while True:
for i in range(0,3):
for x in range(0,101,5):
pwm.ChangeDutyCycle(x)
time.sleep(0.1)
for x in range(100,-1,-5):
pwm.ChangeDutyCycle(x)
time.sleep(0.1)
chmod +x pwmLED.py & ./pwmLED.py to run..
Code:
root@localhost:~/code/pibrella# chmod +x pwmLED.py
root@localhost:~/code/pibrella# ./pwmLED.py
This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
^CTraceback (most recent call last):
File "./pwmLED.py", line 16, in <module>
time.sleep(0.1)
KeyboardInterrupt
root@localhost:~/code/pibrella#
..;-]... pibrella yellowLED glow....
test PWM & C libary...
cd ~/code/pibrella and copy examples from GPIO_API_for_C folder..
cp ~/code/GPIO_API_for_C/examples/softTone.c .
Code:
/*
* softTone.c:
* Test of the softTone module in wiringPi
* Plays a scale out on pin 3 - connect pizeo disc to pin 3 & 0v
*
* Copyright (c) 2012-2013 Gordon Henderson. <projects@drogon.net>
***********************************************************************
* This file is part of wiringPi:
* https://projects.drogon.net/raspberry-pi/wiringpi/
*
* wiringPi is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* wiringPi is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with wiringPi. If not, see <http://www.gnu.org/licenses/>.
***********************************************************************
*/
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <wiringPi.h>
#include <softTone.h>
#define PIN 1
int scale [8] = { 262, 294, 330, 349, 392, 440, 494, 525 } ;
int main ()
{
int i ;
wiringPiSetup () ;
softToneCreate (PIN) ;
for (;;)
{
for (i = 0 ; i < 8 ; ++i)
{
printf ("%3d\n", i) ;
softToneWrite (PIN, scale [i]) ;
delay (500) ;
}
}
}
gcc -o softTone softTone.c -lwiringPi
Code:
root@localhost:~/code/pibrella# ./softTone
0
1
2
3
4
5
6
7
0
1
2
3
4
^C
root@localhost:~/code/pibrella#
..;-].. buzzer now makes tunes....
other
example python code...
nano l
edblink.py
Code:
#!/usr/bin/env python3
import ASUS.GPIO as GPIO
import time
GPIO.setwarnings(False)
GPIO.setmode(GPIO.ASUS)
RED = 166
YELLOW = 164
GREEN = 17
GPIO.setup(RED,GPIO.OUT)
GPIO.setup(YELLOW,GPIO.OUT)
GPIO.setup(GREEN,GPIO.OUT)
try:
while True:
#open led
print("open led")
GPIO.output(RED, GPIO.HIGH)
GPIO.output(YELLOW, GPIO.HIGH)
GPIO.output(GREEN, GPIO.HIGH)
time.sleep(0.5) # 500ms
# close led
print("close led")
GPIO.output(RED, GPIO.LOW)
GPIO.output(YELLOW, GPIO.LOW)
GPIO.output(GREEN, GPIO.LOW)
time.sleep(0.5) # 500ms
except KeyboardInterrupt:
GPIO.cleanup()
chmod +x ledblink.py
run python script ledblink.py with..
Code:
root@localhost:~/code/pibrella# ./ledblink.py
open led
close led
open led
close led
open led
close led
open led
close led
open led
close led
^Croot@localhost:~/code/pibrella#
..;-].. all three LEDs blink....
now test GPIO inputs with button shell script..
nano button.sh
Code:
#!/usr/bin/bash
# Include gpio script to access the gpio function directly
source gpioTB
#
# turns ON.. Pibrella's Green LED when switch connected
# to PIN 33 [ASUS 238] of tinker board is pressed &
# scrolls message up the screen... Pressed [n] Time...
#
pinLED="17"
pinBUTT="238"
#pinBUTT="254"
delay="0.25"
#
ON="1"
OFF="0"
#
# Initialize pins
gpioTB mode $pinLED out
gpioTB mode $pinBUTT in
#
# Ctrl-C handler for clean shutdown
shutdown()
{
buttonLED=$OFF
gpioTB write $pinLED $buttonLED
# Unexport pins to clean up on exit..
gpioTB clean $pinLED
gpioTB clean $pinBUTT
exit 0
}
#trap shutdown SIGINT
#
#
buttonLED=$OFF
# start loop until Ctrl-C.....
counter="0"
while true;
do
trap 'shutdown' exit 0
#trap 'echo bye...' exit 0
buttonPRESS=`gpioTB read $pinBUTT`
if [ $buttonPRESS -eq 0 ]; then
counter=$((counter + 1))
echo "maybe button is pressed [$counter] Time...;-]..."
buttonLED=$ON # LED ON
gpioTB write $pinLED $buttonLED
fi
sleep $delay
buttonLED=$OFF # LED OFF
gpioTB write $pinLED $buttonLED
done
exit 0
chmod +x button.sh
run shell script with ./button.sh
Code:
root@localhost:~/code/pibrella# ./button.sh
/usr/bin/gpioTB: line 33: /sys/class/gpio/export: Permission denied
/usr/bin/gpioTB: line 35: /sys/class/gpio/gpio17/direction: No such file or directory
/usr/bin/gpioTB: line 33: /sys/class/gpio/export: Permission denied
/usr/bin/gpioTB: line 35: /sys/class/gpio/gpio238/direction: No such file or directory
cat: /sys/class/gpio/gpio238/value: No such file or directory
./button.sh: line 42: [: -eq: unary operator expected
/usr/bin/gpioTB: line 28: /sys/class/gpio/gpio17/value: No such file or directory
cat: /sys/class/gpio/gpio238/value: No such file or directory
./button.sh: line 42: [: -eq: unary operator expected
/usr/bin/gpioTB: line 28: /sys/class/gpio/gpio17/value: No such file or directory
cat: /sys/class/gpio/gpio238/value: No such file or directory
./button.sh: line 42: [: -eq: unary operator expected
/usr/bin/gpioTB: line 28: /sys/class/gpio/gpio17/value: No such file or directory
cat: /sys/class/gpio/gpio238/value: No such file or directory
./button.sh: line 42: [: -eq: unary operator expected
/usr/bin/gpioTB: line 28: /sys/class/gpio/gpio17/value: No such file or directory
cat: /sys/class/gpio/gpio238/value^C/usr/bin/gpioTB: line 28: /sys/class/gpio/gpio17/value: No such file or directory
root@localhost:~/code/pibrella#
NOTE.. this is because you need to use
sudo ./bin/enter_deb or -0 for sysfs to control GPIO..
just remember not to install with apt or update... ]]].....
exit Debian to return back to android termux and run
Code:
bash:5.0][u0_a60]@~:$ sudo ./bin/enter_deb -0
root@localhost:~# cd code/pibrella/
root@localhost:~/code/pibrella# ./button.sh
maybe button is pressed [1] Time...;-]...
maybe button is pressed [2] Time...;-]...
maybe button is pressed [3] Time...;-]...
maybe button is pressed [4] Time...;-]...
maybe button is pressed [5] Time...;-]...
maybe button is pressed [6] Time...;-]...
^C
root@localhost:~/code/pibrella#
push the button & pibrella greenLED turn on with message..
ctrl+c to quit.. & use exit to go back to android termux..
sooo...
C GPIO library & Python GPIO library both are working in debian-on-termux environment.
next.. learn how to disable SPI / I2C / PWM & Serial on tinker Board..
I think this has something to do with device tree ?????? ;-]..
also.. setup..
vncserver for X11 server with
i3 tiling window manager,
but this is only because I have Logitech C922 pro Stream Webcam connected to laptop that I ssh into with
X forwarding to make videos using Mobizen App from android on tinker Board ;-]..
------------------
hope it helps
k,
debian-on-Termux via debootstrap & proot working on TinkerOS_Android 7 Nougat V14.3.2.82
next> GPIO & Tinker Board Device Tree..??? tbc..