Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WiringPi error RaspberryPi 4 #199

Open
gervann opened this issue Feb 17, 2024 · 3 comments
Open

WiringPi error RaspberryPi 4 #199

gervann opened this issue Feb 17, 2024 · 3 comments

Comments

@gervann
Copy link

gervann commented Feb 17, 2024

So I ran into a problem when setting up two new rpi 4b’s.
After installing bookworm (first trying 64bit and then 32bit) and installing WiringPi, the following error pops up after running gpio -v:

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.

It affects the Ouput setting and gives an error, eventually leading to an unresponsive SprinklerPi.

When installing a legacy os, like Bullseye, everything works (have working SprinklerPi’s on rpi 3b’s)

Any advice would be appreciated so much

-g

@nhorvath
Copy link
Collaborator

nhorvath commented Feb 17, 2024 via email

@gervann
Copy link
Author

gervann commented Feb 18, 2024

This looks like wiringpi not understanding your hardware. SprinklerPi requires wiringpi for output control so you will need to get that working before it will work.

On Sat, Feb 17, 2024 at 11:50 AM gervann @.> wrote: So I ran into a problem when setting up two new rpi 4b’s. After installing bookworm (first trying 64bit and then 32bit) and installing WiringPi, the following error pops up after running gpio -v: 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. It affects the Ouput setting and gives an error, eventually leading to an unresponsive SprinklerPi. When installing a legacy os, like Bullseye, everything works (have working SprinklerPi’s on rpi 3b’s) Any advice would be appreciated so much -g — Reply to this email directly, view it on GitHub <#199>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABIJXE4ILVJYQ3KERD5OULYUDNWRAVCNFSM6AAAAABDNN6JJGVHI2DSMVQWIX3LMV43ASLTON2WKOZSGE2DAMRZG4YDAOI . You are receiving this because you are subscribed to this thread.Message ID: @.>

Thank you.

Yes I figured that much. Forums are littered with people calling for a move away from wiringPi as it was deprecated a while ago. There are forks of it from enthusiasts who want to keep it alive, but I think new development and upgrades have stopped when Gordon shelved it.

This is where I am stuck and want to know if anybody else came across this?
I am a bit noobish with the code and need to focus my time elsewhere at the moment.
It leaves me with a dilemma as I need to commission two sprinkler systems this week.

Any insight or help will be greatly appreciated.

-g

@gervann
Copy link
Author

gervann commented Feb 20, 2024

So problem solved.

There is a brilliant guy on stackexchange who gave the solution a few days ago.
The link to the post describes a work-around in the WiringPi source. By editing wiringpi.c with moving a line of code up by about 24 lines solved it.
It looks like this:
at line 782 (originally): #ifdef DONT_CARE_ANYMORE must be moved to just below line 758:
if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
piGpioLayoutOops ("Unable to open /proc/cpuinfo") ;

to look like:
if ((cpuFd = fopen ("/proc/cpuinfo", "r")) == NULL)
piGpioLayoutOops ("Unable to open /proc/cpuinfo") ; #ifdef DONT_CARE_ANYMORE

Build it and run gpio -v to check if the error pops up again.
Just a note: remove all previous wiringPi installations before commencing with this work-around.

Here is an ouput of gpio -v on one of the current RPi 4's:
gpio version: 2.70
Copyright (c) 2012-2018 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
Type: Pi 4B, Revision: 01, Memory: 4096MB, Maker: Sony
* Device tree is enabled.
*--> Raspberry Pi 4 Model B Rev 1.1
* This Raspberry Pi supports user-level GPIO access.

I hope this will guide and help someone in the future.
Kudus to user160491 for the solution/work-around!

ps. I used master fork @ https://github.com/WiringPi/WiringPi/tree/master/wiringPi.

-g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants