1

I'm working with a Raspberry Pi Zero 2 W running Linux raspberrypi 5.15.61-v7+.

Is this a reliable way to establish that I have a non functional GPIO 15?

First, I establish that my test mechanism works by using GPIO 14 to light up an LED that is attached to my breadboard.

$ raspi-gpio set 14 op pn dh # Light turns on 
$ raspi-gpio set 14 op pn dl # Light turns off
$ raspi-gpio set 14 op pn dh # Light turns on
$ raspi-gpio get 14
GPIO 14: level=1 fsel=1 func=OUTPUT

Next, I then try GPIO 15.

raspi-gpio set 15 op pn dh # No light
raspi-gpio set 15 op pn dl # No light
raspi-gpio set 15 op pn dh # No light
raspi-gpio get 15
GPIO 15: level=1 fsel=1 func=OUTPUT

To complete the cycle of testing, I move onto GPIO 18.

$ raspi-gpio set 18 op pn dh # Light on
$ raspi-gpio set 18 op pn dl # Light off
$ raspi-gpio set 18 op pn dh # Light on
$ raspi-gpio get 18
GPIO 18: level=1 fsel=1 func=OUTPUT

Is my test flawed in some way?

Eric Johnson
  • 125
  • 5

2 Answers2

1

Check the GPIO with pigpio's gpiotest.

https://elinux.org/R-Pi_Troubleshooting#Testing

joan
  • 71,024
  • 5
  • 73
  • 106
  • Right, I forgot to include my results from that test. All pins pass. Still I'm left with the question of - is it reasonable of me to expect my little program to light up GPIO 15 (wPi 16) as I have with all the other GPIO pins that I've tested? – Eric Johnson Nov 13 '22 at 20:57
1

WiringPi used its own eclectic numbering system.
Whatever its justification in 2013 it is best practice to use BCM numbering.

You can set TxD HIGH with

raspi-gpio set 14 op pn dh

and LOW with

raspi-gpio set 14 op pn dl

NO need for any libraries or programs with Raspberry Pi OS using the inbuilt raspi-gpio utility.

raspi-gpio help will show documentation for this utility. e.g.
raspi-gpio get will show state of all pins (and has the advantage for showing ACTUAL pin function rather than the static default.

NOTE you may be interested in GPIOreadall which is a Python program which reformats the raspi-gpio output into a format similar to GPIO readall.

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • Thanks for the clarification on the correct nomenclature and just using the command line. So with the command line, I can successfully light an LED with BCM pin 14. But not pin 15. Which makes me think that for my zero 2 w pi - pin 15 is kaput. – Eric Johnson Nov 14 '22 at 00:44
  • This is not a definitive test. If you have configured serial then GPIO15 would be set as RxD i.e. INPUT. I am unsure if raspi-gpio would override this. To test you would need to disable serial. – Milliways Nov 14 '22 at 01:13
  • DO NOT put details in Comments. Edit your Question. raspi-gpio is a far more reliable indicator of pin state than GPIO readall – Milliways Nov 14 '22 at 01:24