Odd errors related to RPI GPIO

Not sure if this is the right place to put this question, but as I’m not sure if my problem is related to HA Core, to the Git pull addon or to HACS, here it goes.

I have the latest June release installed and now when I use GIT Pull to get my configuration updates, I get all these unrelated errors:

 ERROR: Failed building wheel for RPi.GPIO
  error: subprocess-exited-with-error
  
  × Running setup.py install for RPi.GPIO did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running install
      /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-310
      creating build/lib.linux-aarch64-cpython-310/RPi
      copying RPi/__init__.py -> build/lib.linux-aarch64-cpython-310/RPi
      creating build/lib.linux-aarch64-cpython-310/RPi/GPIO
      copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-cpython-310/RPi/GPIO
      running build_ext
      building 'RPi._GPIO' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/source
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c source/c_gpio.c -o build/temp.linux-aarch64-cpython-310/source/c_gpio.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> RPi.GPIO
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
INFO:homeassistant.util.package:Attempting install of RPi.GPIO==0.7.1a4
ERROR:homeassistant.util.package:Unable to install package RPi.GPIO==0.7.1a4: error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-310
      creating build/lib.linux-aarch64-cpython-310/RPi
      copying RPi/__init__.py -> build/lib.linux-aarch64-cpython-310/RPi
      creating build/lib.linux-aarch64-cpython-310/RPi/GPIO
      copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-cpython-310/RPi/GPIO
      running build_ext
      building 'RPi._GPIO' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/source
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c source/c_gpio.c -o build/temp.linux-aarch64-cpython-310/source/c_gpio.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for RPi.GPIO
  error: subprocess-exited-with-error
  
  × Running setup.py install for RPi.GPIO did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      running install
      /usr/local/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-cpython-310
      creating build/lib.linux-aarch64-cpython-310/RPi
      copying RPi/__init__.py -> build/lib.linux-aarch64-cpython-310/RPi
      creating build/lib.linux-aarch64-cpython-310/RPi/GPIO
      copying RPi/GPIO/__init__.py -> build/lib.linux-aarch64-cpython-310/RPi/GPIO
      running build_ext
      building 'RPi._GPIO' extension
      creating build/temp.linux-aarch64-cpython-310
      creating build/temp.linux-aarch64-cpython-310/source
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fno-semantic-interposition -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free -DTHREAD_STACK_SIZE=0x100000 -fPIC -I/usr/local/include/python3.10 -c source/c_gpio.c -o build/temp.linux-aarch64-cpython-310/source/c_gpio.o
      error: command 'gcc' failed: No such file or directory
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> RPi.GPIO
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
ERROR:homeassistant.config:Invalid config for [template]: invalid template (TemplateSyntaxError: unexpected ')') for dictionary value @ data['binary_sensor'][1]['state']. Got "{% if( \n    (as_timestamp(states.sensor.time.last_changed) - as_timestamp(states.binary_sensor.living_room_motion_sensor_home_security_motion_detection.last_updated)) > (((states('input_number.no_one_at_home_timing') | int) ) * 60)\nand (as_timestamp(states.sensor.time.last_changed) - as_timestamp(states.binary_sensor.gpio_kitchen_zone.last_updated)) > (((states('input_number.no_one_at_home_timing') | int) ) * 60) ) and (as_timestamp(states.sensor.time.last_changed) - as_timestamp(states.bi.... (See /config/include/sensors-template/presence_sensors.yaml, line 0). 
Failed config
  General Errors: 
    - Platform error binary_sensor.rpi_gpio - Requirements for rpi_gpio not found: ['RPi.GPIO==0.7.1a4'].
Successful config (partial)
[Error] Configuration updated but it does not pass the config check. Do not restart until this is fixed!
[cmd] /run.sh exited 0
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.

Why on earth is this error displayed when the GIT pull addon is checking for configuration issues?

I just noticed the same, along with:

The system cannot restart because the configuration is not valid: Platform error switch.rpi_gpio - Requirements for rpi_gpio not found: ['RPi.GPIO==0.7.1a4']. Platform error binary_sensor.rpi_gpio - Requirements for rpi_gpio not found: ['RPi.GPIO==0.7.1a4'].

Reboot the host

I already reboot it several times (for some other purposes), but the error remains there.

Same error here. Solved doing this:
Comment gpio related configuration and delete integration. Restart.
Add integration, restart, uncomment configuration and restart again.

3 Likes

Thanks @Miguel_Alvarez , I’ll try that and if I get any luck, I’ll let everyone know.

no luck? I have the same problem

That worked for me, and others as discussed in this issue.

Just to let you all know that somehow the errors disapeared and I did not even try that ad-hoc procedure.
I guess that after either updating HA Core or the RPIO integration this problem got solved by its own.

That worked for me too.

I also ran into the same problem.
The measures mentioned above did not solve it for me.
I also upgraded the host OS without any difference.

Then I deleted the docker image and fetched it again.
Afterwards I downloaded the integration again - restarted - then uncommented the the YAML-lines. Then it started to work again.

Just wanted to share the additional step.

My setup: Hass Core on Raspian RPI4.

Hi,
The verison of RPi.GPIO requested here is 0.7.1a4, while its version in rpi_GPIO is v0.7.1. The system needs gcc to compile the python wheel of RPi.GPIO v0.7.1a4. But you can simply use the same version. Just remove “a4” from the manifest.json of custom component you want to install.
It should work.

1 Like