piface / pifacedigitalio

The PiFace Digital input/output module.
GNU General Public License v3.0
110 stars 48 forks source link

Piface Digital nt working in Buster #39

Open patdelaney opened 4 years ago

patdelaney commented 4 years ago

Any reads from the piface chip are all returning 0. I don’t know if it’s a kernel issue or what.

Has this been tested on Buster?

OS Version: | Raspbian GNU/Linux 10 (buster) Kernel Version: | 4.19.66-v7+

rexx-org commented 4 years ago

I have the same issue under Buster. Looks like the suppliers have abandoned any support for the product :-( Might be a good idea in future to not buy anything from these people as they obviously don't care about supporting their customers.

rfennell commented 4 years ago

Might be useful to others...

I managed to get my PIFace working on Buster using Python on an old Raspberry Pi. I used Lite on a headless install, but I am sure it work on Full install too.

You have to install using PIP...

  1. Get PIP (PIP3 for Python3) sudo apt-get install python3-pip
  2. Get the libraries sudo pip3 install pifacedigitalio sudo pip3 install pifacecommon
  3. Make sure the SPI access is enabled to the IO (you get errors when you run the script if you miss this out) sudo sed -i 's/#dtparam=spi=on/dtparam=spi=on/' /boot/config.txt
  4. Reboot sudo reboot

To test it create a file mytest.py

from time import sleep
import pifacedigitalio as p
p.init()
while(True):
     p.digital_write(0,1) #turn on
     sleep(1)
     p.digital_write(0,0) #turn off
     sleep(1)

and run it python3 mytest.py one of LEDs should flash

patdelaney commented 4 years ago

Last I know Pic face worked fine in the 4.0 image unless it just got broken. I have 3 0r 4 of them. I can retest.

What version of FPP are you using?

Pat

On Sun, May 24, 2020 at 3:14 PM Richard Fennell notifications@github.com wrote:

Might be useful to others...

I managed to get my PIFace working on Buster using Python on an old Raspberry Pi. I used Lite on a headless install, but I am sure it work on Full install too.

You have to install using PIP...

  1. Get PIP (PIP3 for Python3) sudo apt-get install python3-pip
  2. Get the libraries sudo pip3 install pifacedigitalio sudo pip3 install pifacecommon
  3. Make sure the SPI access is enabled to the IO (you get errors when you run the script if you miss this out) sudo sed -i 's/#dtparam=spi=on/dtparam=spi=on/' /boot/config.txt
  4. Reboot sudo reboot

To test it create a file mytest.py

from time import sleep import pifacedigitalio as p p.init() while(True): p.digital_write(0,1) #turn on sleep(1) p.digital_write(0,0) #turn off sleep(1)

and run it python3 mytest.py one of LEDs should flash

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/piface/pifacedigitalio/issues/39#issuecomment-633291166, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6FEA36GDUUTIHU2RYLTWLRTF52XANCNFSM4ISFRSFQ .

hkeown commented 3 years ago

Good evening @rfennell, @patdelaney ,

I've had the PiFace Digital (PFD) running on RPi 3B+ on Buster without any problem. I've now migrated to a Pi4.

In summary, the PFD now runs for a few hours and then hangs the system, killing the network in the process (although the network does recover after a period of time). To try and isolate the problem I've done a fresh install of Buster + latest install of python etc. I've included a snapshot of HTOP (running via an Ethernet terminal session) when the system hangs. The test program is a simple toggle_led.py, which I execute using the serial port using strace(). Using the serial port was to ensure that when the Ethernet connections dies, I still have access to the Pi. The strace output doesn't help much as I'm not sure what I'm looking for, is the strace output as expected? The syslog at the time of the stoppage at 13:43 doesn't indicate any related activity.

Any and all assistance will be appreciated.

[ PFD - Hangs3 PFD - Hangs2 PFD - Hangs1

](url)

patdelaney commented 3 years ago

What type of upgrade did you do? Did you burn the 4.1 image or inplace upgrade?

I have 2 Pi B+v2 running Piface and I am not seeing any issues

Pat

On Fri, Aug 28, 2020 at 11:46 AM Harvey Keown notifications@github.com wrote:

Good evening @rfennell https://github.com/rfennell, @patdelaney https://github.com/patdelaney ,

I've had the PiFace Digital (PFD) running on RPi 3B+ on Buster without any problem. I've now migrated to a Pi4.

In summary, the PFD now runs for a few hours and then hangs the system, killing the network in the process (although the network does recover after a period of time). To try and isolate the problem I've done a fresh install of Buster + latest install of python etc. I've included a snapshot of HTOP (running via an Ethernet terminal session) when the system hangs. The test program is a simple toggle_led.py, which I execute using the serial port using strace(). Using the serial port was to ensure that when the Ethernet connections dies, I still have access to the Pi. The strace output doesn't help much as I'm not sure what I'm looking for, is the strace output as expected? The syslog at the time of the stoppage at 13:43 doesn't indicate any related activity.

Any and all assistance will be appreciated.

[ [image: PFD - Hangs3] https://user-images.githubusercontent.com/20144501/91591978-1e228d80-e95e-11ea-9838-141fe6f2cb3e.png [image: PFD - Hangs2] https://user-images.githubusercontent.com/20144501/91591988-1fec5100-e95e-11ea-9ac7-c170d64317ba.png [image: PFD - Hangs1] https://user-images.githubusercontent.com/20144501/91591990-2084e780-e95e-11ea-9bed-106d599d2eff.png

](url)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/piface/pifacedigitalio/issues/39#issuecomment-682868391, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6FEA45MZB7SXCLH46BTMDSC7NMTANCNFSM4ISFRSFQ .

hkeown commented 3 years ago

Thank-you @patdelaney

It's a c completely fresh install from https://www.raspberrypi.org/downloads/ using the Raspberry Pi Imager for Windows.

Extract from the install script

` sudo apt-get update sudo apt full-upgrade sudo apt autoremove

sudo pip3 install pifacecommon sudo pip3 install pifacedigitalio `

Simple led toggle loop

`while(True):

 p.digital_write(7,1) #turn on
 sleep(1)
 p.digital_write(7,0) #turn off
 sleep(1)

`

Do you have any other debug functions or techniques for the PFD?

tompreston commented 3 years ago

So it looks like pifacedigital works when you install it from pip.

Can someone make a merge request to fix the doc please?