4

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. :(

1
6

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
4
  • Is it installable with apt-get? Shouldn't the image include the updated version? Sep 10 '19 at 16:21
  • You tell me. Which version do you get with apt-get? Is it version 2.52?
    – joan
    Sep 10 '19 at 16:23
  • Well, I tried your solution and it has worked perfectly. Thanks! I cannot remember which version I got with apt-get. Sep 10 '19 at 16:26
  • ´apt-get´ gets version 2.50, which doesn't seem to work on the 4B. With the 2.52, the problem is solved, though.
    – PMF
    Oct 4 '19 at 20:10
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

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.