Skip to content
This repository has been archived by the owner on Jan 11, 2024. It is now read-only.

RaspiBcmPin.GPIO_13 not working even in BROADCOM_PIN_NUMBERING #276

Closed
salk31 opened this issue Sep 22, 2016 · 7 comments
Closed

RaspiBcmPin.GPIO_13 not working even in BROADCOM_PIN_NUMBERING #276

salk31 opened this issue Sep 22, 2016 · 7 comments
Assignees
Labels
Milestone

Comments

@salk31
Copy link
Contributor

salk31 commented Sep 22, 2016

My usage is that I'm listening for change events. It is very odd as RaspiPin.GPIO_23 works but not RaspiBcmPin.GPIO_13 even though I've set broadcom pin numbering (and other usages take notice of the numbering scheme).

I'm afraid I've not characterised the problem yet but wondered if it rang any bells.

@savageautomate
Copy link
Member

Issue reproduced; looking into the problem.

@savageautomate savageautomate added this to the RELEASE 1.2 milestone Dec 2, 2016
@savageautomate savageautomate self-assigned this Dec 2, 2016
@savageautomate
Copy link
Member

Fixed in latest deployed 1.2-SNAPSHOT.

@ghost
Copy link

ghost commented Jan 2, 2017

Does not seem to be fixed in 1.2-SNAPSHOT. The issue is only occurring for DigitalInputPin. GpioFactory.setDefaultProvider(new RaspiGpioProvider(BROADCOM_PIN_NUMBERING)); has no impact: RaspiPin.GPIO_21 is working in both cases and RaspiBcmPin.GPIO_05 in none. For DigitalOutputPin it is working.

@savageautomate
Copy link
Member

savageautomate commented Jan 9, 2017

@Ant1Zykl0n

I just tested it again here using BCM 5 (RaspiBcmPin.GPIO_05) and it seems to be working properly for me.

pinout

I'm going to update my system with the latest Raspian updates just to make sure it still working in the latest builds.

@ghost
Copy link

ghost commented Jan 9, 2017

I just tested it again. BCM as InputPin is not working. I'm using Snapshot 1.2 and Raspberry 3B. Here is the code. I used a LED to test the output behavior and a reed switch to test the input behavior.

public static void main(String[] args) throws InterruptedException {
        testInputBCM();
 }


   
    //working
    public static void testOutput() throws InterruptedException {
        GpioController gpioController = GpioFactory.getInstance();
        GpioPinDigitalOutput pin = gpioController.provisionDigitalOutputPin(RaspiPin.GPIO_21);

        pin.setShutdownOptions(true, LOW);
        pin.setState(HIGH);
        Thread.sleep(5000);
        gpioController.shutdown();
    }

    //working
    public static void testOutputBCM() throws InterruptedException {
        GpioFactory.setDefaultProvider(new RaspiGpioProvider(BROADCOM_PIN_NUMBERING));
        GpioController gpioController = GpioFactory.getInstance();
        GpioPinDigitalOutput pin = gpioController.provisionDigitalOutputPin(RaspiBcmPin.GPIO_05);

        pin.setShutdownOptions(true, LOW);
        pin.setState(HIGH);
        Thread.sleep(5000);
        gpioController.shutdown();
    }

    //working
    public static void testInput() throws InterruptedException {
        GpioController gpioController = GpioFactory.getInstance();
        GpioPinDigitalInput pin = gpioController.provisionDigitalInputPin(RaspiPin.GPIO_21);

        pin.addListener((GpioPinListenerDigital) event -> System.out.println("Input GPIO 21"));
        Thread.sleep(5000);
        gpioController.shutdown();
    }

    //not working
    public static void testInputBCM() throws InterruptedException {
        GpioFactory.setDefaultProvider(new RaspiGpioProvider(BROADCOM_PIN_NUMBERING));
        GpioController gpioController = GpioFactory.getInstance();
        GpioPinDigitalInput pin = gpioController.provisionDigitalInputPin(RaspiBcmPin.GPIO_05);

        pin.addListener((GpioPinListenerDigital) event -> System.out.println("Input GPIO BCM (05)"));
        Thread.sleep(5000);
        gpioController.shutdown();
    }

@ghost
Copy link

ghost commented Jan 23, 2017

Any news?

@salk31
Copy link
Contributor Author

salk31 commented Apr 26, 2017

FWIW BCM 12, 13 and 14 working for me with SNAPSHOT-1.2 fetched today.

Many thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants