perfect...underlying error...
2025-10-03 06:36:43,119 - octoprint.plugin - ERROR - Error while calling plugin physicalbutton
Traceback (most recent call last):
File "/opt/octopi/oprint/lib/python3.11/site-packages/octoprint/plugin/__init__.py", line 285, in call_plugin
result = getattr(plugin, method)(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/octopi/oprint/lib/python3.11/site-packages/octoprint/util/__init__.py", line 1692, in wrapper
return f(*args, **kwargs)
^^^^^^^^^^^^^^^^^^
File "/opt/octopi/oprint/lib/python3.11/site-packages/octoprint_physicalbutton/__init__.py", line 25, in on_after_startup
setup_buttons()
File "/opt/octopi/oprint/lib/python3.11/site-packages/octoprint_physicalbutton/lib/gpio_setup.py", line 18, in setup_buttons
new_button = Button(button_gpio, pull_up=True, bounce_time=None)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/devices.py", line 108, in __call__
self = super(GPIOMeta, cls).__call__(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/input_devices.py", line 414, in __init__
super(Button, self).__init__(
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/mixins.py", line 433, in __init__
super(HoldMixin, self).__init__(*args, **kwargs)
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/input_devices.py", line 171, in __init__
self.pin.when_changed = self._pin_changed
^^^^^^^^^^^^^^^^^^^^^
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/pins/__init__.py", line 432, in <lambda>
lambda self, value: self._set_when_changed(value),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/pins/pi.py", line 319, in _set_when_changed
self._enable_event_detect()
File "/opt/octopi/oprint/lib/python3.11/site-packages/gpiozero/pins/rpigpio.py", line 226, in _enable_event_detect
GPIO.add_event_detect(
RuntimeError: Failed to add edge detection
searching that error on the issue tracker led to this post, which points to possible solution here, which seems to indicate you need more than just one Environment variable in the service config.
Environment="GPIOZERO_PIN_FACTORY=lgpio"
Environment="LG_WD=/tmp"
which was also mentioned in this post.
so in theory...
-
Step 1: SSH to pi
-
Step 2: Run these commands to add the service overrides
sudo mkdir -p /etc/systemd/system/octoprint.service.d/
echo -e '[Service]\nEnvironment="GPIOZERO_PIN_FACTORY=lgpio"\nEnvironment="LG_WD=/tmp"' | sudo tee /etc/systemd/system/octoprint.service.d/gpio-env.conf
sudo systemctl daemon-reload
-
Step 3: Validate the override
sudo systemctl cat octoprint

-
Step 4: Stop the service, reinstall the dependencies, start the service
sudo systemctl stop octoprint
source ~/oprint/bin/activate
pip install --upgrade lgpio
pip install --upgrade gpiozero
deactivate
sudo systemctl start octoprint