> -----Original Message-----
> From: Guillaume Gardet <[email protected]>
> Sent: 16 September 2021 10:01
> To: Peter Suetterlin <[email protected]>; [email protected]
> Cc: Matthias Brugger <[email protected]>
> Subject: RE: GPIO trouble
>
> Hi,
>
> > -----Original Message-----
> > From: Peter Suetterlin <[email protected]>
> > Sent: 15 September 2021 17:52
> > To: [email protected]
> > Subject: GPIO trouble
> >
> >
> > Hi list,
> >
> > slowly trying to get known with my Pi 4 running Tumbleweed.
> > I added a fan, and wanted to control it via GPIO. But I fail to
> > actually control the pins :(
> >
> > I was trying to follow this description:
> > https://howchoo.com/g/ote2mjkzzta/control-raspberry-pi-fan-temperature
> > -
> > python
> > that uses GIOP17. So I installed the needed 'gpiozero' python package
> > using pip.
> >
> > Trying the command 'pinout' that is part of it results in an error:
> >
> > Unable to initialize GPIO Zero. This usually means that you are not
> > running pinout on a Raspberry Pi. If you still wish to run pinout, set
> > the GPIOZERO_PIN_FACTORY environment variable to 'mock' and retry, or
> > refer to the Remote GPIO section of the manual* to configure your
> environment to remotely access your Pi.
> >
> > So I export GPIOZERO_PIN_FACTORY=mock, then I get a pinout listed, I
> > can run python, and with from gpiozero import OutputDevice fan =
> > OutputDevice(17) I can use fan.on(), fan.off() or fan.value to set/read the
> > state.
> > Just the pin doesn't do anything, it always stays low :(
> >
> > So I wanted to get most basic and tried echo 17 >
> > /sys/class/gpio/export but that gave me only "write error: Invalid
> > argument"
> >
> > Indeed the directory only lists
> > Pi4:~ # ls /sys/class/gpio
> > export gpiochip446 gpiochip454 unexport
> >
> > which suggests lowest GPIO available is 446!?
> >
> > What am I missing?
>
> Did you have a look at https://en.opensuse.org/openSUSE:GPIO for standard
> packages to access GPIO instead of downstream, RPi specific, software?
>
> You can use 'gpioinfo gpiochip446' and 'gpioinfo gpiochip454' to get info
> about the
> gpio available.
>
> You can try to use an offset of 446, so try to set gpio 463 (446 + 17). Not
> sure why
> there is such an offset, though.
> Matthias, any idea?
And latest released Tumbleweed (20210901) test in openQA shows gpiochips 0 and
1:
gpiochip0 [pinctrl-bcm2711] (58 lines)
gpiochip1 [raspberrypi-exp-gpio] (8 lines)
See: https://openqa.opensuse.org/tests/1898134#step/libgpiod/14
>
> Cheers,
> Guillaume