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

No PiFace Control and Display board detected (hardware_addr=0, bus=0, chip_select=1) since kernel 4.9.51 #24

Open
DanielChesters opened this issue Oct 1, 2017 · 5 comments

Comments

@DanielChesters
Copy link

Hi,
I did a rpi-update this week (and I get the kernel 4.9.51) on Raspbian GNU/Linux 9 and the Piface Control and Display does not work anymore :

pi@raspberrypi:~ $ python /usr/share/doc/python-pifacecad/examples/sysinfo.py 
Traceback (most recent call last):
  File "/usr/share/doc/python-pifacecad/examples/sysinfo.py", line 61, in <module>
    cad = pifacecad.PiFaceCAD()
  File "/usr/lib/python2.7/dist-packages/pifacecad/core.py", line 50, in __init__
    self.init_board()
  File "/usr/lib/python2.7/dist-packages/pifacecad/core.py", line 80, in init_board
    h=self.hardware_addr, b=self.bus, c=self.chip_select))
pifacecad.core.NoPiFaceCADDetectedError: No PiFace Control and Display board detected (hardware_addr=0, bus=0, chip_select=1).
@DanielChesters
Copy link
Author

The problem still here with kernel 4.9.56.

@jlikeme
Copy link

jlikeme commented Oct 31, 2017

The spi-max-frequency has changed to 125000000 after kernel 4.9.43. But pifacecad can't support the default frequency. You can read this raspberrypi/linux#2165.
In addition, we can modify /usr/lib/python3/dist-packages/pifacecommon/spi.py like this.

    # 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)
    )

@DanielChesters
Copy link
Author

Thank for the solution, I use this fix so now I can use my PiFace Control and Display board. I will do a pull request for piface/pifacecommon.

@keigezellig
Copy link

keigezellig commented Aug 5, 2018

Sorry to open this issue again but in the piface package which i installed from Raspbian Stretch (2018-06-27-raspbian-stretch-lite) this issue is still not resolved.
Actually when i look at /usr/lib/python3/dist-packages/pifacecommon/spi.py i see:

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

so without above mentioned speed_hz line. When i add this line the piface cad works as expected.

@SailingGreg
Copy link

Just hit this issue on upgrading to Stretch and although I did a clean install of the code per the readme, speed_hz was missing from spi.py and needed to be added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants