Hihi, i just tested the library on a new RasPi4 and you can toggle output on/off but pullup enabling doesnt seem to work. Probably a mmio offeset change. do you need a hand fixing?
The process for setting pull-ups has changed slightly for the better with Pi 4 and the offsets are slightly different. I've got a local hack of RPi.GPIO that works which I'm cleaning up. Will grab a patch file for it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Tried on one of my projects using pins 23 and 24, worked fine. Also appears to have cleared up a problem in the cleanup() method. Project uses an LCD though Adafruit_GPIO, and before this fix calling the cleanup() method turned the backlight back on. Now functions the same way as the pevious version on a PI 3.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The process for setting pull-ups has changed slightly for the better with Pi 4 and the offsets are slightly different. I've got a local hack of RPi.GPIO that works which I'm cleaning up. Will grab a patch file for it.
Here's what I have so far:
This is largely inspired by the changes to
raspi-gpio
- you can see the commit for 2711 support here: https://github.com/RPi-Distro/raspi-gpio/commit/80fa7d04eafb3ea34fc6f2d32de5f1873b5fb369Hopefully I'll get my hands on a Pi4 tomorrow to test and make a release. Thanks for the patch!
Did you manage to get your hands on a Pi 4? Let me know if we can assist in any way!
Alpha release is now available for testing:
pip3 install --upgrade --pre rpi.gpio
Last edit: Ben Croston 2019-07-08
I tested with the Alpha Release and it seems to be working great. Thanks for updating this.
Tried on my pi4 with GPIO17 pullup, working perfectly. Thank you all.
Tried on one of my projects using pins 23 and 24, worked fine. Also appears to have cleared up a problem in the cleanup() method. Project uses an LCD though Adafruit_GPIO, and before this fix calling the cleanup() method turned the backlight back on. Now functions the same way as the pevious version on a PI 3.
hi ben, thanks for the quick coding - is this ticket resolved and the code available for any pip installs?
In release 0.7.0
Hlelo everyone, I dont know what is the problem here but my pullups are not working, can you help me?
This is my code, but the measured voltage is not 3.3v it fluctuates all around except when i connect it to ground. Then, its 0
Below is my code..... I run it with --------- python3 input.py 11 (in the case of pin 11)
import RPi.GPIO as GPIO
import time
import sys
pinLeft = int(sys.argv[1])
print(pinLeft)
GPIO.setmode(GPIO.BOARD)
GPIO.setup(pinLeft, GPIO.IN, pull_up_down=GPIO.PUD_UP)
while True:
if GPIO.input(pinLeft):
print('Input was HIGH')
else:
print('Input was LOW')
time.sleep(0.05)
GPIO.cleanup()
What is the result of:
import RPi.GPIO as GPIO
print(GPIO.VERSION)
Last edit: Ben Croston 2020-10-06
import RPi.GPIO as GPIO
print(GPIO.VERSION)>>> print(GPIO.VERSION)
0.7.0
Does it work with other pins?
Does it work after rebooting?
Last edit: Ben Croston 2020-10-06
It works on some pins sometimes and on some other times, it seems to be completely random