LED control via Octoprint?


If this is the wrong section please let me know and I will move.
I am thinking of setting up a webcam with my octoprint. I will need to control LED lights in order to see what is printing. My thought for this set up is the wire 12v DC lights from an inverter to a 3-way 12v switch. One position on the switch with direct on, so that if I am standing next to the printer I can turn the lights on and off. I want the other position to be wired in such a way that the circuit is controlled by the Raspberry Pi. I am wondering the following (there may be other things I am not thinking of)

  1. Is there a USB dongle that I can use to plug into the Pi that can power the LEDs on and off?
  2. Is there a way I can a button on the interface to turn the lights on and off when viewing remotely?
  3. Can I set up the software to turn the lights on automatically when I switch to the camera view?


Hi @BC320!

You can do this by using the Enclosure Plugin.
The LED can be switched on and off by a conventional or a solid state (MOSFET) relay.
Also o yo can attach a switch or a button to turn the lights on and off.
This is all realized with the GPIO pins of the Pi.

For switching on the light on (camera) demand, you can get more info here: