piface / pifacecommon

Common functions for interacting with PiFace products
GNU General Public License v3.0
42 stars 30 forks source link

Please release new pifacecommon version 4.2.2 to get the fix for SPI speed setting #27

Closed psytester closed 5 years ago

psytester commented 5 years ago

Please release a new pifacecommon v4.2.2, because we already know the facts, but there is no fix as official package. Due to kernel change to have much higher SPI clock speed at 125Mhz (raspberrypi/linux/issues/2165) the PiFace2 Chip MCP23S17 is not longer working. There where two commits in past. The first one d4c5689 from 11 Nov 2017 with PR #22 / #23 with hard coded setting in pifacecommon/spi.py by adding the line speed_hz=ctypes.c_uint32(100000) to the transfer struct:

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

But the related version.py was updated by #23 from outdated 4.2.0 6098a59 to already existing 4.2.1.

The second commit 25dcca1 from 16 Sep 2018 with PR #26 is passing a clock speed value from the caller,

        # 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(self.speed_hz)
)

which is more flexible and the version.py was finally updated to 4.2.2 with commit 7c6a2b3.

At the end this kind of fix is getting work again the PiFace2. But due to missing pifacecommon v4.2.2 release an apt-get upgrade does not find this correction and a lot of people are dissatisfied. I hit the issue and "simple" fix in past due to internet reserch where I was pointed to piface/pifacecad/issues/24, but pifacecad is not the faulty part here

tompreston commented 5 years ago

Hi, I'm not in touch with the Raspbian maintainers any more. Please try getting in touch with them if you'd like to take on Raspbian maintainership for this package.

These days I prefer distributing Python packages via PyPI anyway, which contains the latest version of pifacecommon:

Please try using pip to install PiFace software instead. I will update the install instructions.

csoutreach commented 5 years ago

There may be another route with the maintainers, will follow that up.

tmortagne commented 5 years ago

An important problem IMO is that http://www.piface.org.uk/guides/Install_PiFace_Software/Installing_PiFace_Digital_modules/ still reference apt.