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

Unable to set pin mode on pi5 #2300

Closed
IamRewt opened this issue Mar 24, 2024 · 4 comments
Closed

Unable to set pin mode on pi5 #2300

IamRewt opened this issue Mar 24, 2024 · 4 comments
Labels
bug Something isn't working Needs: Author Feedback We are waiting for author to react to feedback (action required)

Comments

@IamRewt
Copy link

IamRewt commented Mar 24, 2024

Describe the bug

After updating to version 3.1.0, I am unable to read or set modes on gpio pins on the raspberry pi 5. The library works properly when reverting to 3.0.0.
 
Error Message: Unhandled exception. System.IO.IOException: Error setting pin mode, for pin: 4, error: 16.
Steps to reproduce

 var gpio = new GpioController();
 gpio.OpenPin(4);
 gpio.SetPinMode(4, PinMode.Input); <-- Throws error.
 Console.WriteLine(gpio.Read(4));

Expected behavior

The pin should set and be readable.

Actual behavior

The pin does not get set and the error message is thrown.

Versions used

@IamRewt IamRewt added the bug Something isn't working label Mar 24, 2024
@pgrawehr
Copy link
Contributor

That's kind of expected, since we do not have full support for the pi 5 yet. You need to manually select the driver (either libgpiod or sysfs)

@IamRewt
Copy link
Author

IamRewt commented Mar 25, 2024

There may have been a regression, related to the pi 5, with version 3.1.0 as the gpio seems to function normally in 3.0.0. The above code runs without error and properly reads the pins. I haven't tested all of the gpio pins but have tried several of them without issue.

Given the 5 is still fairly new, I can go back to testing with a 4 for now.

@pgrawehr
Copy link
Contributor

We have added partial support for the Pi5 in 3.1.0 (IIRC), but you should get it to work by calling

var gpioController = new GpioController(new LibgpiodDriver(4));

@krwq krwq added the Needs: Author Feedback We are waiting for author to react to feedback (action required) label Mar 28, 2024
Copy link
Contributor

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

@github-actions github-actions bot locked and limited conversation to collaborators May 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working Needs: Author Feedback We are waiting for author to react to feedback (action required)
Projects
None yet
Development

No branches or pull requests

3 participants