Turn on light at start of print

Hi All,

Newbie here, making progress, and want more! This is a lot of fun!

I have an Ender 3 and a RPI 3 B+

Running Octoprint 1.4.2

Downloaded Enclosure plugin. Looking for a tutorial, or could you please tell me, on how to connect/configure a light that I can control with Octoprint.

I would like it to turn on at the beginning of a print, and stay on afterwards, until I turn it off. And then be able to turn it on remotely, randomly.

I've got a PhD in the "wrong" subject, so I'm not stupid, but in this subject area ... trainable:)

Thank you in advance for your help!

This is easy with WS281x LEDs, because you can use my plugin. Not sure how good the features are for the enclosure plugin to do that, what kind of LEDs do you have?

1 Like

I haven't purchased the LEDs yet.

Happy to use your plugin!

Can you post a parts list and procedure, please?


You'll need some WS2811/WS2812/SK6812 LEDs - also known as Neopixels. You can get them quite cheap direct from China if you want, or the Neopixel name is from Adafruit.

Other thing is an additional 5V power supply for more than a couple LEDs, since the Pi cannot provide much power for them.

Usually that's all you need, but sometimes extra bits like a level shifter are necessary. See the setup guide, or more specifically wiring your LEDs for the full details.

Then you can add the command @WS_LIGHTSON to your start gcode script, to turn them on at the start of the print, or configure the 'idle' effect to be off so that they are only on when there is a print in progress. There are buttons in the UI for control, as well as compatibility with the M150 Control plugin. There's a lot more you can do, from adding scripts to OctoLapse for timelapses, and enabling a torch mode, go and have a look around the wiki I linked above.


Awesome! Thanks! Be in touch .... (while I hope only to say success!).

1 Like

I would imagine you could use a buck converter to step down the voltage from your PSU then wire the lights to the Pi as illustrated in the link above. It would require a Y to tap into the PSU and the buck converter but it would save an extra wall plug. My BTT TFT35 E3 touch screen has buttons to change the color of lights which makes me think the SKR mini E3 might be able to control the lights too?

It can support LEDs connected directly to the board, yes, although the firmware does not do as many things as you can do through OctoPrint.

1 Like

I need the Stribes with controller - right? Like this:


Those are right, yes. There is a list in the plugins documentation, under either wiring or LED Strip configuration.

Hi Charlie,

This is working! Let me tell you, to be able to get a biologist to do this, you're a genius. Thank you!

1 Like

You've motivated me! I currently have two 12 Volt LED strips powered off the PSU through a buck convertor. I just bought some 12 Volt addressable LEDs and a spool of blue 24 gauge wire for the Din connection. I already have Dupont connectors and a crimper so the plan is to switch out my LED strips for the addressable ones. The # LEDs per cm is the same as the old strips. I will switch over the 12 volt power and ground to the new LEDs, add a second ground to the GPIO and the DIN wire to the gpio and hopefully the new LEDs will be controllable. I already use the pin 6 to ground the RPi fan but as I recall there are one or two other ground pins on the GPIO.

There are actually multiple ground wires. I'll report back in a few days. Is the light control strictly by adding the gcode before printing or is there a plugin also involved?

How necessary is it to add the IC or the diode, especially since I chose 12 voltWS2811 LED strips? That seems to add another level of complexity in that as you said you can't leave them on a breadboard and the only other way I've used components before has been with PCBs which I do not have.

WS281x LED Status is the plugin - find the plugin homepage where there is more details, a setup guide with wiring diagrams etc.

1 Like

The extra wire came Monday and the WS2811s came yesterday. I had two sets of non-addressable lights running off the PSU before-one on a printed bracket that snapped onto the back of the x gantry and the other on a bracket that screws into the part cooling fan next to the part cooling diverter. The bank of lights on the x gantry were easiest so I started with that first. If I were to do it all over again I would probably look for WS2812B lights with 144 LEDs/meter. The WS2811s need to be cut in groups of three LEDs which means I have to either resize my brackets or do with less LEDs. The higher density WS2812Bs give more light and one can always turn down the brightness in the plugin if they are too bright. You can’t make up for too few LEDs. Anyway, I got all the wires soldered together and slapped the bracket on and powered my baby up and nothing happened:-(. Then I realized I forgot to plug the power cord into the PSU. Once I did that I got the rolling red disco lights. I went into the setup and made a few adjustments and now I have a white light that goes on when I push the tab and off when I push it again. That’s enough for tonight. Maybe in a day or two I’ll tackle the bank of lights on the hot end. Thanks for the cool plugin. I’m not using very many of its features but it is pretty slick.