Raspberry Pi3 Hassbian 1.3.1 checking GPIO ports WiringPi

Hi

May be of use to someone but issues with my GPIO ports on hassbian upgrade and the usual pain setting everything up again. This was a useful utility to check all the GPIO pins were working as they should.

Check if you already have WiringPi installed (this will come up with version and so on if its on your Pi)

gpio -v

If it is installed then uninstall it

$ sudo apt-get purge wiringpi
$ hash -r

Then as below to reinstall from git (firstly ensure your up to date and then install git, if not already installed)

$ sudo apt-get update
$ sudo apt-get upgrade

$ sudo apt-get install git-core

To obtain WiringPi:

$ cd
$ git clone git://git.drogon.net/wiringPi

These were if you’ve run clone before but I ran anyway;

$ cd ~/wiringPi
$ git pull origin

$ cd ~/wiringPi
$ ./build

The location of the pintest script wasnt in the location deatiled on the documentation, I used winSCP to search ‘pintest’ my main root directory and found in my case- /home/pi/wiringPi/gpio, navigate here;

cd /home/pi/wiringPi/gpio

Make sure yiuve disconnected all GPIO’s, then run with ./pintest

~/wiringPi/gpio $ ./pintest

The outputs in my case were;

PinTest

=======

This is a simple utility to test the GPIO pins on your Raspberry Pi.

NOTE: All GPIO peripherals must be removed to perform this test. This
includes serial, I2C and SPI connections. You may get incorrect results
if something is connected and it interferes with the test.

This test can only test the input side of things. It uses the internal
pull-up and pull-down resistors to simulate inputs. It does not test
the output drivers.

You will need to reboot your Pi after this test if you wish to use the
serial port as it will be left in GPIO mode rather than serial mode.

This test only tests the original pins present on the Rev A and B. It
does not test the extra pins on the Revision A2, B2 nor the A+ or B+

Please make sure everything is removed and press the ENTER key to continue,
or Control-C to abort…

      The main 8 GPIO pins  0: 7:  OK
            The 5 SPI pins 10:14:  OK
           The serial pins 15:16:  OK
              The I2C pins  8: 9:  OK

All is ok for me on the GPIO’s but my PIR remains inoperable! :neutral_face:Possibly the PIR but I’m coming back to that!

Plenty more on the WiringPi website http://wiringpi.com/the-gpio-utility/

The GPIO utilities were useful to set pins / export info / see status.

1 Like