adafruit / Adafruit_Blinka

Add CircuitPython hardware API and libraries to MicroPython & CPython devices
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
MIT License
448 stars 335 forks source link

RPi GPIO is not support for Pi 5 any more, why merge pi5 with pi4 under board? #874

Closed cavonlee closed 4 weeks ago

cavonlee commented 1 month ago

Board Name

Raspberry Pi 5

Steps

  1. Install Home assistant
  2. create a custom addon
  3. install adafruit blinka
  4. open python, install board.

Description

It's a wired issue. We are creating a addon for home assistant on Pi 5. And the addon gets error from RPi.GPIO This module can only be run on a Raspberry Pi!

It use to work on 8.39.2. So we look inside the source code. And found differencies from latest 8.46.1. Pi5 now sharing the same board import, and bcm2712 is removed. That's wired, why is that? Is it a bug or a intend?

Additional information

No response

makermelissa commented 1 month ago

RPi.GPIO does not support the Pi 5. A replacement library rpi-lgpio is used as a drop-in replacement for RPi.GPIO, so once that is installed (making sure RPi.GPIO is not installed), it should work fine.

makermelissa commented 1 month ago

For a while, we were using libgpiod (which does not support PWM) for GPIO and rpi-lgpio for PWM. However, something changed the libraries and PWM was no longer working while using libgpiod, so rather than drop PWM support, we moved over to rpi-lgpio for GPIO as well.

makermelissa commented 4 weeks ago

Closing as an explanation was provided.