Comments (9)
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.
from iot.
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
from iot.
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.
from iot.
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.
from iot.
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.
from iot.
[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.
from iot.
Having similar issues after moving from a working to latest stable SDK & OpenWRT (musl-linux) on RiPi Compute Module 4.
'Segmentation fault' happens when assign the ValueChanged callback.
This project had been running fine with previous version(s) & GPIO buttons were working.
_gpioPinButtonUp.ValueChanged += GpioPinButtonUp_ValueChanged
Using
Dotnet SDK v8.101 (Alpine: dotnet-sdk-8.0.101-linux-musl-arm64)
OpenWRT v23.05.2 YES
Prev: (GPIO event working [hw buttons])
Dotnet v8.0.100-rc.2.23502.2
OpenWRT SNAPSHOT r24111-66f6c20e45
To replicate I build a simple console app, add dependancy System.Device.Gpio
(v3.1.0, tried right back to 2.2)
Build & Run App on RPi CM4 and get "Segmentation fault" after trying to assign the call back.
Have also tried the LibGpiodDriver when building the GPIO controller.
using var controller = new GpioController(PinNumberingScheme.Logical, new LibGpiodDriver(0));
Did a strace
and get this which might shine some light?
Remark out the Event Callback assign, and runs as expected.
Has something change recently with assigning callbacks in dotnet or is it a kernal/linux lib issue?
Ta!
from iot.
@PRIMETSS That does look like some problem either with the low-level driver or with the registering of the event itself. I quickly checked, and there where no significant changes to the libgpiod driver since at least v2.1. Can you tell which version works? Or is it now failing independent of the System.Device.Gpio library version?
Edit: And please open a new issue for this. It is not related to RPI5 at all.
from iot.
Looking at the repo seems there is work underway to better handle libgpiod v1 & v2 (new)
So I added daily build feed to Nuget and tried the latest <PackageReference Include="System.Device.Gpio" Version="3.2.0-prerelease.24077.2" />
And tried with V1 & V2 (system is using/installed libgpiod v1 [libgpiod.so.2 1.6.3], v2 is libgpiod.so.3)
var LinuxLibGpioDriver = new LibGpiodDriver(gpioChip: 1, LibGpiodDriverVersion.V1);
`var LinuxLibGpioDriver = new LibGpiodDriver(gpioChip: 1, LibGpiodDriverVersion.V2);'
Same 'Segmentation fault'
@pgrawehr OK Thanks I will open another issue
from iot.
Related Issues (20)
- OperationCanceledException causes libcamera not to be closed properly
- "Error 13 initializing the Gpio driver" with .NET 8 in rootless container HOT 31
- libgpiod v2 support HOT 5
- ILi9341 on Raspberry Pi 4 HOT 6
- Raspberry Pi4 running WIndows 11 - GPIO HOT 8
- Raspberry Pi 3A+ Board Revision 1.1 is not detected/supported during GpioController construction HOT 2
- Jitter on PIN Rising and Falling on GPIO Pin callback HOT 8
- Creating the documentation with the essential knowledge (or links)
- Dht11, Dht22, no result in RaspBerry Pi5 HOT 7
- Improve library detection algorithm in LibGpiodDriverFactory HOT 2
- Check alternatives to exposing LibGpiodDriverVersion enum
- GPIOController (PinChangeEventHandler): Assigning a PinChangeEventHandler callback or Controller.OpenPin() causes "Segmentation Error" HOT 20
- If define a PWM Output on , eg GPIO18 (pin12), Does it create a ValueChanged Event if I enable this ? HOT 6
- [Test Issue] GitHub Automation Testing HOT 1
- system.device.gpio is missing NuGet package README file HOT 2
- Add LIS3DSHTR to LIS3DHTR code HOT 4
- logical GPIO HOT 5
- UltralightCardType detect bug HOT 1
- TryReadNdefMessage can trim off terminator TLV (0xFE) causing validation to throw exception HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iot.