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

input pin pin changed callback not firing #1851

Closed
fbd-ss opened this issue Apr 15, 2022 · 6 comments
Closed

input pin pin changed callback not firing #1851

fbd-ss opened this issue Apr 15, 2022 · 6 comments

Comments

@fbd-ss
Copy link

fbd-ss commented Apr 15, 2022

As the title says when setting up an input pin with RegisterCallbackForPinValueChangedEvent, the callback never gets fired.

The board is a raspberry Pi 4b, with the service running under systemd as a background service.
System.Device.Gpio version 2.1.0

No unhandled exceptions are occurring, the callback is just flat out not getting called.

Having no dramas with outputs.
The input is working as the value can be read as changed directly after it has been set.

Any ideas anyone having dramas with this?

@ghost ghost added the untriaged label Apr 15, 2022
@pgrawehr
Copy link
Contributor

Have you installed libgpiod? This usually fixes this. Run sudo apt install libgpiod-dev

@fbd-ss
Copy link
Author

fbd-ss commented Apr 16, 2022

Managed to get it going, i had the non dev version installed. Not sure if it was that or i was calling open_pin for a second time before registering the callback and an exception was getting thrown but not showing up in the unhandled exception handler.

Q, do i have to explicitly set up the constructor like "new GpioController( PinNumberingScheme.Logical, new LibGpiodDriver( 0 ) )" to use the libgpiod library? If just setting up like "new GpioController()" will it revert to the old sys driver.

@pgrawehr
Copy link
Contributor

No, normally that should work correctly automatically, unless you are facing another instance of #1798 . Can you check your board revision?

@fbd-ss
Copy link
Author

fbd-ss commented Apr 16, 2022

Revision : b03112
SoC : BCM2711

I guess that rules out issue 1798, ill mess around and see what happens.

@fbd-ss
Copy link
Author

fbd-ss commented Apr 16, 2022

Ill put this down to i had libgpiod not libgpiod-dev installed then in InitializeInterruptDriver it defaulted to SysFs and the fact then the pin was being opened a second time freaked out the driver and threw an exeption before the handler was getting registered.

Ive just tried it with the default constructor and all seems well.

Thanks D.

@pgrawehr
Copy link
Contributor

Closing this issue as it appears to be resolved.

@ghost ghost locked as resolved and limited conversation to collaborators May 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants