Issue with GPIO Access on Raspberry Pi 5 Using Processing 4

Hello everyone,

I’ve been encountering an issue with GPIO programming on the Raspberry Pi 5 using Processing 4. I’m getting an error when running code related to GPIO operations, stating “Invalid argument” and “GPIO pin 17 does not seem to be available on your platform” (as shown in the attached image). It seems there have been changes to the GPIO memory mapping on the Raspberry Pi 5, which might be causing compatibility issues with libraries like RPi.GPIO.

I’m using the latest version of Processing 4 and have set up the GPIO in the following manner:

import processing.io.*;
int ledPin = 17;
boolean state = true;

void setup() {
    size(100, 100);
    frameRate(2); //set frame rate
    GPIO.pinMode(ledPin, GPIO.OUTPUT); //set the ledPin to output mode
}

void draw() {
    state = !state;
    if (state==true) {
        GPIO.digitalWrite(ledPin, GPIO.LOW); //led on
        fill(255, 0, 0); //set the fill color of led on
    } else {
        GPIO.digitalWrite(ledPin, GPIO.HIGH); //led off
        fill(155); //set the fill color of led off
    }
    ellipse(width/2, height/2, width*0.75, height*0.75);
}

I have double-checked my GPIO connections on the Raspberry Pi and there are no physical connection issues. My suspicion is that it might be related to the introduction of the new southbridge chip, RP1, on the Raspberry Pi 5, which now handles the GPIOs and may have altered the access protocol.

I’m wondering if anyone else has encountered similar issues and if there are any known fixes or if I need to update my code to accommodate the hardware changes in Raspberry Pi 5. Any guidance or advice would be greatly appreciated.

image

Thank you for your help!