home-assistant / operating-system

:beginner: Home Assistant Operating System
Apache License 2.0
4.46k stars 925 forks source link

gpio not workin in raspberry pi4 #3358

Closed stamatakisa closed 3 weeks ago

stamatakisa commented 3 weeks ago

Describe the issue you are experiencing

the following error i have and gpio how work like binary sensor not working.

2024-05-09 16:53:11.830 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up rpi_gpio platform for binary_sensor Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform await asyncio.shield(awaitable) File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/rpi_gpio/binary_sensor.py", line 77, in setup_platform RPiGPIOBinarySensor( File "/config/custom_components/rpi_gpio/binary_sensor.py", line 132, in init edge_detect(self._port, edge_detected, self._bouncetime) File "/config/custom_components/rpi_gpio/init.py", line 59, in edge_detect GPIO.add_event_detect(port, GPIO.BOTH, callback=event_callback, bouncetime=bounce) RuntimeError: Failed to add edge detection

What operating system image do you use?

rpi4-64 (Raspberry Pi 4/400 64-bit OS)

What version of Home Assistant Operating System is installed?

12.3

Did you upgrade the Operating System.

Yes

Steps to reproduce the issue

1.update os 12.3 2.raspberry pi gpio version 2022.7.0 3. ...

Anything in the Supervisor logs that might be useful for us?

Supervisor
2024-05-09 16:41:46.017 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 16:41:49.522 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
2024-05-09 16:42:14.652 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to STARTING
2024-05-09 16:42:21.277 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to RUNNING
2024-05-09 16:42:21.277 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-05-09 16:42:59.570 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
2024-05-09 16:42:59.574 INFO (MainThread) [supervisor.api.proxy] WebSocket access from f4f71350_ewelink_smart_home_slug
2024-05-09 16:42:59.583 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2024-05-09 16:44:01.397 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-05-09 16:46:46.331 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 16:51:46.330 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 16:52:32.913 INFO (SyncWorker_6) [supervisor.docker.manager] Restarting homeassistant
2024-05-09 16:52:33.020 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API for f4f71350_ewelink_smart_home_slug closed
2024-05-09 16:53:04.410 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2024-05-09 16:53:10.115 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-05-09 16:53:10.371 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-05-09 16:53:10.528 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 16:53:14.442 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to NOT_RUNNING
2024-05-09 16:53:34.523 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to STARTING
2024-05-09 16:53:44.565 INFO (MainThread) [supervisor.homeassistant.core] Home Assistant Core state changed to RUNNING
2024-05-09 16:53:44.565 INFO (MainThread) [supervisor.homeassistant.core] Detect a running Home Assistant instance
2024-05-09 16:54:59.619 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request initialize
2024-05-09 16:54:59.623 INFO (MainThread) [supervisor.api.proxy] WebSocket access from f4f71350_ewelink_smart_home_slug
2024-05-09 16:54:59.632 INFO (MainThread) [supervisor.api.proxy] Home Assistant WebSocket API request running
2024-05-09 16:58:10.058 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:03:10.059 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:08:10.065 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:08:40.144 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:10:14.504 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state running
2024-05-09 17:10:14.505 INFO (MainThread) [supervisor.resolution.checks.base] Run check for ipv4_connection_problem/system
2024-05-09 17:10:14.506 INFO (MainThread) [supervisor.resolution.checks.base] Run check for trust/supervisor
2024-05-09 17:10:14.524 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_ipv6_error/dns_server
2024-05-09 17:10:14.632 INFO (MainThread) [supervisor.resolution.checks.base] Run check for free_space/system
2024-05-09 17:10:14.634 INFO (MainThread) [supervisor.resolution.checks.base] Run check for security/core
2024-05-09 17:10:14.636 INFO (MainThread) [supervisor.resolution.checks.base] Run check for no_current_backup/system
2024-05-09 17:10:14.638 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_failed/dns_server
2024-05-09 17:10:14.639 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/system
2024-05-09 17:10:14.640 INFO (MainThread) [supervisor.resolution.checks.base] Run check for docker_config/system
2024-05-09 17:10:14.641 INFO (MainThread) [supervisor.resolution.checks.base] Run check for pwned/addon
2024-05-09 17:10:14.641 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2024-05-09 17:10:14.642 INFO (MainThread) [supervisor.resolution.check] System checks complete
2024-05-09 17:10:14.642 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-05-09 17:10:14.879 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-05-09 17:10:14.880 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state running
2024-05-09 17:10:14.880 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
2024-05-09 17:12:36.233 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
2024-05-09 17:12:39.191 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/mattlongman/hassio-access-point repository
2024-05-09 17:12:39.197 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/aegjoyce/ha-addons repository
2024-05-09 17:12:39.206 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/adamoutler/HassOSArgonOneAddon repository
2024-05-09 17:12:39.213 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/music-assistant/home-assistant-addon repository
2024-05-09 17:12:39.228 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/joaofl/hassio-addons repository
2024-05-09 17:12:39.241 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/CoolKit-Technologies/ha-addon repository
2024-05-09 17:12:39.261 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/adamoutler/HassOSConfigurator repository
2024-05-09 17:12:39.285 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/esphome/home-assistant-addon repository
2024-05-09 17:12:39.308 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
2024-05-09 17:12:39.333 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/addons repository
2024-05-09 17:12:39.351 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/dianlight/hassio-addons repository
2024-05-09 17:12:41.928 WARNING (SyncWorker_6) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Hassio Hotspot
2024-05-09 17:12:41.931 WARNING (SyncWorker_6) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Linux Router
2024-05-09 17:12:42.472 WARNING (SyncWorker_5) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Hassio Hotspot
2024-05-09 17:12:42.475 WARNING (SyncWorker_5) [supervisor.addons.validate] Add-on have full device access, and selective device access in the configuration. Please report this to the maintainer of Linux Router
2024-05-09 17:12:42.498 INFO (MainThread) [supervisor.store] Loading add-ons from store: 99 all - 0 new - 0 remove
2024-05-09 17:12:42.499 INFO (MainThread) [supervisor.store] Loading add-ons from store: 99 all - 0 new - 0 remove
2024-05-09 17:13:10.060 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:14:12.350 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-05-09 17:18:10.062 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:23:10.058 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:28:10.055 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:32:37.459 INFO (MainThread) [supervisor.host.info] Updating local host information
2024-05-09 17:32:38.402 INFO (MainThread) [supervisor.host.services] Updating service information
2024-05-09 17:32:38.418 INFO (MainThread) [supervisor.host.network] Updating local network information
2024-05-09 17:32:38.810 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
2024-05-09 17:32:38.828 INFO (MainThread) [supervisor.host.manager] Host information reload completed
2024-05-09 17:33:10.057 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:38:10.048 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:43:10.062 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:44:23.248 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-05-09 17:48:10.058 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:53:10.056 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 17:58:10.054 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 18:03:10.054 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 18:08:10.055 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 18:10:14.883 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state running
2024-05-09 18:10:14.883 INFO (MainThread) [supervisor.resolution.checks.base] Run check for ipv4_connection_problem/system
2024-05-09 18:10:14.884 INFO (MainThread) [supervisor.resolution.checks.base] Run check for trust/supervisor
2024-05-09 18:10:14.901 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_ipv6_error/dns_server
2024-05-09 18:10:14.992 INFO (MainThread) [supervisor.resolution.checks.base] Run check for free_space/system
2024-05-09 18:10:15.993 INFO (MainThread) [supervisor.resolution.checks.base] Run check for security/core
2024-05-09 18:10:15.994 INFO (MainThread) [supervisor.resolution.checks.base] Run check for no_current_backup/system
2024-05-09 18:10:15.996 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_failed/dns_server
2024-05-09 18:10:15.997 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/system
2024-05-09 18:10:15.998 INFO (MainThread) [supervisor.resolution.checks.base] Run check for docker_config/system
2024-05-09 18:10:15.999 INFO (MainThread) [supervisor.resolution.checks.base] Run check for pwned/addon
2024-05-09 18:10:15.000 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2024-05-09 18:10:15.001 INFO (MainThread) [supervisor.resolution.check] System checks complete
2024-05-09 18:10:15.001 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2024-05-09 18:10:15.314 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2024-05-09 18:10:15.315 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state running
2024-05-09 18:10:15.316 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
2024-05-09 18:13:10.059 WARNING (MainThread) [supervisor.addons.options] Option 'mqtt_use_legacy_entities' does not exist in the schema for Samba NAS (1a32f091_sambanas)
2024-05-09 18:14:34.286 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token

Anything in the Host logs that might be useful for us?

2024-05-09 16:53:11.830 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up rpi_gpio platform for binary_sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 356, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/rpi_gpio/binary_sensor.py", line 77, in setup_platform
    RPiGPIOBinarySensor(
  File "/config/custom_components/rpi_gpio/binary_sensor.py", line 132, in __init__
    edge_detect(self._port, edge_detected, self._bouncetime)
  File "/config/custom_components/rpi_gpio/__init__.py", line 59, in edge_detect
    GPIO.add_event_detect(port, GPIO.BOTH, callback=event_callback, bouncetime=bounce)
RuntimeError: Failed to add edge detection

System information

System Information

version core-2024.5.2
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.28-haos-raspi
arch aarch64
timezone Europe/Athens
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4994 Installed Version | 1.34.0 Stage | running Available Repositories | 1394 Downloaded Repositories | 26
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.3 -- | -- update_channel | stable supervisor_version | supervisor-2024.05.1 agent_version | 1.6.0 docker_version | 25.0.5 disk_total | 457.7 GB disk_used | 26.2 GB healthy | true supported | true board | rpi4-64 supervisor_api | ok version_api | ok installed_addons | Duck DNS (1.17.0), Terminal & SSH (9.14.0), File editor (5.8.0), ArgonOne Active Cooling (30a), ESPHome (2024.4.2), Samba share (12.3.1), Mosquitto broker (6.4.0), Piper (1.5.0), Whisper (2.0.0), NGINX Home Assistant SSL proxy (3.9.0), eWeLink Smart Home (1.4.3), Samba NAS (12.2.0-nas2), Hass.io Access Point (0.5.2.1), EMQX (0.5.1)
Dashboards dashboards | 10 -- | -- resources | 12 views | 48 mode | storage
Recorder oldest_recorder_run | 1 Μαΐου 2024 στις 20:10 -- | -- current_recorder_run | 9 Μαΐου 2024 στις 16:53 estimated_db_size | 824.46 MiB database_engine | sqlite database_version | 3.44.2
Sonoff version | 3.7.3 (e240aaf) -- | -- cloud_online | 3 / 4 local_online | 1 / 1

Additional information

No response

JuMalIO commented 3 weeks ago

Having similar issue after sudo apt update -y && sudo apt upgrade -y on rasbian also

sairon commented 3 weeks ago

Duplicate of #3353.