Skip to content

Failed to add edge detection #26

@djstarfox

Description

@djstarfox

Checklist:

  • [ X ] I updated to the latest version available
  • [ X ] I double-checked my hardware connections
  • [ X ] I checked that my MQTT broker is otherwise working

Release with the issue:
Latest release as of July 2025.

Last working release (if known):
N/A

Hardware, Operating System, Python version:
Raspberry Pi Zero 2 Wifi
Raspberry Pi OS Bookworm
Python3 3.11.2-1

Description of problem:
Python code crashes a few moments after startup.
RuntimeError: Failed to add edge detection

Line of code 1146 is breaking. Changing the GPIO value makes no difference. I've verified that GPIO 25 (BCM) is physically connected to the sensor. And I put pin 25 in the config.ini file.
Running as root makes no difference either.

Python errors shown in the logs (if applicable):

Traceback (most recent call last):
  File "/opt/lightning2mqtt/ISP-lightning-mqtt-daemon.py", line 1146, in <module>
    GPIO.add_event_detect(interrupt_pin, GPIO.RISING, callback=handle_interrupt)
RuntimeError: Failed to add edge detection

Additional information:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions