Skip to content

danieleborgo/OctoPrint-ShutdownButtonLEDBuzzer

Repository files navigation

ShutdownButtonLEDBuzzer

This OctoPrint plugin implements a shutdown physical button for the Raspberry Pi. It offers also a status LED to know when OctoPrint is ready and a buzzer to signal the startup and the shutdown. Remember that these signals may vary of few seconds.

By default, this plugin shuts down the Raspberry without checking of there are ongoing jobs. In settings, there is a flag to disable the button when printing.

Compatibility

The plugin automatically selects the correct GPIO driver based on the OS version:

  • periphery — for Raspberry Pi OS Bookworm (2023) and newer, including Raspberry Pi 5. Uses the modern character device interface (/dev/gpiochip0, or /dev/gpiochip4 on Raspberry Pi 5).
  • gpiozero — for Raspberry Pi OS Bullseye (2021) and older. Requires the legacy sysfs interface.

Auto-detection is the default and works in most cases. If needed, the driver can be overridden in the Advanced Settings section.

python-periphery is a required dependency. gpiozero is optional and only needed on older systems:

pip install "OctoPrint-ShutdownButtonLEDBuzzer[gpiozero]"

Notes

To shut down the Raspberry, it uses the command configured in OctoPrint settings.

This plugin supports both active and passive buzzers. By default, it assumes to have an active one.

The internal pull-up resistor for the button is applied automatically on kernels ≥ 5.10. On older kernels an external pull-up resistor on the button pin is required.

Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/danieleborgo/OctoPrint-ShutdownButtonLEDBuzzer/archive/master.zip

Circuit

The circuit hereafter exposed is just the one set by default, since the plugin allows to edit each of these pin:

  • Button: by default directly on pin GPIO26
  • LED: by default on pin GPIO6
  • Buzzer: by default on pin GPIO13

In case one of these features is not needed, it can be deactivated by the apposite settings section.

Always remember to properly check each connection, using the official datasheet, before turning on the Raspberry.

circuit

Configuration

This plugin offers several configuration parameters, accessible in the apposite OctoPrint section in setting:

settings1 settings2 settings3

PCB

There are KiCad PCB files available in case you want to make your own PCB. A bill of materials (BOM) can be found in the according folder.

pcb1 pcb2

FAQ

What resistor does it need to use?

There is no a precise resistor needed, since it depends on how much light is needed. Despite this, it is suggested to use a value at least of few thousands of ohms. Always remember to check the connections and the datasheet.

Which buzzer does it need?

The plugin supports both active that passive buzzer, but it is necessary to configure them by the settings panel.

Which LED does it need?

A 5 mm LED is a good option, and it is usually in Arduino kits. In case a different one is attached, check that the current it needs is lower than the one a Raspberry pin can give.

License

This software is distributed on GPLv3.0, more information available in LICENSE.md.

About

This OctoPrint plugin implements a shutdown physical button for the Rasperry Pi, with a buzzer and a status LED.

Topics

Resources

License

Stars

Watchers

Forks

Contributors