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

GPIO access in AstroArch and Raspberry Pi 5 #41

Open
astrojolo opened this issue Dec 19, 2023 · 4 comments
Open

GPIO access in AstroArch and Raspberry Pi 5 #41

astrojolo opened this issue Dec 19, 2023 · 4 comments

Comments

@astrojolo
Copy link

astrojolo commented Dec 19, 2023

Hello,

Is there any special access I need to have for GPIO chip in Raspberry Pi 5?
I have installed https://abyz.me.uk/lg/lgpio.html library that works fine for me on RPi 5 and Debian based distributions. But I cannot make it connect to GPIO under AstroArch.

Steps I made:

  1. fresh SD card flash
  2. update-astroarch done
  3. installation unzip, make, python and python3
  4. installation lgpio from sources

After that, I ran rgpdiod daemon (started ok) and tried to connect to the GPIO chip with

rgs c 1 go

with chipnr set from 0 to 5, and it always return -78 which means LG_CANNOT_OPEN_CHIP.

Many thanks in advance for any hints!

Lucas

@astrojolo
Copy link
Author

Ok, the issue was a permissions to GPIO.
I have added a gpio group, added astronaut user to that group and added gpio subsystem to that group as well using udev and it works now.

cat /etc/udev/rules.d/99-gpio.rules
SUBSYSTEM=="gpio", KERNEL=="gpiochip*", GROUP:="gpio", MODE:="0660"

@MattBlack85
Copy link
Collaborator

@astrojolo thanks 🔥 will leave this around for troubleshooting

PS: I packaged astrolink4pi for Arch, I don't have your hardware yet but could you tell me if installing it with pacman leads to a working setup for your board?

Pozdro

@astrojolo
Copy link
Author

astrojolo commented Dec 19, 2023

I have added a section of additional tasks to make my hardware work with AstroArch:
https://github.com/astrojolo/astrolink4pi?tab=readme-ov-file#astroarch-only-specific-tasks

It now works with revision 4 of hardware, however for revision 3 I need to use an SPI device, and at the moment, I cannot communicate with it even after creating a proper udev entry. I need to investigate it.

PS - thanks for the package, however I did several changes over the last few days to make my driver work with RPi5. Once I will make SPI work and have a final version I will ask you again to package it.
I think you may remove the current package - sorry for that.

@astrojolo
Copy link
Author

Ok, all works fine. I needed to enable SPI in /boot/config.txt:
dtparam=spi=on
All required steps are listed on https://github.com/astrojolo/astrolink4pi?tab=readme-ov-file#astroarch-only-specific-tasks

Thanks and congratulations on this distribution!

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

No branches or pull requests

2 participants