Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APA102 on Intel Edison: Unknown I/O name SPI2 #80

Closed
Zitt opened this issue Nov 26, 2017 · 4 comments
Closed

APA102 on Intel Edison: Unknown I/O name SPI2 #80

Zitt opened this issue Nov 26, 2017 · 4 comments

Comments

@Zitt
Copy link

Zitt commented Nov 26, 2017

I'm writing my second Android app using AndroidThings... first being a blink demo. So admittedly; I'm likely out of my element.

When I run my application; I'm getting the following error on the following lines:

            Log.d(TAG, "Initializing LED strip");
            mApa102 = new Apa102(apa102BusName, LED_MODE);

where
private static final String apa102BusName = "SPI2";

LogCat reports:

11-26 07:36:55.008 19031-19031/com.pinball_mods.zitt.edisontest D/HomeActivity: Initializing LED strip
11-26 07:36:55.019 19031-19031/com.pinball_mods.zitt.edisontest I/HomeActivity: Unable to configure SPI2 for APA102 led strip
                                                                                com.google.android.things.pio.PioException: android.os.ServiceSpecificException: Unknown I/O name SPI2
...

Do I have a broken Edison build chain? What am I missing

@Zitt
Copy link
Author

Zitt commented Nov 26, 2017

More debugging shows that

PeripheralManagerService service = new PeripheralManagerService();       

        List<String> deviceList = service.getSpiBusList();
        for(String dev : deviceList) {
            Log.i(TAG, dev);
        }

returns SPI2.1 instead of SPI2.

Using that string instead of SPI2... still doesn't work; but fails in a different way:

11-26 08:39:41.245 1466-1466/com.pinball_mods.zitt.edisontest I/HomeActivity: Unable to configure SPI2.1 for APA102 led strip
                                                                              com.google.android.things.pio.PioException: android.os.ServiceSpecificException: SPI2.1 failed to apply the required pin mux
                                                                                  at com.google.android.things.pio.SpiDeviceImpl.<init>(SpiDeviceImpl.java:41)

@Fleker
Copy link
Contributor

Fleker commented Nov 28, 2017

Looks like the Edison is using those pins for multiple things. There may be a way to configure the pin muxing on the system, but since that platform is deprecated it may not be high priority.

Are you using IO10-13 for anything else? Do you have any other apps currently installed?

@Zitt
Copy link
Author

Zitt commented Dec 2, 2017

Sorry; missed this update; received no email.

I am using IO13 for the LED blink as a heartbeat indicator.
I commented out that code; and I'm not getting any exceptions. I'm going to wire a stip up and see if it works.

@Zitt
Copy link
Author

Zitt commented Dec 2, 2017

Good call. IO13 / led blink was the cause.
IO13 shares the LED with one of the SPI pins on Intel Edision which was causing all of the issues.
Closing this as not a bug.

@Zitt Zitt closed this as completed Dec 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants