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 Problems
  • 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 78 replies
  • Subscribers 676 subscribers
  • Views 8520 views
  • Users 0 members are here
  • raspberry_pi
  • piface
  • raspberry_pi_accessories
Related

PiFace Problems

keithtowns
keithtowns over 12 years ago

Am I missing something? I have two PiFace and 3 Raspberry Pi. I followed the instructions the get the PiFace working but have yet to succeed. I have tried the image provided as well as updating an existing Raspian image to no avail. I have also tried all my Pi and the two PiFace in all the combinations. I almost gave up but also tried a different power supply and SD card. None of the above got the emulator to switch on the LEDs and I could not do it through Python. Any ideas? I've spent hours on this, please tell me I've missed something. Thanks.

  • Sign in to reply
  • Cancel
Parents
  • Former Member
    Former Member over 12 years ago

    Keith, you are not alone. The 'documentation' with the piface is worse than useless. I particularly like the typo on page 2 of the 'instructions' (etc/ which should be /etc/) and that if the emulator fails (I can't get it to work – ends with 'segmentation fault') the 'instructions' that follow are, again, useless. I will get it working in the end, but no thanks to the fools at man.ac.uk. How difficult would it have been to provide basic instructions in the box? Good luck with it - I'll reply back when I've finished arm-wrestling with it and got it doing something (I have a job in mind).

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to Former Member

    ... not sure if urls are allowed here - if they are, here's some documentation for piface ...

     

    https://docs.google.com/folder/d/0B-UAZ9CyJCLGQjJ3RDlqa2pqaDg/edit?pli=1

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • keithtowns
    keithtowns over 12 years ago in reply to Former Member

    Hi Thomas

     

    I tried your code in a Python shell from a LXTerminal and from Python 2.7.3 Shell.

     

    No errors were reported when I typed in each of the lines but I guess this was going to switch on an LED or relay? Neither happened.

     

    Thanks for your help so far.

     

    Keith

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • dgmcneil
    dgmcneil over 12 years ago in reply to keithtowns

    Hi Keith, did you ever get you PiFace to work?

     

    I spent two days struggling with this.  I found it hard to find documentation and I could have saved myself two days of trouble-shooting had I just had access to a schematic.

     

     

    My PiFace was shipped without a jumper on JP7.  The absence of JP7 disables the 5 V rail for the outputs so there was no lights, no relay click.  Adding JP7 made the PiFace work as advertised.

     

    While I'm typing I may as well add that I'm disappointed that the designer of the PiFace didn't make the unused IO ports on the Raspberry Pi available on the board.  This limits what would have otherwise been a very nice addition to the Pi.

     

    Dave

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • keithtowns
    keithtowns over 12 years ago in reply to dgmcneil

    Hi Dave

     

    No my PiFace is still not working and both of them have a jumper 7 installed.

     

    Thanks anyway

     

    Keith

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mrbuzzcut
    mrbuzzcut over 12 years ago in reply to keithtowns

    Did you get any error messages in the terminal window when you ran the emulator?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • keithtowns
    keithtowns over 12 years ago in reply to mrbuzzcut

    Hi Jeff

     

    No errors, the emulator window opens and says piface detected but nothing works. In the terminal window the cursor waits and returns to root@raspberrypi:~# once the emulator has been closed.

     

    Cheers

     

    Keith

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • mrbuzzcut
    mrbuzzcut over 12 years ago in reply to keithtowns

    PiFace detected...that's a start. Did you click the override button?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to keithtowns

    Keith, can you run the commands I listed in post #8 and tell me the output? If you can see the SPI device files (/dev/spidev0.0 and /dev/spidev0.1) and running the Python shell commands doesn't error then it's probably an error with your board.

     

    Also, try reading from the board:

     

    $ python

    >>> import piface.pfio as p

    >>> p.digital_read(0)

     

    This should return a 1 or 0 value depending on whether the switch was pressed. So you should run the digital_read() command twice, once while holding the first switch and once while not. The returned values should be different. If they are the same even when you have held down the switch then it's a hardware fault.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • keithtowns
    keithtowns over 12 years ago in reply to Former Member

    Hello Thomas

     

    The commands returned the following:

     

    root@raspberrypi:~# ls -l /dev/spidev*

    crw-rw---T 1 root spiuser 153, 0 Jan  1  1970 /dev/spidev0.0

    crw-rw---T 1 root spiuser 153, 1 Jan  1  1970 /dev/spidev0.1

     

    However, the input was more revealing:

     

    root@raspberrypi:~# python

    Python 2.7.3 (default, Jan 13 2013, 11:20:46)

    [GCC 4.6.3] on linux2

    Type "help", "copyright", "credits" or "license" for more information.

    >>> import piface.pfio as p

    >>> p.digital_read(0)

    Traceback (most recent call last):

      File "<stdin>", line 1, in <module>

      File "/usr/local/lib/python2.7/dist-packages/piface/pfio.py", line 249, in digital_read

        current_pin_values = read_input()

      File "/usr/local/lib/python2.7/dist-packages/piface/pfio.py", line 300, in read_input

        port, data = read(INPUT_PORT)

      File "/usr/local/lib/python2.7/dist-packages/piface/pfio.py", line 329, in read

        operation, port, data = send([(READ_CMD, port, 0xff)])[0] # send is expecting and returns a list

      File "/usr/local/lib/python2.7/dist-packages/piface/pfio.py", line 342, in send

        raise InitError("The pfio module has not yet been initialised. Before send(), call init().")

    piface.pfio.InitError: The pfio module has not yet been initialised. Before send(), call init().

    >>>

     

     

    Thanks

     

    Keith

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Former Member
    Former Member over 12 years ago in reply to keithtowns

    Ah, my bad. You need to initialised the pfio first.

     

    $ python

    >>> import piface.pfio as p

    >>> p.init()

    >>> p.digital_read(0)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • keithtowns
    keithtowns over 12 years ago in reply to mrbuzzcut

    Hi Jeff

     

    Yes I did click on the override enable and then all on/off and individual pins but nothing......

     

    Thanks anyway

     

    Keith

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • keithtowns
    keithtowns over 12 years ago in reply to mrbuzzcut

    Hi Jeff

     

    Yes I did click on the override enable and then all on/off and individual pins but nothing......

     

    Thanks anyway

     

    Keith

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