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

Raspberry Pi 5 -> GPIO Package Can it Support as of Today ???? #2262

Closed
Tracked by #2261
jldigi40 opened this issue Jan 5, 2024 · 10 comments
Closed
Tracked by #2261

Raspberry Pi 5 -> GPIO Package Can it Support as of Today ???? #2262

jldigi40 opened this issue Jan 5, 2024 · 10 comments
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins documentation Documentation bug or enhancement, does not impact product or test code Priority:1 Work that is critical for the release, but we could probably ship without up-for-grabs Good issue for external contributors to iot

Comments

@jldigi40
Copy link

jldigi40 commented Jan 5, 2024

I have been playing with the current latest 3.10 GPIO Nuget Package and worked on Rasperry Pi 4.

When use on Pi 5 get exception error ...

1/5/2024 4:49:05 PM :  Cannot open-create Input Device ?....System.IO.IOException: Error while requesting event listener for pin 17, error code: 16
   at System.Device.Gpio.Drivers.LibGpiodDriverEventHandler.SubscribeForEvent(SafeLineHandle pinHandle)

I get same error if change pinnaming or any pin mode setting.

Onlu Open and Close Pin causes no exception

I believe Pi4 and 5 the registers on board a different to drive the 40 pin I/O pins ?

Can I get confirmation Pi5 is not supported as of today using this GPIO ?

Funny think I2C drivers for PI 4 work on PI 5 as use this also, but GPIO is failing.

@jldigi40 jldigi40 added the api-suggestion Early API idea and discussion, it is NOT ready for implementation label Jan 5, 2024
@ghost ghost added the untriaged label Jan 5, 2024
@pgrawehr
Copy link
Contributor

pgrawehr commented Jan 5, 2024

Which driver are you using? We did have confirmation that Libgpiod should work on the Raspberry Pi 5. It is expected that the RaspberryPi3Driver is not working, as that uses an interface that is not available on the Pi5.

Please show a simple example that causes the above error.

@krwq
Copy link
Member

krwq commented Jan 5, 2024

The error message suggests that comes from Libgpiod. @jldigi40 I'm not sure the events are supported on Pi 5, I'd start with regular Read/Write before trying that. Also you might want to try to pass different gpio chip, I recall the chip might be 1 on RPi5 rather than default 0 (but I might misremember). Here's how you do that: new GpioController(PinNumberingScheme.Logical, new LibGpiodDriver(gpioChip: 1))

We should add proper support sometime in the near future so that gets picked up automatically

@jldigi40
Copy link
Author

jldigi40 commented Jan 7, 2024

Hello ALL,

Thanks, quick response, I had a play with recommended using LibGpiodDriver as recommended and if use LibGpiodDriver(gpioChip: 1) I get exception to creating a GpioController Object. If run LibGpiodDriver(gpioChip: 0), get no exception

var controller = new GpioController(PinNumberingScheme.Logical, new LibGpiodDriver(gpioChip: 0));
// new LibGpiodDriver(gpioChip: 0) work Pi5

//// DIO6

controller.OpenPin(24, PinMode.InputPullUp);

controller.OpenPin(24).ValueChanged += pin24Change;

Also the event handling like attach handler to 'ValueChanged' works all ok so far

I need to run some real world test simulate inputs and see if reacts correctly..... cross fingers

Just some background,

I have a PI and an Industrial IO Carrier from 'UniPi' - Product is UniPi 1.1 Lite - https://www.unipi.technology/unipi-1-1-lite-p83

It has 6 optically isolated inputs (0-24V) and 6 relays - controlled from I2C MCP 23008 chip , this I have working - ie output control ( pi3-4 and now pi 5) End project is a product dev R&D-POC for a Industrial Edge Device Handler.

I need IO to monitor machine inputs the unit will be attached too - ie legacy machinery so need to control some outputs also as well as three separate industry protocols (TCP-IP) based. Basing solution on Blazor for a Web Interface and C# backend for protocol and application Edge IO control.

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

huesla commented Jan 13, 2024

For Pi5 you have to use GPIO chip 4 instead of 0, as compared to Pi4. This is because Pi5 has a slightly different GPIO line schema. Use the gpioinfo command for more information, it comes with the libgpiod package.

@ghost
Copy link

ghost commented Jan 17, 2024

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.

@Ellerbach Ellerbach added area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins documentation Documentation bug or enhancement, does not impact product or test code Priority:1 Work that is critical for the release, but we could probably ship without and removed api-suggestion Early API idea and discussion, it is NOT ready for implementation untriaged Needs: Author Feedback We are waiting for author to react to feedback (action required) Status: No Recent Activity labels Jan 18, 2024
@Ellerbach
Copy link
Member

[Triage] We should document how to properly run it on a RPI5. And creating a RPI5 board class for a start. Later on, we will switch to a dedicated driver, it will work the same but faster.

@PRIMETSS

This comment was marked as off-topic.

@pgrawehr

This comment was marked as off-topic.

@PRIMETSS

This comment was marked as off-topic.

@krwq krwq added the up-for-grabs Good issue for external contributors to iot label Apr 11, 2024
@krwq
Copy link
Member

krwq commented May 16, 2024

[Triage] We're closing this issue in favor of #2261 and #2315 - there is also a workaround for this: using LibGpiodDriver with chip number 4

@krwq krwq closed this as completed May 16, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Device.Gpio Contains types for using general-purpose I/O (GPIO) pins documentation Documentation bug or enhancement, does not impact product or test code Priority:1 Work that is critical for the release, but we could probably ship without up-for-grabs Good issue for external contributors to iot
Projects
None yet
Development

No branches or pull requests

6 participants