Custom control rpi gpio possible?

Can custom controls also control rpi gpio's?

Not out of the box. There's several plugins that allow you to control the GPIO pins in several ways. OctoPrint itself is cross-platform, if there is something specific then it is always going to be implemented as a plugin, not part of core.

Thanks for the answer.
Does any plugin have a possibility to be triggered by a custom control?

My intent is to get my LED-Stripes I use for camera in to the octopod interface on and off.
Octopod has custom controls implemented. So it would be easy if I can chain CC to any plugin that does GPIO. Or if I could do a shell call (echo "1" > /sys/class/gpio/gpio21/value) somehow.

To do that job I'm using the GPIO Control plugin and a little DIY hardware.
Leds_Control

Thanks for the reply.
Custom Controls are in the core of octoprint and not as plugin. Therefor they can be handled by any client useing the standard API while plugins are not exposed and therefore can not be used on clients like octopod. (iphone app)

Right now I am doing the same as you by useing GPIO addons.
It has the drawback that i have to switch from octopod to the octoprint-webclient to turn on my lights… No big deal, but unnecasary.

I am asking here, if there is any way to get custom controls to execute scripts…

OK, I got it now.
I will be attentive to any possible answers because the subject interests me.

Found a solution for that.
edit your /home/pi/.octoprint/config.yaml and add something like this

system:
  actions:
  - action: printer_on
    command: gpio export 4 out && gpio -g write 4 1
    name: Ligar Impressora
  - action: printer_off
    command: gpio export 4 out && gpio -g write 4 0
    confirm: Este comando desliga a impressora.
    name: Desligar impressora
  - action: divider
  - action: LedON
    command: gpio export 17 out && gpio -g write 17 0
    name: Acender luz
  - action: LEDOFF
    command: gpio export 17 out && gpio -g write 17 1
    name: Apagar luz

In my case I use GPIO 3 to ON/OFF the printer and GPIO17 to control LED.
You can also control it in octopod.

1 Like