Search code examples
javaandroidgpioandroid-thingsodroid

Odroid N2 "getGpioList()" returns empty array, can't access gpio ports


Im running Lineage 16.0 on the Odroid N2. I want to access the GPIO pins via an Android App and have found something interesting inside the Android-Things documentary.

https://developer.android.com/things/sdk/pio/gpio

Now my problem is, my app doen't find any gpio ports. The following code only returns an empty array:

PeripheralManager manager = PeripheralManager.getInstance();
List<String> portList = manager.getGpioList();

Of course permissions are set as following:

<uses-permission android:name="com.google.android.things.permission.USE_PERIPHERAL_IO" />

I then just ignored that and tried to connect to the GPIO ports with this code:

PeripheralManager manager = PeripheralManager.getInstance();
Gpio gpio = manager.openGpio("488");

But still no success. but I'm not exactly sure if it doesn't work because instead "488" isn't the correct name for the GPIO-port or because of something else. I've also tried some variations like "BCM12" etc.

In either case, I'd like to get "getGpioList()" working first, but I honestly can't find the error.


Solution

  • Android Things didn't support Odroid N2 hardware platform. All Android Things supported hardware described in Official Documentation.