gordon77
Posts: 4967
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: 706
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: 4967
Joined: Sun Aug 05, 2012 3:12 pm

Re: RPI.GPIO and Pi4 issue ?

Tue Jul 02, 2019 9:19 am

Thanks

gordon77
Posts: 4967
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: 706
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: 4967
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: 706
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: 4967
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: 2230
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: 706
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: 9214
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

dony71
Posts: 15
Joined: Wed Feb 05, 2014 8:39 pm

Re: RPI.GPIO and Pi4 issue ?

Fri May 22, 2020 5:59 pm

@croston : I have RPi4 and install "pip install RPi.GPIO" and get error below

pi@pi64 ~ $ pip install --user RPi.GPIO
Collecting RPi.GPIO
Using cached RPi.GPIO-0.7.0.tar.gz (30 kB)
Installing collected packages: RPi.GPIO
Running setup.py install for RPi.GPIO ... error
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp /pip-install-8a6ado6k/RPi.GPIO/setup.py'"'"'; __file__='"'"'/tmp/pip-install-8a6ado6k/RPi.GPIO/se tup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'" '"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp /pip-record-0fg28_61/install-record.txt --single-version-externally-managed --user --prefix= --co mpile --install-headers /home/pi/.local/include/python3.6m/RPi.GPIO
cwd: /tmp/pip-install-8a6ado6k/RPi.GPIO/
Complete output (85 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.6
creating build/lib.linux-aarch64-3.6/RPi
copying RPi/__init__.py -> build/lib.linux-aarch64-3.6/RPi
creating build/lib.linux-aarch64-3.6/RPi/GPIO
copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-3.6/RPi/GPIO
running build_ext
building 'RPi._GPIO' extension
creating build/temp.linux-aarch64-3.6
creating build/temp.linux-aarch64-3.6/source
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/py_gpio.c -o build/temp.linux-aarch64-3.6/source/py_gpio.o
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/c_gpio.c -o build/temp.linux-aarch64-3.6/source/c_gpio.o
source/c_gpio.c: In function ‘setup’:
source/c_gpio.c:130:9: warning: cast from pointer to integer of different size [-Wpointer-to- int-cast]
130 | if ((uint32_t)gpio_mem % PAGE_SIZE)
| ^
source/c_gpio.c:131:34: warning: cast from pointer to integer of different size [-Wpointer-to -int-cast]
131 | gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);
| ^
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/cpuinfo.c -o build/temp.linux-aarch64-3.6/source/cpuinfo.o
source/cpuinfo.c: In function ‘get_rpi_info’:
source/cpuinfo.c:139:28: warning: format ‘%llx’ expects argument of type ‘long long unsigned int *’, but argument 3 has type ‘uint64_t *’ {aka ‘long unsigned int *’} [-Wformat=]
139 | sscanf(revision, "%llx", &rev);
| ~~~^ ~~~~
| | |
| | uint64_t * {aka long unsigned int *}
| long long unsigned int *
| %lx
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/event_gpio.c -o build/temp.linux-aarch64-3.6/source/event_gpio.o
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/soft_pwm.c - o build/temp.linux-aarch64-3.6/source/soft_pwm.o
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/py_pwm.c -o build/temp.linux-aarch64-3.6/source/py_pwm.o
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/common.c -o build/temp.linux-aarch64-3.6/source/common.o
aarch64-unknown-linux-gnu-gcc -pthread -fPIC -I/usr/include/python3.6m -c source/constants.c -o build/temp.linux-aarch64-3.6/source/constants.o
aarch64-unknown-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,--as-needed -L. -Wl,-O1 -Wl,--as-n eeded -L. build/temp.linux-aarch64-3.6/source/py_gpio.o build/temp.linux-aarch64-3.6/source/c_gpi o.o build/temp.linux-aarch64-3.6/source/cpuinfo.o build/temp.linux-aarch64-3.6/source/event_gpio. o build/temp.linux-aarch64-3.6/source/soft_pwm.o build/temp.linux-aarch64-3.6/source/py_pwm.o bui ld/temp.linux-aarch64-3.6/source/common.o build/temp.linux-aarch64-3.6/source/constants.o -L/usr/ lib64 -lpython3.6m -o build/lib.linux-aarch64-3.6/RPi/_GPIO.cpython-36m-aarch64-linux-gnu.so
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/soft_pwm.o:(.bss+0x0): multiple definition of `threads'; build /temp.linux-aarch64-3.6/source/event_gpio.o:(.bss+0x10): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.data.rel.local+0x0): multiple definition of `PWMTyp e'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.bss+0x0): multiple definition of `gpio_mode'; build /temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x218): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.rodata+0x30): multiple definition of `pin_to_gpio_r ev1'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0x30): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.rodata+0xd8): multiple definition of `pin_to_gpio_r ev2'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0xd8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.rodata+0x180): multiple definition of `pin_to_gpio_ rev3'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0x180): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.bss+0x8): multiple definition of `pin_to_gpio'; bui ld/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x220): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.bss+0x10): multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x228): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.bss+0xe8): multiple definition of `rpiinfo'; build/ temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x300): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.bss+0x510): multiple definition of `setup_error'; b uild/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x728): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/py_pwm.o:(.bss+0x514): multiple definition of `module_setup'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x72c): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.data+0x0): multiple definition of `gpio_mode'; buil d/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x218): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.rodata+0x0): multiple definition of `pin_to_gpio_re v1'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0x30): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.rodata+0xa8): multiple definition of `pin_to_gpio_r ev2'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0xd8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.rodata+0x150): multiple definition of `pin_to_gpio_ rev3'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0x180): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.bss+0x0): multiple definition of `pin_to_gpio'; bui ld/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x220): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.bss+0x8): multiple definition of `gpio_direction'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x228): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.bss+0xe0): multiple definition of `rpiinfo'; build/ temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x300): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.bss+0x508): multiple definition of `setup_error'; b uild/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x728): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/common.o:(.bss+0x50c): multiple definition of `module_setup'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x72c): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x0): multiple definition of `high'; build/t emp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x190): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x8): multiple definition of `low'; build/te mp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x198): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x10): multiple definition of `input'; build /temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1a0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x18): multiple definition of `output'; buil d/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1a8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x20): multiple definition of `pwm'; build/t emp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1b0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x28): multiple definition of `serial'; buil d/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1b8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x30): multiple definition of `i2c'; build/t emp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1c0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x38): multiple definition of `spi'; build/t emp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1c8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x40): multiple definition of `unknown'; bui ld/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1d0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x48): multiple definition of `board'; build /temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1d8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x50): multiple definition of `bcm'; build/t emp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1e0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x58): multiple definition of `pud_off'; bui ld/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1e8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x60): multiple definition of `pud_up'; buil d/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1f0): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x68): multiple definition of `pud_down'; bu ild/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x1f8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x70): multiple definition of `rising_edge'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x200): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x78): multiple definition of `falling_edge' ; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x208): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x80): multiple definition of `both_edge'; b uild/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x210): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x88): multiple definition of `gpio_mode'; b uild/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x218): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.rodata+0x0): multiple definition of `pin_to_gpio _rev1'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0x30): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.rodata+0xa8): multiple definition of `pin_to_gpi o_rev2'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0xd8): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.rodata+0x150): multiple definition of `pin_to_gp io_rev3'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.rodata+0x180): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x90): multiple definition of `pin_to_gpio'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x220): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x98): multiple definition of `gpio_directio n'; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x228): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x170): multiple definition of `rpiinfo'; bu ild/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x300): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x598): multiple definition of `setup_error' ; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x728): first defined here
/usr/lib/gcc/aarch64-unknown-linux-gnu/10.1.0/../../../../aarch64-unknown-linux-gnu/bin/ld: b uild/temp.linux-aarch64-3.6/source/constants.o:(.bss+0x59c): multiple definition of `module_setup '; build/temp.linux-aarch64-3.6/source/py_gpio.o:(.bss+0x72c): first defined here
collect2: error: ld returned 1 exit status
error: command 'aarch64-unknown-linux-gnu-gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3.6 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-8a6ado6k/RPi.GPIO/setup.py'"'"'; __file__='"'"'/tmp /pip-install-8a6ado6k/RPi.GPIO/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__); code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'e xec'"'"'))' install --record /tmp/pip-record-0fg28_61/install-record.txt --single-version-externa lly-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.6m/RPi.G PIO Check the logs for full command output.

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

Re: RPI.GPIO and Pi4 issue ?

Fri May 22, 2020 6:29 pm

What are you trying to install it in, raspbian ?

Buster should come with it.


User avatar
sakaki
Posts: 542
Joined: Sun Jul 16, 2017 1:11 pm

Re: RPI.GPIO and Pi4 issue ?

Fri May 22, 2020 10:01 pm

dony71 wrote:
Fri May 22, 2020 6:48 pm
gentoo
https://github.com/sakaki-/gentoo-on-rpi-64bit
Gentoo now uses gcc v10 unless masked, and this has -fno-common turned on by default (upstream). The old default was -fcommon.

This change causes extern omissions in some (usually legacy) code to throw 'multiple definition' errors (like the ones you report) at link time. More details:

https://gcc.gnu.org/gcc-10/porting_to.html#common

You can quickly check whether this is indeed the root issue here (as it may be something else entirely): just add -fcommon to your CFLAGS and see if the target package compiles OK.

If it does then, per the gcc docs, the issue ought really to be addressed in the upstream target package's source.

hth,

sakaki

dony71
Posts: 15
Joined: Wed Feb 05, 2014 8:39 pm

Re: RPI.GPIO and Pi4 issue ?

Fri May 22, 2020 10:37 pm

sakaki wrote:
Fri May 22, 2020 10:01 pm
You can quickly check whether this is indeed the root issue here (as it may be something else entirely): just add -fcommon to your CFLAGS and see if the target package compiles OK.
Yeap ... it's compiled fine
Thank's Sakaki

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

Re: RPI.GPIO and Pi4 issue ?

Tue Jun 02, 2020 9:03 pm

Thanks - I'll take a look at this. I've got to check RPi.GPIO behaves properly with the new foundation maintained arm64 distro anyway. I've a couple of compiler warnings with Python 3.9.0b1 to clear up too.

Return to “Troubleshooting”