onoff icon indicating copy to clipboard operation
onoff copied to clipboard

RPI 5 gpio numbers

Open livep2000 opened this issue 1 year ago • 5 comments

Recently I burned out my rpi4, just at the moment my highly complicated radio transceiver reached some point of functionality. Ordered a pi5, to discover its not working. After reading and reading this issues tracker give the fairly simple solution.

Just add 571 to the gpio pin number. Proposing something like this to make it fully compatible:

let file = fs.readFileSync("/proc/cpuinfo", "utf8");
let arr = file.split(/\r?\n/);
arr.forEach((line, idx)=> {
    if(line.includes("Pi 5")){
        console.log(line);
        gpio += 571;
        }
});

Imre

livep2000 avatar Apr 13 '24 12:04 livep2000

I don't think it's Pi5 related but rather the version of Raspbian. On Bullseye it works, on Bookworm it's broken.

SamDecrock avatar May 24 '24 09:05 SamDecrock

I opened a PR to lookup the base address and add that automatically to the address you pass https://github.com/fivdi/onoff/pull/204

nwpray avatar Jun 27 '24 02:06 nwpray