I have several RasPIs set up with Ubuntu Server 18.04 64Bit. One freshly setup up RasPIs 3B+ and two 4Bs. On all I can run the following minimum script without any error messages:
#!/usr/bin/env python
from gpiozero import Button, LED
from signal import pause
def print_pin(button):
print(str(button.pin.number))
button1 = Button(20)
led1 = LED(4)
led1.blink()
button1.when_pressed = print_pin
pause()
The LED blinks on all of the RasPIs, however the button just works on the RasPI 3B+, but on none of the 4Bs.
I can't get any button working on the 4Bs, however LEDs work just fine and on some of them I use I2C, which also works perfectly fine. What could be the problem here?
I'm using the following versions on all RasPIs:
Linux ubuntu 5.3.0-1030-raspi2 #32~18.04.2-Ubuntu
gpiozero==1.5.1
RPi.GPIO==0.6.5
python-rpi.gpio 0.6.5-1ubuntu0.18.04.1
Just for completeness: In addition the 3B+ and one of the 4Bs have the following GPIO library installed for I2C:
Adafruit-GPIO==1.0.4