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 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 665 subscribers
  • Views 2185 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
Parents
  • 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
  • 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
  • jomoenginer
    jomoenginer over 6 years ago in reply to cclegends

    cclegends  wrote:

     

    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:

    Is this working now?

     

    I inadvertently updated my config and ran into this issue as well.  I found the solution at the following:

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

     

    This is what I have in my sysinfo.py file

    #USED_MEM_CMD = "free | grep '\-\/+' | awk '{print $3}'"
    USED_MEM_CMD = "free | grep 'Mem' | awk '{print $3}'"

     

    This is actually running on an older Pi B+ but I am still having an issue on a Pi 3 B+ with the sp.py entry.

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

    cclegends  wrote:

     

    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:

    Is this working now?

     

    I inadvertently updated my config and ran into this issue as well.  I found the solution at the following:

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

     

    This is what I have in my sysinfo.py file

    #USED_MEM_CMD = "free | grep '\-\/+' | awk '{print $3}'"
    USED_MEM_CMD = "free | grep 'Mem' | awk '{print $3}'"

     

    This is actually running on an older Pi B+ but I am still having an issue on a Pi 3 B+ with the sp.py entry.

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

    On my Pi 3 B+ I ended up having to download the pifaceacad code from their github repo and run the setup install from that to get it to work.  Just running from apt-get loaded some older code that did not like the spi.py entry.

     

    This is what I had seen prior to loaded the code from the github repo.

    python3 /usr/share/doc/python3-pifacecad/examples/sysinfo.py
    Traceback (most recent call last):
      File "/usr/share/doc/python3-pifacecad/examples/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 75, in init_board
        self.iocon.value = ioconfig
      File "/usr/lib/python3/dist-packages/pifacecommon/mcp23s17.py", line 238, in value
        self.chip.write(v, self.address)
      File "/usr/lib/python3/dist-packages/pifacecommon/mcp23s17.py", line 163, in write
        self._pyver_write(data, address)
      File "/usr/lib/python3/dist-packages/pifacecommon/mcp23s17.py", line 167, in _py3write
        self.spisend(bytes((ctrl_byte, address, data)))
      File "/usr/lib/python3/dist-packages/pifacecommon/spi.py", line 69, in spisend
        speed_hz=ctypes.c_uint32(self.speed_hz)
    AttributeError: 'PiFaceCAD' object has no attribute 'speed_hz'

     

     

    It is working now on both a RasPi B+ and a RasPi 3 B+.

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

    Hi Jon, sorry for late updates. Thanks for the code, the screen is able to display and show the available memory. image

    jomoenginer  wrote:

     

    cclegends   wrote:

     

    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:

    Is this working now?

     

    I inadvertently updated my config and ran into this issue as well.  I found the solution at the following:

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

     

    This is what I have in my sysinfo.py file

    #USED_MEM_CMD = "free | grep '\-\/+' | awk '{print $3}'"
    USED_MEM_CMD = "free | grep 'Mem' | awk '{print $3}'"
    

     

    This is actually running on an older Pi B+ but I am still having an issue on a Pi 3 B+ with the sp.py entry.

    • 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