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

Piface2 board not detected (Rpi3 B) #24

Closed
jmbillings opened this issue Dec 5, 2017 · 8 comments

Comments

@jmbillings
Copy link

commented Dec 5, 2017

Noob at this, but it looks like I'm missing a trick to get the board working.
I've got a Piface 2 and a Pi 3 B.

Started following the instructions, SPI enabled, rebooted, updates done. The Pi is set up fresh with the latest (scratch?) install.

The install commands didn't work (not found). I found alternative install instructions using PIP which did work:

pip install pifacedigitalio
pip install pifacecommon
 
for 3(.5)
pip3 install pifacedigitalio
pip3 install pifacecommon

So now I load up Python (or Python3, same problem) and try:

>>> import pifacedigitalio as pfd
>>> pfd.init()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/.local/lib/python3.5/site-packages/pifacedigitalio/core.py", line 166, in init
    raise failed_boards[0]
  File "/home/pi/.local/lib/python3.5/site-packages/pifacedigitalio/core.py", line 162, in init
    init_board)
  File "/home/pi/.local/lib/python3.5/site-packages/pifacedigitalio/core.py", line 82, in __init__
    self.init_board()
  File "/home/pi/.local/lib/python3.5/site-packages/pifacedigitalio/core.py", line 107, in init_board
    h=self.hardware_addr, b=self.bus, c=self.chip_select))
pifacedigitalio.core.NoPiFaceDigitalDetectedError: No PiFace Digital board detected (hardware_addr=0, bus=0, chip_select=0).

Any ideas? I've seen some people suggest reverting back to an older "jessie" build, but other topics suggest people made it work. I also saw reference to commenting out a line in a "blacklist" file, however mine is empty.

@jmbillings

This comment has been minimized.

Copy link
Author

commented Dec 5, 2017

Incidentally, this: https://github.com/bulletmark/pifaceio does work- I can perform a 'write' and hear the relay click and an LED illuminates, so I guess the board is physically okay.

@matthub

This comment has been minimized.

Copy link

commented Jan 6, 2018

For me the hint from joppep at https://www.raspberrypi.org/forums/viewtopic.php?t=170606 solved the issue, copying here for reference:

Within spi.py (at my system it was at /usr/local/lib/python3.5/dist-packages/pifacecommon/spi.py) add a line speed_hz=ctypes.c_uint32(100000) to the transfer struct so that it looks as following

 # create the spi transfer struct
        transfer = spi_ioc_transfer(
            tx_buf=ctypes.addressof(wbuffer),
            rx_buf=ctypes.addressof(rbuffer),
            len=ctypes.sizeof(wbuffer),
            speed_hz=ctypes.c_uint32(100000) 
        )
@johnfrancisgit

This comment has been minimized.

Copy link

commented Jan 18, 2018

@matthub Thanks! I'm using the pifacerelayplus board and it wasn't being detected. Using your fix it works!

@feanor12

This comment has been minimized.

Copy link

commented Mar 7, 2018

Is this fixed?

@jmbillings

This comment has been minimized.

Copy link
Author

commented Mar 7, 2018

Board appears working now, so yep, happy to close this.

@jmbillings jmbillings closed this Mar 7, 2018

@jwarnier

This comment has been minimized.

Copy link

commented Apr 17, 2018

I got the same issue on a Pi 1 model B+, and the suggested fix does not work.

I guess it probably has a different max speed?
I tried (pure guess) already the following values, without success: 100000, 1000000, 150000, 15000
How do I know the actual value to use?

Thanks

@oh4va

This comment has been minimized.

Copy link

commented Jul 17, 2018

I got a LED blinking on a Pi1 B using next commands:
git clone git@github.com:piface/pifacedigitalio.git
git clone https://github.com/piface/pifacecommon.git
cd pifacecommon/
sudo python setup.py install
cd ../pifacedigitalio/examples/
sudo python blink.py

I hope this helps

@jwarnier

This comment has been minimized.

Copy link

commented Nov 13, 2018

Any chance this issue is fixed thanks to #23 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.