0

I was using wiringPi to to control the GPIO pins on a Raspberry Pi model 3 and 4b (these originally had Buster installed on them) successfully until today when I did a rpi-update to get kernel 6.1.

Now when I issue any commands based on wiringPi (including something simple like "gpio -v", I get this error on the console:

pi [01:23 AM] tmp$gpio -v gpio version: 2.52 Copyright (c) 2012-2018 Gordon Henderson This is free software with ABSOLUTELY NO WARRANTY. For details type: gpio -warranty

Oops: Unable to determine board revision from /proc/cpuinfo -> No "Hardware" line -> You'd best google the error to find out why.

I'd like to keep using wiringPi. Can you suggest how to get around this? By the way, here is the current contents of /proc/cpuinfo

pi [12:54 AM] test3$cat /proc/cpuinfo processor : 0 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

processor : 1 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

processor : 2 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

processor : 3 BogoMIPS : 108.00 Features : fp asimd evtstrm crc32 cpuid CPU implementer : 0x41 CPU architecture: 8 CPU variant : 0x0 CPU part : 0xd08 CPU revision : 3

Revision : b03112 Serial : 100000006864cf37 Model : Raspberry Pi 4 Model B Rev 1.2

I think I am still in 32-bit. Apparently there is no way to edit /proc/cpuinfo since the OS creates it.

Thanks in advance for your help! Any idea how to get it working again? If not, what is the best replacement to read and write IO pins?

Baxter
  • 11
  • 1
  • 2
  • Which language are you using? The official wiringpi is no longer supported. There is an unofficial version. Personally I use Python and the gpiozero library. – CoderMike Nov 20 '23 at 20:46
  • I am doing my main coding in node.js but wrote a c program using wiringPi to handle the GPIO pins for the node script because that used to be a library packaged with the Rpi and there were lots of examples online. See below for what I'm trying now. And Thanks! – Baxter Nov 21 '23 at 01:33

3 Answers3

1
  1. Did you not see a warning when you ran rpi-update? Why did you ignore it? sudo apt update; sudo apt install --reinstall libraspberrypi0 libraspberrypi-{bin,dev,doc} raspberrypi-bootloader raspberrypi-kernel will put it back to the latest supported kernel/bootcode. Which is 6.1.21 for Bullseye 5.10.103 for Buster.

  2. You state "these originally had Buster installed"; this is irrelevant - what you you have now?

  3. The version: 2.52 of wiringPi was deprecated by the author in 2019, but should still work - at least on the Pi models available at the time (although I have not used since Buster).

  4. "what is the best replacement to read and write IO pins" Controlling Raspberry Pi GPIO with c and Python is a review of available libraries I produced.

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • 1
  • Yes, I read the warning. I did not ignore it, I backed up my SD card first. I decided to try it because I was having segmentation faults with mjpeg streamer and couldn't think of anything else to try after reading many posts about it. I can try your great suggestions to go back to a supported kernel.
  • It is Buster except for the new kernel.
  • I can try it again after the downgrade to the kernel, which apparently changes the format / content of /proc/cpuinfo, causing the problem.
  • – Baxter Nov 21 '23 at 01:19
  • 1
  • On the plus side of the whole experience, I found a node.js library called "onoff" that handles the GPIO pins nicely from within node.js so I don't really need to spawn to my c program that uses wiringPi to handle the pins after all.
  • – Baxter Nov 21 '23 at 01:23
  • The kernel update did not help with the mjpeg streamer segmentation fault issue, by the way. It still runs fine for a variable number of minutes and then dies with a segmentation fault. If you have any suggestions on that... please post or send me a link. Otherwise, I'll keep digging or try a native node.js library I just found to see if it can control and serve my camera without crashing. – Baxter Nov 21 '23 at 01:29
  • 1
    Segmentation fault indicates something is attempting to access non existent memory. This is extremely unlikely to be anything to do with kernel or firmware. – Milliways Nov 21 '23 at 01:55
  • your commands to restore the kernel to 5.10.103 worked well and now wiringPI (wiring-pi@2.2.1) is working again on the RPi 4B – Baxter Nov 21 '23 at 08:19