The GPIO interface allows you to connect physical buttons to your Raspberry Pi running the 3DPrinterOS Client. This makes it possible to trigger basic actions such as Cancel or Send Bed Clear directly from the printer without using the web dashboard. It can also drive a status LED.
1. How to Enable
To enable the GPIO interface, locate the parameter enabled in the "gpio" section of your configuration file and change its value from false to true.
You can edit this file directly in the 3DPrinterOS Client interface:
Main Screen → Settings → Edit settings file
Example:
"gpio": {
"bouncetime": 100,
"buttons": {
"cancel_locally": 29,
"send_bed_clear": 33
},
"enabled": false,
"leds": {
"bed_not_clear": 40
},
"pull": "up",
"trigger": "falling"
}
The buttons and the LED act only on the printer connected to the Client running on this same Pi. A printer connected through another machine's Client will not respond.
2. Default Wiring
Pin numbering uses the physical layout (BOARD numbering) of the Raspberry Pi GPIO header, not the BCM numbering scheme used in code.
Cancel button: connect between pins 29 (GPIO5) and 30 (GND)
Send Bed Clear button: connect between pins 33 (GPIO13) and 34 (GND)
Each button connects a GPIO pin to ground when pressed.
No 3.3 V or 5 V pins are required for this setup.
3. Wiring Recommendations
If you experience unexpected or spontaneous button activation, try the following:
Use shorter wires to reduce signal noise.
Keep the Raspberry Pi with GPIO enabled away from strong electromagnetic sources (motors, generators, fridges, etc.).
Place a 100 nF capacitor as close as possible between the GPIO and GND pins for each button to improve signal stability.
4. Schemas
Below are the recommended connection diagrams for Raspberry Pi 3 Model B V1.2:
5. GPIO Output (LED Indicator)
The Client can also drive a GPIO output to power a status LED. One output is currently supported, bed_not_clear, mapped by default to pin 40 (GPIO21). It is configured in the "leds" object inside the "gpio" section of the settings file.
To change the output pin, edit the value inside "leds":
"leds": {
"bed_not_clear": 40
}
Connect the LED anode (long leg) through a 100 to 200 Ohm resistor to pin 40 (GPIO21), and the cathode (short leg) to pin 39 (GND). Almost any standard indicator LED works with a resistor anywhere in this range, and only the brightness changes.


