You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It was ok with previous versions of RaspiOS until 2024-07-04.
The code runs in a container under IotHub module.
Steps to reproduce
First of all, I've solved with a workaround using this code that isn't production ready
#pragma warning disable SDGPIO0001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.gpioController=new GpioController(PinNumberingScheme.Logical,new LibGpiodDriver(0, LibGpiodDriverVersion.V1));
#pragma warning restore SDGPIO0001 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.}
and with the following Dockerfile (I'm sure I can remove some packages)
Full very simple code at my repo gpio-tester
Previous attempts as suggested in #2361
1 Create a simple Console App and run outside the container -> OK
2 Containerized the app, but using the old approach that has worked fine in the last year -> KO
gpioController=new GpioController();
and with the following Dockerfile
RUN apt-get update \
&& apt install -y sudo libgpiod-dev
Made a lot of attempt trying different package without success until I've found the working solution described above
Expected behavior
All should work with
gpioController=new GpioController();
or at least this code inside your library should be modified from this
caseRaspberryBoardInfo.Model.RaspberryPi5:// For now, for Raspberry Pi 5, we'll use the LibGpiodDriver.// We need to create a new driver for the Raspberry Pi 5,// because the Raspberry Pi 5 uses an entirely different GPIO controller (RP1)returnnew LibGpiodDriver(4);
to this
caseRaspberryBoardInfo.Model.RaspberryPi5:// For now, for Raspberry Pi 5, we'll use the LibGpiodDriver.// We need to create a new driver for the Raspberry Pi 5,// because the Raspberry Pi 5 uses an entirely different GPIO controller (RP1)returnnew LibGpiodDriver(0, LibGpiodDriverVersion.V1);
I can make a PR, but I think this part is so crucial and you're already working on the implementation for RP1
Actual behavior
This exception is thown
11/11/2024 14:22:45 +01:00 System.IO.IOException: Unable to find a chip, error code: 2
at System.Device.Gpio.Drivers.Libgpiod.V1.LibGpiodV1Driver..ctor(Int32 gpioChip)
at System.Device.Gpio.Drivers.LibGpiodDriverFactory.CreateInternal(LibGpiodDriverVersion version, Int32 chipNumber)
at System.Device.Gpio.Drivers.LibGpiodDriverFactory.CreateAutomaticallyChosenDriver(Int32 chipNumber)
at System.Device.Gpio.Drivers.LibGpiodDriverFactory.Create(Int32 chipNumber)
at System.Device.Gpio.Drivers.LibGpiodDriver..ctor(Int32 gpioChip)
at System.Device.Gpio.GpioController.GetBestDriverForBoardOnLinux()
at System.Device.Gpio.GpioController.GetBestDriverForBoard()
at System.Device.Gpio.GpioController..ctor(PinNumberingScheme numberingScheme)
at System.Device.Gpio.GpioController..ctor()
Versions used
Latest version 3.2.0 of System.Device.Gpio and net9
The text was updated successfully, but these errors were encountered:
that deals with _installedLibraries. Since in my working solution I've forced V1 version, may be that latest RaspiOS now install by the V2 version, the library find it but has some incompatibility with your code?
One more thingh: what about the gpioChip parameter of LibGpiodDriver contructor? Your default is 4, mine is 0 and is working!
Thank you for your amazing job with this ecosystem!
Describe the bug
It was ok with previous versions of RaspiOS until 2024-07-04.
The code runs in a container under IotHub module.
Steps to reproduce
First of all, I've solved with a workaround using this code that isn't production ready
and with the following Dockerfile (I'm sure I can remove some packages)
RUN apt-get update \ && apt-get install -y sudo libgpiod2 gpiod libgpiod-dev libpigpiod-if-dev libpigpiod-if1 libpigpiod-if2-1
Full very simple code at my repo gpio-tester
Previous attempts as suggested in #2361
and with the following Dockerfile
RUN apt-get update \ && apt install -y sudo libgpiod-dev
Made a lot of attempt trying different package without success until I've found the working solution described above
Expected behavior
All should work with
or at least this code inside your library should be modified from this
to this
I can make a PR, but I think this part is so crucial and you're already working on the implementation for RP1
Actual behavior
This exception is thown
Versions used
Latest version 3.2.0 of System.Device.Gpio and net9
The text was updated successfully, but these errors were encountered: