php-gpio icon indicating copy to clipboard operation
php-gpio copied to clipboard

Support for Raspberry Pi 3

Open winternet-studio opened this issue 8 years ago • 5 comments

For my Raspberry Pi 3 it doesn't detect the right version number in Pi->getVersion(). It returns 0 instead of 4. Therefore I can't use certain pins without it complaining. I would have made a pull request if I could but I don't know how to convert the revision numbers (http://www.raspberrypi-spy.co.uk/2012/09/checking-your-raspberry-pi-board-version/)

winternet-studio avatar Dec 06 '16 10:12 winternet-studio

Hey, I've just tested a couple of things on my Pi and seems to be ok. Can you attach the contents of your /proc/cpuinfo?

calcinai avatar Dec 06 '16 12:12 calcinai

Of course...

processor       : 0
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 1
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 2
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

processor       : 3
model name      : ARMv7 Processor rev 4 (v7l)
BogoMIPS        : 38.40
Features        : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xd03
CPU revision    : 4

Hardware        : BCM2709
Revision        : a22082
Serial          : 0000000028d29c51

winternet-studio avatar Dec 06 '16 16:12 winternet-studio

The Pi 3 by the way also has quite an extra number of GPIO pins: 5, 6, 12, 13, 16, 19, 20, 21, 26 (source: http://raspi.tv/wp-content/uploads/2014/07/Raspberry-Pi-GPIO-pinouts-1024x703.png - even though it says B+ it is the same for version B2 and B3)

winternet-studio avatar Dec 06 '16 16:12 winternet-studio

Bad news for you is, I've tested with that cpu info file and I get 10625154 from ->getVersion(). Meaningless, but it should be working for you.

I'm not the maintainer of this library - I was just going to make the PR for you.

If you get desperate, you could try this library in the meantime.

calcinai avatar Dec 06 '16 16:12 calcinai

Sorry, not time left nor budget to try this so far, Please feel free to share a PR here

ronanguilloux avatar Apr 26 '17 19:04 ronanguilloux