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,852
  • 5
  • 76
  • 108
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
  • 62,573
  • 32
  • 113
  • 225