User avatar
leon_heller
Posts: 89
Joined: Wed May 02, 2012 4:10 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.

RPi 2 and the PiFace Digital 2 [solved]

Thu Feb 05, 2015 1:28 pm

Has anyone been able to get the PiFace Digital 2 to work with the RPI 2? The software seems to install OK and the emulator icon is created, but when I double click on it it seems to load but then nothing happens. I just get error messages when I try to access the PiFace directly from Python 3.

Someone on another forum has suggested that it is because the base address of the internal registers has been changed in the RPi 2.
Last edited by leon_heller on Sun Feb 08, 2015 10:58 am, edited 1 time in total.
Leon Heller
G1HSM

User avatar
DougieLawson
Posts: 37096
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi 2 and the PiFace Digital 2

Thu Feb 05, 2015 4:12 pm

Are you driving it with python or with the C/C++ library?

There's a bug in the C/C++ library which stops it working with the new 3.18.5-v7+ kernel.
https://github.com/piface/libmcp23s17/issues/8

I don't know if that same bug is in the python stuff.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
leon_heller
Posts: 89
Joined: Wed May 02, 2012 4:10 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.

Re: RPi 2 and the PiFace Digital 2

Thu Feb 05, 2015 4:17 pm

All the PiFace stuff is in Python.
Leon Heller
G1HSM

User avatar
DougieLawson
Posts: 37096
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: RPi 2 and the PiFace Digital 2

Thu Feb 05, 2015 5:59 pm

leon_heller wrote:All the PiFace stuff is in Python.
I can't take a look right now, my RPiB with the PifaceCAD on it is running an experiment.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

dahl
Posts: 6
Joined: Fri Sep 27, 2013 6:32 am
Location: Lund, Sweden

Re: RPi 2 and the PiFace Digital 2

Thu Feb 05, 2015 8:20 pm

Im also having trouble with my piface and RPi2.

Using it to control a 6 LED-board to display status on door/windows.

I get "IOError: [Errno 2] No such file or directory: '/sys/devices/virtual/gpio/gpio25/value'"

Used my SD-card from my old RPiB+.

DirkS
Posts: 10130
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: RPi 2 and the PiFace Digital 2

Thu Feb 05, 2015 8:26 pm

dahl wrote:Im also having trouble with my piface and RPi2.

Using it to control a 6 LED-board to display status on door/windows.

I get "IOError: [Errno 2] No such file or directory: '/sys/devices/virtual/gpio/gpio25/value'"

Used my SD-card from my old RPiB+.
Did you update / dist-upgrade the card before plugging it into the Pi2?

dahl
Posts: 6
Joined: Fri Sep 27, 2013 6:32 am
Location: Lund, Sweden

Re: RPi 2 and the PiFace Digital 2

Thu Feb 05, 2015 8:28 pm

Got it working! :D

Run "sudo rpi-update"
And change the path to GPIO as follows:

sudo nano /usr/lib/python3/dist-packages/pifacecommon/interrupts.py

Look after the line:
GPIO_INTERRUPT_DEVICE = "/sys/devices/virtual/gpio/gpio%d" % GPIO_INTERRUPT_PIN
change it to:
GPIO_INTERRUPT_DEVICE = "/sys/class/gpio/gpio%d" % GPIO_INTERRUPT_PIN

My python scripts to control a LED-board for my home alarm works like before.

User avatar
leon_heller
Posts: 89
Joined: Wed May 02, 2012 4:10 pm
Location: St. Leonards-on-Sea, E. Sussex, UK.

Re: RPi 2 and the PiFace Digital 2

Sun Feb 08, 2015 10:55 am

Thanks very much! That got the emulator working, but I had to make the address 0.
Leon Heller
G1HSM

sass
Posts: 1
Joined: Mon Feb 09, 2015 7:48 pm
Location: Tallinn, Estonia

Re: RPi 2 and the PiFace Digital 2 [solved]

Mon Feb 09, 2015 7:51 pm

@Dahl

Ty, this also fixed my pifacedigital-emulator not working with Pi B+.

prdatur
Posts: 1
Joined: Wed Feb 11, 2015 9:12 pm

Re: RPi 2 and the PiFace Digital 2 [solved]

Wed Feb 11, 2015 9:15 pm

I have just created my account here to only thank you for that solution :)
I thought my piface is broken or the driver is completely killed. But yes i should came to this solution by my self but I always thought "virtual" meant a virtual gpio on the piface board :).
So thank you very much to not let me ship the piface back :)

framboosejh
Posts: 17
Joined: Tue Mar 11, 2014 3:13 pm

Re: RPi 2 and the PiFace Digital 2 [solved]

Thu Feb 12, 2015 4:48 pm

I did have the same problem with pifacedigital v2.
Looking on the web i found a lot about de devicetree in the new kernel 3.18 and even switched spi on with dtparam=spi=on in config.txt, but that didn't work. I stil got the same error when i was starting pifacedigital-emulator. It worked only if I put the devicetree of. In the end (after 2 days) I found this forum and the post from 'dahl' where he explains how to change interrupts.py from piface. I did that and it worked. :D

Apparently changed the location of the GPIO pins in sys from devices to class.

I think that it would good I there came more information about the device tree from the foundation.
I have also a beagle bone black :oops: and it uses heavely the device tree and device tree overlays. The documentation over device trees is much better there.

dahl
Posts: 6
Joined: Fri Sep 27, 2013 6:32 am
Location: Lund, Sweden

Re: RPi 2 and the PiFace Digital 2 [solved]

Thu Feb 12, 2015 7:01 pm

Glad that it help so many :D . Hope we get an update on pifacecommon that fix this permanent.

bulletmark
Posts: 121
Joined: Wed Oct 17, 2012 10:10 pm
Location: Brisbane Australia

Re: RPi 2 and the PiFace Digital 2 [solved]

Thu Feb 12, 2015 10:50 pm

dahl wrote:Hope we get an update on pifacecommon that fix this permanent.
It was fixed there a few days ago -
https://github.com/piface/pifacecommon/ ... b3f4bfa9b3

User avatar
emgi
Posts: 357
Joined: Thu Nov 07, 2013 4:08 pm
Location: NL

Re: RPi 2 and the PiFace Digital 2

Sat Feb 14, 2015 10:14 pm

DougieLawson wrote:Are you driving it with python or with the C/C++ library?

There's a bug in the C/C++ library which stops it working with the new 3.18.5-v7+ kernel.
https://github.com/piface/libmcp23s17/issues/8

I don't know if that same bug is in the python stuff.
Got it working with python after a lot of searching. My god, I did not realize this software was soo broken :!:
Perhaps they think the satisfaction is bigger when it takes you an evening to get a LED to blink. :evil:

Edit: Actually I wanted to use the C-library but I stumbled over the bug mentioned by Dougie. Due to this issue, the code doesn't even compile. :|

/emgi

chrischi
Posts: 12
Joined: Thu Nov 16, 2017 2:07 pm

Re: RPi 2 and the PiFace Digital 2 [solved]

Thu Nov 16, 2017 2:26 pm

Hello, from a beginner :( and hopfully in the right forum......
far away from my Hardware Pi B 2.0 and piface, the piface is not working anymore.
have don a lot, all I got on the forum, but dosn't work.
have still conection with putty. the answer is
python3 /usr/share/doc/python3-pifacedigitalio/examples/simplew ebcontrol.py
Traceback (most recent call last):
File "/usr/share/doc/python3-pifacedigitalio/examples/simplewebcontrol.py", line 26, in <module>
import pifacedigitalio
File "/usr/lib/python3/dist-packages/pifacedigitalio/__init__.py", line 18, in < module>
from pifacecommon.interrupts import (
File "/usr/local/lib/python3.4/dist-packages/pifacecommon/interrupts.py", line 6 , in <module>
import pifacecommon.mcp23s17
File "/usr/local/lib/python3.4/dist-packages/pifacecommon/mcp23s17.py", line 7, in <module>
from .spi import SPIDevice
File "/usr/local/lib/python3.4/dist-packages/pifacecommon/spi.py", line 1
sudo nano import posix
can anybody help me please?
chrischi

Return to “HATs and other add-ons”