Hi krishna,
as a tEK_Newbie.. I 'm sorry I can't provide an alternative link for the same..
I'm using original tinker Board.. with TinkerOS_Android 7 Nougat V14.3.2.82..
sooo.. have adb root access to
mksh [MirBSD Korn Shell LINUX interactive user interface]
via USB / Serial or Network tcp/ip [LAN/Wifi]..
I've also used
lobo's guide to
root TinkerOS_Android 7 Nougat V14.3.2.82 & installed
Termux 0.73 (73) with root-repo / tsu & tsudo installed..
this give.. Android terminal emulator with local root access to shell..
but once ssh is installed in termux..
this give.. Network access to termux Android terminal emulator shell..
then.. as part of setting up an
Android Termux Development Environment..
installed..
lobo: wiringPi for Android.. ;-]..
soooo... now can.. ssh into termux Android terminal emulator shell..
& run.. sudo gpio readall
Code:
bash:5.0][u0_a60]@~:$ sudo 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 | 0 | 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 | IN | 0 | 13 || 14 | | | 0v | | |
| 167 | 3 | GPIO5B7 | IN | 0 | 15 || 16 | 0 | IN | GPIO5B2 | 4 | 162 |
| | | 3.3v | | | 17 || 18 | 0 | IN | GPIO5B3 | 5 | 163 |
| 257 | 12 | MOSI.2 | SPI | 0 | 19 || 20 | | | 0v | | |
| 256 | 13 | MISO.2 | SPI | 1 | 21 || 22 | 0 | IN | 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 | IN | 1 | 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--+---+------+---------+-----+-----+
bash:5.0][u0_a60]@~:$
note.. with sudo gpio... use wPi Pin#...
with a
pibrella connected to tinker Board.. this allows for safe play with electronics ;-]]]...
& basic functions to control gpio pins..
like.. compile pibrella.c from..
Template for Programming the Pimoroni Pibrella in C
in termux Android terminal emulator shell..
Code:
gcc -Wall -o pibrella pibrella.c -I/data/data/com.termux/files/usr/include/wiringPi -lwiringPi
& to run.. use ./pibrella
then I came across lobo's post
#4 in "UART and I2C config in android" Thread..
"
..there are no helper tools on Android, nothing like the i2c-tools on Linux. You need to write a program to read the i2c data..."
hmmmmm.. so.. how do I get Linux tools like.. i2c-tools to run on Android ?????
well... in termux.. you can install
debian-on-termux environment.. via.. debootstrap..
then install all the Linux Apps tools you want in the debian-on-termux environment..
& as long as the debian-on-termux environment has root access to termux Android terminal emulator shell..
&
everything in Unix/Linux is a file.. ;-]..
it should work.. in theory...
sooo... I was about to test this.. but.. I updated termux in TinkerOS_Android 7 Nougat V14.3.2.82..
& updated Termux 0.98 (98) removes tsudo from root-repo.. which breaks my ability to start
debian-on-termux environment... with sudo from termux Android terminal emulator shell.. [[[[[....
currently.. I'm re-installing & updating system to TinkerOS_Android 7 Nougat v14.4.0.5..
meanwhile.. found this..
I2C with Arduino and Raspberry Pi - Two Methods &
---------------------------------------------- ;-]...
hope to be back up over the weekend,
k,
----
ps.. from lobo: wiringPi for Android.
wiringPiI2C.c
Code:
...
// I2C definitions
#define I2C_SLAVE 0x0703
#define I2C_SMBUS 0x0720 /* SMBus-level access */
#define I2C_SMBUS_READ 1
#define I2C_SMBUS_WRITE 0
// SMBus transaction types
#define I2C_SMBUS_QUICK 0
#define I2C_SMBUS_BYTE 1
#define I2C_SMBUS_BYTE_DATA 2
#define I2C_SMBUS_WORD_DATA 3
#define I2C_SMBUS_PROC_CALL 4
#define I2C_SMBUS_BLOCK_DATA 5
#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
#define I2C_SMBUS_I2C_BLOCK_DATA 8
// SMBus messages
#define I2C_SMBUS_BLOCK_MAX 32 /* As specified in SMBus standard */
#define I2C_SMBUS_I2C_BLOCK_MAX 32 /* Not specified but we use same structure */
...
hope this helps somehow.. ;-].. k,