element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum is PiFace Control and Display 2 compatible with Pi3?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 3 replies
  • Subscribers 665 subscribers
  • Views 669 views
  • Users 0 members are here
  • piface_2
  • raspberry_pi
Related

is PiFace Control and Display 2 compatible with Pi3?

joppep
joppep over 7 years ago

My basic question is if PiFace 2 is compatible with Pi3?

When I try to access it via the "pifacecad" module I end up with an error that the board is not detected

 

"pifacecad.core.NoPiFaceCADDetectedError: No PiFace Control and Display board detected (hardware_addr=0, bus=0, chip_select=1)."

 

I have double checked that the SPI module is loaded (both /dev/spidev0.1, /dev/spidev0.1)  are available and accessible.

Does anyone have any ide on how to troubleshoot this? Could it be that the my PiFace2 is dead?

  • Sign in to reply
  • Cancel
Parents
  • gam3t3ch
    0 gam3t3ch over 7 years ago

      Have you tried editing /usr/lib/python3/dist-packages/pifacecommon/spi.py

     

    Check the frequency if its 125000000 change it to the one below. look like after kernel 4.9.43 it happens and changes it to 125000000 as default which it cant support.  here is some reading on it https://github.com/raspberrypi/linux/issues/2165

     

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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Reply
  • gam3t3ch
    0 gam3t3ch over 7 years ago

      Have you tried editing /usr/lib/python3/dist-packages/pifacecommon/spi.py

     

    Check the frequency if its 125000000 change it to the one below. look like after kernel 4.9.43 it happens and changes it to 125000000 as default which it cant support.  here is some reading on it https://github.com/raspberrypi/linux/issues/2165

     

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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Children
  • joppep
    0 joppep over 7 years ago in reply to gam3t3ch

    Thanks! That got me on the right direction to fix this problem.

    Since I have installed the support modules locally I needed to modify

     

    /usr/local/lib/python3.5/dist-packages/pifacecommon/spi.py

     

    (and the corresponding python2 libraries)

     

    to override the default frequency by changing the transfer setting from

     

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

    to

     

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


    Then all my previous packages works perfect with the new kernel 4.9.59-v7+

    Strange that this isn't an FAQ.

     

    Thanks again!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • danny@west-industries.com
    0 danny@west-industries.com over 7 years ago in reply to joppep

    just a newbie here,

    ~almost there...editied and saved the spi.py as suggested, however,

    I'm getting a syntax error on the edit addin for : speed_hz=ctypes.c_uint32(100000)

     

    after I run my leds test:

     

    Traceback (most recent call last):

      File "leds.py", line 1, in <module>

        import pifacedigitalio

      File "/usr/local/lib/python3.5/dist-packages/pifacedigitalio/__init__.py", line 18, in <module>

        from pifacecommon.interrupts import (

      File "/usr/local/lib/python3.5/dist-packages/pifacecommon/interrupts.py", line 7, in <module>

        import pifacecommon.mcp23s17

      File "/usr/local/lib/python3.5/dist-packages/pifacecommon/mcp23s17.py", line 7, in <module>

        from .spi import SPIDevice

      File "/usr/local/lib/python3.5/dist-packages/pifacecommon/spi.py", line 69

        speed_hz=ctypes.c_uint32(100000)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube