element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 PiFace connection
  • 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
  • Replies 14 replies
  • Subscribers 664 subscribers
  • Views 1875 views
  • Users 0 members are here
  • piface control display
  • connection
  • raspberrypi3
Related

PiFace connection

cclegends
cclegends over 6 years ago

Hi E14 community, I just received my PiFace Control and Display. After I connect them to the GPIO pins and nothing appears / pops up. I've done install the library as well as module. Upon running sys info.py, the errors are :

 

Traceback (most recent call last):

  File "sysinfo.py", line 61, in <module>

    cad = pifacecad.PiFaceCAD()

  File "/usr/lib/python3/dist-packages/pifacecad/core.py", line 50, in __init__

    self.init_board()

  File "/usr/lib/python3/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).

 

 

Tried to search more information about this, other forums shows that the kernel update makes this display are not able to work. Is there any workaround to make this display working? Thanks.

  • Sign in to reply
  • Cancel
  • ralphjy
    ralphjy over 6 years ago

    The PiFace uses the SPI interface, so make sure that is enabled in the Raspi-config.  Also, make sure your chip_select jumpers. (JP1,JP2) are set correctly.  It seems odd that it is looking for chip_select=1 if you are only using a single PiFace board (usually defaults to 0).

     

    Have you tried the emulator to verify the software is installed correctly?

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • Cancel
  • cclegends
    cclegends over 6 years ago in reply to ralphjy

    Hi thanks for reply Ralph, I've checked and enabled the SPI interface in Raspi-Config. Is there any way to edit the value back to zero? 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • ralphjy
    ralphjy over 6 years ago in reply to cclegends

    I'm not sure why the default in core.py is for chip_select=1, but you can either edit this line in the file or you can change your jumpers.  If you change the jumpers then you will have to explicitly set the address when doing reads and writes.  I would edit the file unless you have multiple PiFaces.

     

    image

     

     

    At the top of core.py:

     

         import pifacecommon.mcp23s17

         import pifacecommon.interrupts

         import pifacecad.lcd

     

         DEFAULT_SPI_BUS = 0

        DEFAULT_SPI_CHIP_SELECT = 1

         NUM_SWITCHES = 8

     

     

    From your traceback, the file is /usr/lib/python3/dist-packages/pifacecad/core.py

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago in reply to ralphjy

    I don't think the Control and Display has selectable jumpers on it.  At least the one I have does not have selectable jumpers on it.

     

    @cclegends I am not sure it is a good idea to mess with the underlying code and really should not be necessary.   You have installed the Python 3 version of the PiFace code correct?

     

    Run the following on your Pi to ensure your SPI interface is up and running

    ls /dev/*spi*
    /dev/spidev0.0  /dev/spidev0.1

     

    You should see the 2 SPI devices to show.

     

    Could you post the code you are using?

     

    I suspect you have gone through the How-To-Guides from the following link, right?

    http://www.piface.org.uk/products/piface_control_and_display/

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • cclegends
    cclegends over 6 years ago in reply to jomoenginer

    Hi John,  Yes, i did follow the How-to_Guide to establish the connections. I've also ran the ls /dev/*spi*. Both interface is confirm up and running. But for Python3 version of PiFace code i think i've installed it correctly. Is there anywhere to confirm that? Thanks

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago

    Try running through what is listed at the following.  This should verify the config.

    http://piface.github.io/pifacecad/installation.html#sysinfo-service

     

    Have a look-see at the troubleshooting suggestion posted at the following

    https://github.com/piface/pifacecad/issues/24

     

    I vaguely remember having to do this.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • jomoenginer
    jomoenginer over 6 years ago

    This is what I have in the spi.py file

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

     

        
    # 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 +1 Vote Down
    • Sign in to reply
    • Cancel
  • ralphjy
    ralphjy over 6 years ago in reply to jomoenginer

    Hi Jon,

     

    Thanks, hope I didn’t led Christopher astray.  I was thinking about the PiFace Digital 2.  I should pay more attention.

     

    He  should follow your advice.

     

    Sorry Christopher...

     

    Ralph

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cclegends
    cclegends over 6 years ago in reply to ralphjy

    It's alright Ralph.  Trying the method that Jon posted.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • cclegends
    cclegends over 6 years ago in reply to jomoenginer

    Updates, Thanks Jon for the code modification. Now the display power ups and working but there is a little hiccup. Where it can't display free memory on the display. The tracebacks are :

     

    Traceback (most recent call last):

      File "sysinfo.py", line 75, in <module>

        show_sysinfo()

      File "sysinfo.py", line 56, in show_sysinfo

        cad.lcd.write(":{}".format(get_my_free_mem()))

      File "sysinfo.py", line 35, in get_my_free_mem

        used_mem = float(run_cmd(USED_MEM_CMD))

    ValueError: could not convert string to float:

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • 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