gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

RPI.GPIO and Pi4 issue ?

Tue Jul 02, 2019 8:19 am

I can't pull-up all the inputs, and it errors above pin 26...what's wrong ?

Code: Select all

import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BOARD)
GPIO.setwarnings(False)

pins = (3,5,7,8,10,11,12,13,15,16,18,19,21,22,23,24,26,29,31,32,33,35,36,37,38,40)

for pin in range (0,26):
    GPIO.setup(pins[pin], GPIO.IN, pull_up_down=GPIO.PUD_UP)
    print ('pin: '+ str(pins[pin]), GPIO.input(pins[pin]))
gives..

Code: Select all

pin: 3 1
pin: 5 1
pin: 7 1
pin: 8 1
pin: 10 1
pin: 11 0
pin: 12 0
pin: 13 0
pin: 15 0
pin: 16 0
pin: 18 0
pin: 19 0
pin: 21 0
pin: 22 0
pin: 23 0
pin: 24 1
pin: 26 1
Traceback (most recent call last):
  File "/home/pi/pins1.py", line 8, in <module>
    GPIO.setup(pins[pin], GPIO.IN, pull_up_down=GPIO.PUD_UP)
ValueError: The channel sent is invalid on a Raspberry Pi
works on a Pi3B

Code: Select all

pin: 3 1
pin: 5 1
pin: 7 1
pin: 8 1
pin: 10 1
pin: 11 1
pin: 12 1
pin: 13 1
pin: 15 1
pin: 16 1
pin: 18 1
pin: 19 1
pin: 21 1
pin: 22 1
pin: 23 1
pin: 24 1
pin: 26 1
pin: 29 1
pin: 31 1
pin: 32 1
pin: 33 1
pin: 35 1
pin: 36 1
pin: 37 1
pin: 38 1
pin: 40 1
Last edited by gordon77 on Tue Jul 02, 2019 8:26 am, edited 1 time in total.

User avatar
croston
Posts: 703
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: RPI.GPIO and Pi4 issue ?

Tue Jul 02, 2019 8:25 am

I am the maintainer and am working on this.

gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

Re: RPI.GPIO and Pi4 issue ?

Tue Jul 02, 2019 9:19 am

Thanks

gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

Re: RPI.GPIO and Pi4 issue ?

Thu Jul 04, 2019 8:44 am

Any news on the fix ?

Thanks

User avatar
croston
Posts: 703
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: RPI.GPIO and Pi4 issue ?

Thu Jul 04, 2019 6:56 pm

I'm looking at a fix being available on Sunday.

gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

Re: RPI.GPIO and Pi4 issue ?

Thu Jul 04, 2019 7:03 pm

Thanks for the info.

User avatar
croston
Posts: 703
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: RPI.GPIO and Pi4 issue ?

Mon Jul 08, 2019 5:13 pm

You can now install the alpha release (for testing purposes):

Code: Select all

$ pip3 install --upgrade --pre rpi.gpio
Let me know if it works or not.

gordon77
Posts: 4370
Joined: Sun Aug 05, 2012 3:12 pm

Re: RPI.GPIO and Pi4 issue ?

Mon Jul 08, 2019 6:44 pm

Thanks, That seems to work fine.

jinksto
Posts: 3
Joined: Fri Jul 12, 2019 9:15 pm

Re: RPI.GPIO and Pi4 issue ?

Sat Jul 13, 2019 12:21 am

croston wrote:
Mon Jul 08, 2019 5:13 pm
You can now install the alpha release (for testing purposes):

Code: Select all

$ pip3 install --upgrade --pre rpi.gpio
Let me know if it works or not.
This resolved my problem with RPi.GPIO as well.

https://www.raspberrypi.org/forums/view ... 7#p1498777

InnoHub
Posts: 5
Joined: Mon Aug 26, 2019 5:21 am

Re: RPI.GPIO and Pi4 issue ?

Mon Aug 26, 2019 5:48 am

Facing problems with GPIO on Pi 4.

Tried the update provided by @croston. But the pip3 install --upgrade --pre rpi.gpio command said that the rpi.gpio is already the latest version and did not upgrade anything.

Are there any further updates or steps to be followed? Have been struggling with this issue for the past couple of days.

Any help would be appreciated.

mattmiller
Posts: 2165
Joined: Thu Feb 05, 2015 11:25 pm

Re: RPI.GPIO and Pi4 issue ?

Mon Aug 26, 2019 10:33 am

Hi and welcome to the forum :)

Unless your problem's identical to this one - best idea is to start your own thread and explain what problem your having

User avatar
croston
Posts: 703
Joined: Sat Nov 26, 2011 12:33 pm
Location: Blackpool
Contact: Website

Re: RPI.GPIO and Pi4 issue ?

Mon Aug 26, 2019 11:25 pm

This fix is now in Raspbian Buster if you run an update:

Code: Select all

sudo apt update && sudo apt full-upgrade

InnoHub
Posts: 5
Joined: Mon Aug 26, 2019 5:21 am

Re: RPI.GPIO and Pi4 issue ?

Tue Aug 27, 2019 8:09 am

mattmiller wrote:
Mon Aug 26, 2019 10:33 am
Hi and welcome to the forum :)

Unless your problem's identical to this one - best idea is to start your own thread and explain what problem your having
Thank you!!

I thought the issues I am facing are related to this thread.

As suggested I will start a new thread anyway!

InnoHub
Posts: 5
Joined: Mon Aug 26, 2019 5:21 am

Re: RPI.GPIO and Pi4 issue ?

Tue Aug 27, 2019 8:13 am

croston wrote:
Mon Aug 26, 2019 11:25 pm
This fix is now in Raspbian Buster if you run an update:

Code: Select all

sudo apt update && sudo apt full-upgrade
Thanks for the suggestion.

It did not solve the issue though.

My program works perfectly on Pi 3B+ but not on Pi4 :(

pcmanbob
Posts: 7699
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: RPI.GPIO and Pi4 issue ?

Tue Aug 27, 2019 8:30 am

Seeing as you have not actually told us what the problem is I don't see what more help we can offer,

we can only provide help based on the information you provide.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Troubleshooting”