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

Support device detection under aarch64 #688

Closed
Martchus opened this issue Nov 2, 2018 · 8 comments
Closed

Support device detection under aarch64 #688

Martchus opened this issue Nov 2, 2018 · 8 comments
Labels
Projects
Milestone

Comments

@Martchus
Copy link
Contributor

Martchus commented Nov 2, 2018

Under aarch64, /proc/cpuinfo does not contain the revision number leading to the error "unable to locate Pi revision in /proc/cpuinfo".

This is not likely to change. So I suppose it would be the best to add a fallback to /proc/device-tree.

I tested the following C implementation and it seems to work: https://github.com/jgarff/rpi_ws281x/pull/316/files#diff-6ee9c21b70f61e8effb715dd4df0ab53R330

So to solve this issue, one would simply need to port it to Python and use it as fallback before raising the exception linked above.

I'm wondering why this hasn't been implemented yet as it seems to be an easy task. But if you agree to have device detection work under aarch64 in the way I suggested, I would go ahead and create PR.

@bennuttall
Copy link
Member

What distro are you using? Where did you get the image from?

@Martchus
Copy link
Contributor Author

Martchus commented Nov 2, 2018

I am using Arch Linux ARM (aarch64 version) and built the package for the Python library provided by this repository myself. I've been using the following build script: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=python-gpiozero

Actually I've used a slightly adjusted version to get the latest commit available in this repository (in the hope the support has already been added since the last release).

@bennuttall
Copy link
Member

Great. No issue with getting this fixed - but I'm a little busy right now, so if you want to try to patch it yourself, feel free to send a PR.

Martchus added a commit to Martchus/python-gpiozero that referenced this issue Nov 3, 2018
Under aarch64, /proc/cpuinfo does not contain the revision
number. This adds a fallback to /proc/device-tree so the
revision can be detected under 64-bit systems as well.

See gpiozero#688
@bombadil
Copy link

Ping. Any update?

@Martchus
Copy link
Contributor Author

Martchus commented Dec 29, 2018

Not from my side. So the tests are still missing but one can locally apply the first commit from my PR in the mean time.

@bennuttall bennuttall added the bug label Jan 12, 2019
@bennuttall bennuttall added this to the v1.5 milestone Jan 12, 2019
@bennuttall bennuttall added this to v1.5 (definite) in Roadmap Jan 15, 2019
@lurch
Copy link
Contributor

lurch commented Jan 21, 2019

Note that RPi.GPIO and pigpio (two of the pin libraries supported by GpioZero) don't appear to support aarch64 either yet...
https://sourceforge.net/p/raspberry-gpio-python/tickets/161/
joan2937/pigpio#255

@lurch
Copy link
Contributor

lurch commented Jan 23, 2019

Just for reference: Fixed by #689

@bcroston
Copy link

I've fixed RPi.GPIO for aarch64 now (please test and confirm).
You will need to install the development copy using commands along the lines of:
$ sudo apt install mercurial
$ pip3 install --upgrade hg+http://hg.code.sf.net/p/raspberry-gpio-python/code#egg=RPi.GPIO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Roadmap
v1.5 (definite)
Development

No branches or pull requests

6 participants