processing/processing4

Unable to interact with the GPIO of Raspberry Pi 5

Open

#807 建立於 2023年11月30日

在 GitHub 查看
 (8 留言) (0 反應) (0 負責人)Java (176 fork)auto 404
has attachmenthelp wantedraspberry pi

倉庫指標

Star
 (439 star)
PR 合併指標
 (PR 指標待抓取)

描述

Created by: eMUQI

Description

Unable to interact with the GPIO of Raspberry Pi 5

Expected Behavior

Draw a dot on Processing, which blinks synchronously with the LED. 图片

Current Behavior

error

/sys/class/gpio/export:Invalid argument
GPIO pin 17 does not seem to be available on your platform
RuntimeException: /sys/class/gpio/export: Invalid argument
RuntimeException: /sys/class/gpio/export: Invalid argument

Steps to Reproduce

  1. Install Hardware I/O io

  2. Run the code

    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);
    }
    
  3. error

Your Environment

  • Processing version:
    • 4.3
  • Operating System and OS version:
    • OS: Debian GNU/Linux 12 (bookworm) aarch64
    • Kernel: 6.1.0-rpi6-rpi-2712
  • Other information:
    • Raspberry Pi 5 Model B Rev 1.0
    • CPU: BCM2835 (4) @ 2.400GHz

Possible Causes / Solutions

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.

Other

Also report at https://discourse.processing.org/t/issue-with-gpio-access-on-raspberry-pi-5-using-processing-4/43337

貢獻者指南