6

It's already a while since I got my Pi 4, but never used the gpio readall command until yesterday. I have run into an interesting error.

pi@raspberrypi:~ $ gpio readall
Oops - unable to determine board type... model: 17

Was the gpio command already updated to support the new RPi 4, or is my Pi broken? I could read all the pin states and set the pin states from within Python. Is there an alternative to reading the pin states with gpio readall?

Thanks in advance.

EDIT

I have tried flashing new Raspbian image. Still no luck. :(

Jakub Bláha
  • 163
  • 1
  • 1
  • 5
  • 2
    You need to upgrade to the last ever version of WiringPi. http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/ see http://wiringpi.com/wiringpi-deprecated/ for support information. – Dougie Sep 10 '19 at 22:26

3 Answers3

7

As far as I am aware it should work provided you download and install the latest version of wiringPi.

http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/

cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb
joan
  • 67,803
  • 5
  • 67
  • 102
1

Now that wiringpi is deprecated (and requires a download from the author's site to work on the Pi4) the future of the gpio readall command is unknown.

I wrote a replacement (which uses pigpiod) - which has the advantage of displaying the ACTUAL programmed GPIO function if changed and can be used remotely (like other pigpiod programs). This is simplified, and does not display the confusing wiringpi pin numbers.

If pigpiod is not running run sudo pigpiod

gpioread by default displays power pins in colour.

To restore non-coloured output uncomment the 2 lines # non-coloured output and comment out # coloured output.

Code can be downloaded from https://github.com/Milliways2/gpioread

gpioread screen shot

Milliways
  • 54,718
  • 26
  • 92
  • 182
0

I have been playing recently with the gpiochip interface (included in recent kernels) and realised that the raspi-gpio debug tool actually has all the details needed.

raspi-gpio should be included in all recent Raspberry Pi OS, but if not you can install raspi-gpio from the repository

This version of my program (which I call gpioreadall) reformats the output of raspi-gpio into a user-friendly format similar to the WiringPi gpio readall.

This produces output identical to gpioread but is independent of any other libraries/daemons. enter image description here The code can be downloaded from GPIOreadall

Milliways
  • 54,718
  • 26
  • 92
  • 182