0

I have a BPI-CM4 running Android 9, the official OS for this module. I have installed Termux and Python to create command-line applications and run them as scripts in Linux.

My problem is that I need to interact with I2C devices or GPIO pins, but no matter what I have tried, it hasn't worked. So far, I have attempted to install various libraries like WiringPi, RPi.GPIO, Amlogic-wiringPi, etc., but all of them give me a lot of compilation errors. In the best-case scenario, after resolving those errors, I get the message "This library is made for Raspberry Pi," even though it's a port of the library for use with Banana Pi. I have also tried to install directly in Python with the same issues, and using apt install or pkg,

I cannot find applications in the repositories like i2c-tools. Finally, I managed to install the smbus2 library in Python, but when I perform a write operation to the device, it gives me the error message:

"ioctl(self.fd, I2C_SMBUS, msg). OSError: [Errno 6] No such device or address."

This indicates that the module is not loaded, even though I have the device at /dev/i2c-1. I have tried to install kmod using apt install to have modprobe and other commands that I also don't have, but it doesn't exist...

In summary, I have tried everything. I am even willing to use bash scripts directly, but since I can't find any commands to install either, I don't know how to proceed. I'm feeling quite desperate at this point. Do you have any ideas?

Thank you in advance.

AALis
  • 11
  • 1
  • While Android uses the Linux kernel, there are quite some differences between the Android and classic Linux ecosystems and usage models. According to the Banana Pi [wiki page](https://wiki.banana-pi.org/Banana_Pi_BPI-CM4#System_image) there are Debian and Ubuntu based images available also, which I would expect would have better software support when it comes to such activities. Is using them out of question? – skandigraun Jul 11 '23 at 08:21
  • Yes I know I can use a Debian or Ubuntu OS, but, need Android, this is mandatory... and this is the problem, with Android I don't know how to do these things because it doesn't seem to have anything to do with a regular Linux, and the support from Bananapi is terrible, with hardly any information about anything." – AALis Jul 11 '23 at 18:36

0 Answers0