Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Fix Raspberry Pi 2, Pi3 support #82

Open
wants to merge 2 commits into
base: v2
Choose a base branch
from
Open

Fix Raspberry Pi 2, Pi3 support #82

wants to merge 2 commits into from

Conversation

Yackou
Copy link

@Yackou Yackou commented Jun 23, 2016

  • Fix Raspberry Pi model detection
  • Add model detection in GPIO module
  • Try to fix mailbox char device detection on various kernels
  • Fix compiler warnings

Tested on a Raspberry Pi 2, with both GPIO and PWM modules, on a 3.18.7 kernel.

@Yackou
Copy link
Author

Yackou commented Jun 23, 2016

inspired from:

@dalanmiller
Copy link

Since this hasn't been merged yet, @Yackou would you mind adding Raspberry Pi 3?

@Yackou
Copy link
Author

Yackou commented Aug 3, 2016

I'll try to have a look, but not before at least 2 weeks (currently away
from home), and I won't be able to test it myself since I only have a Pi2.

Le 3 août 2016 12:25 AM, "Daniel Alan Miller" [email protected] a
écrit :

Since this hasn't been merged yet, @Yackou https://github.com/Yackou
would you mind adding Raspberry Pi 3?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#82 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AG9pNyxgG_hUyvv_RztR3dXJ8fwlJypRks5qb8O8gaJpZM4I9T3E
.

. Fix Raspberry Pi model detection
. Add model detection in GPIO module
. Try to fix mailbox char device detection on various kernels
. Fix compiler warnings
@Yackou
Copy link
Author

Yackou commented Aug 17, 2016

I have updated the pull request with support for Raspberry Pi3 (based on limuxy/master) but I don't have one to test.
@dalanmiller could you test whether this works for you?

@Yackou Yackou changed the title Fix Raspberry Pi 2 support Fix Raspberry Pi 2, Pi3 support Aug 17, 2016
@yhaenggi
Copy link

Could you test the PWM too?

@ac3d912
Copy link

ac3d912 commented Aug 20, 2016

EDIT: So, I had the wrong commit checked out. I can import it, but I certainly have a different Revision.

Also, cpuinfo.c:77 - unnecessary elseif stmt

So, I tested it on my RPi 3... You should add 'a22082' also. The difference between a22082 and a02082 appears to just be the manufacturer.

RPIO.version()
('2.0.0-beta1', '2.0.0-beta1/0.4.2a')
RPIO.sysinfo()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/site-packages/RPIO-2.0.0b1-py3.5-linux-armv7l.egg/RPIO/init.py", line 189, in sysinfo
return (RPI_REVISION_HEX,) + MODEL_DATA[RPI_REVISION_HEX.lstrip("0")]
KeyError: 'a22082'

cat /proc/cpuinfo
...
Hardware : BCM2709
Revision : a22082

@doom-fr
Copy link

doom-fr commented Aug 24, 2016

Thanks for this fork.
I have tried it. I have made some changes to make it works
(first of all adding my board ( Hardware : BCM2709 and Revision : a02082))
It works but sometimes, the raspberry is completely frozen.
Do you think it can came from the RPIO module ?

Thx.

@DEvil0000
Copy link

It could if you use channels used by drivers or the OS. There was a issue somewhere here listing some channels you should not use. But be carefull - the list could be outdated.

. Distinguish board revision from CPU model.
. Consider the board revision to be 3 (latest) by default.
. Use the CPU model (and not the board revision) to determine the GPIO base
address.
. Use the board revision to determine which pin/gpio mappings to use.
. Fix the pin to gpio mapping definition for revision 3 boards.
. Add all known models (according to http://elinux.org/RPi_HardwareHistory)
to the MODEL_DATA (sysinfo) definition.
. Only use the Pi revision (and no longer the sysinfo string) to determine
which GPIO list to use in the Python scripts.
@Yackou
Copy link
Author

Yackou commented Sep 9, 2016

FWIW, I have tried making the board detection a bit more generic and robust based on the comments in this thread.
The last update still works fine on my Pi2, feel free to test on your boards as well.

@doom-fr : freezes often come from power supply issues (at least based on my experience, as I greatly reduced freezes by using a more powerful supply), and I believe this is even more true on Pi2 and Pi3 boards because of the increased power requirements. Since the purpose of RPIO is to drive GPIOs, it may also make the freezes more or less frequent depending on the load you put on the GPIOs.

@TafThorne
Copy link

I'll try and get this code onto my Raspberry Pi 3 Model B V1.2 and test it. I shall report back in a few hours.

@metachris
Copy link
Owner

Looks good. @TafThorne thanks for checking, I'm interested to hear what you find out!

I'm sorry that I have so little time for RPIO at the moment. If you guys are interested in maintaining RPIO I'll give you write access.

@TafThorne
Copy link

This is the first bit of Python work I have ever done so I am probably not a great candidate for maintaining the repository. I am probably going to spend the next hour working out how to get from source code to the file that ends up at http://pypi.python.org/packages/source/R/RPIO/RPIO-0.10.0.tar.gz so that I can inject that into my Yocto build and run it on my Pi 3 (without going via the server).

@TafThorne
Copy link

Cool. I have followed https://packaging.python.org/tutorials/distributing-packages/ and produced a RPIO-2.0.0b1.tar.gz which looks to contain the same files as are present in the RPIO-0.10.0.tar.gz I mnetioned. Now I just have to bundle that file into my Yocto script instead of the reportedly sourced one and I can test it out on the Pi 3 I have. If anyone has some suggestions of how I could possibly make this more convoluted please let me know.

@metachris
Copy link
Owner

FYI - this is how you can build and test the GPIO and PWM parts on the Pi: https://github.com/metachris/RPIO/blob/master/fabfile.py#L104

To run this automatically on your Pi (which you can access on the network), update fabfile.py with the correct host, then you can execute this command:

$ fab clean upload build test_gpio test3_gpio test_pwm

@DEvil0000
Copy link

DEvil0000 commented Jul 21, 2017 via email

@JamesGKent
Copy link

i've taken @Yackou 's fork and added support for all of the boards listed here, my fork is here, but don't want to issue a pull request until I've tested on all the boards i have (pi 1b v1.1, pi2, pi3 and pi zero w) particularly the pwm.

@metachris
Copy link
Owner

Great, thanks for testing, in particular the pwm.

You could of course already open a pull request and mark it as "work in progress" and add commits as necessary.

@TafThorne
Copy link

Sorry it took me a while to get back. I am happy to report that I have had RPIO v2.0.0-beta-1 working on a Raspberry Pi 3 Model B V1.2. I have tested that I can drive all of the pins high or low on demand. I have not tested the ability to read input on the pins yet. I do not have any other versions of Raspberry Pi to test with.

@DEvil0000
Copy link

DEvil0000 commented Mar 7, 2018

Tested basic functionality. Works for me on PI 3 revision a02082 from @JamesGKent

@DEvil0000 DEvil0000 mentioned this pull request Mar 7, 2018
jgvictores added a commit to asrob-uc3m/yarp-devices that referenced this pull request Apr 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants