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

Update Rockchip rk3308 to use libgpiod #799

Merged
merged 1 commit into from Mar 21, 2024

Conversation

makermelissa
Copy link
Contributor

@makermelissa makermelissa commented Mar 20, 2024

Fixes #795. Updates the Rockchip from using SysFs to libgpiod. Tested on Armbian.

To get this to work, the following needs to be done:
Setup a venv and activate:

sudo apt install python3-venv
python3 -m venv env --system-site-packages
source env/bin/activate

Then to give the user permissions without needing root access:

sudo groupadd gpiod
sudo usermod -G gpiod $USER
sudo nano /etc/udev/rules.d/60-gpiod.rules

Add the following to the file:

# udev rules for gpio port access through libgpiod
SUBSYSTEM=="gpio", KERNEL=="gpiochip0", GROUP="gpiod", MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip1", GROUP="gpiod", MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip2", GROUP="gpiod", MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip3", GROUP="gpiod", MODE="0660"
SUBSYSTEM=="gpio", KERNEL=="gpiochip4", GROUP="gpiod", MODE="0660"

Reboot, reactivate the venv, then run python. import board should now work.

@makermelissa makermelissa requested a review from a team March 20, 2024 18:59
@makermelissa makermelissa marked this pull request as draft March 20, 2024 19:22
@makermelissa makermelissa marked this pull request as ready for review March 20, 2024 20:13
@makermelissa makermelissa merged commit 1d50cdb into adafruit:main Mar 21, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

GPIO Access Support for linux (kernel > 4.7)
2 participants