Possible to set GPIO state by printer status?

I have a beacon light and a musical announciator laying around, and I want to use them to indicate the status of the printer. I designed some circuit to interface them and now they can be operated by toggling GPIOs. The problem is seems like the enclosure plugin does not have a "printer status input". Is there any other plugin that can do this, or do I need to write my own? In fact I am looking into plugin development since I wanted some more features including make beacon not only light up but also flash, trigger different tunes of the announciator, one-button muting, etc. I just wanted to make sure I don't reinvent the wheel.

Maybe this does what you want :slight_smile:

Just add the action command to the start / end gcode :slight_smile:

Thanks, seems like it still does not satisfy my need. Maybe I'll try to do my own plugin.

Update: Seems like no custom plugin is needed, I can just use Event Hooks to trigger an external script to do the communication with other devices.

1 Like

IΒ΄m trying to do this right now. I have a very old main board which can only control one fan.

So I have connected my hot end fan to a relay connected to my raspberry pi, which I as of now can control with a button in octoprint.

I would however want the fan to turn on after say printing has passed 1-2%.

@whc2001 would you mind sharing how you do this with Event Hooks? :slight_smile:

There are usually two fans located near the nozzle. One is a part cooling fan and the other is often called a hot end fan but its job is to keep the heat from reaching the cold side of the extruder.

The hot end fan should be on all the time at full speed (in reality, it could be turned off when the hot end is at room temperature, but most printers just turn it on with the printer and turn it off when the printer is turned off).

The part cooling fan needs to be controlled and most controller boards have at least one fan output that can be used for this job. The M106 S0-255 gcode command is how slicers communicate with the firmware to control this fan. All the slicers I'm familiar with have the ability to set the fan speed based on layer number or z height.

If, however, you want to control the fan from the RPi, I wrote the plugin OctoPrint-FanSpeedMirror which will monitor the gcode stream for M106 (and M107) commands and pass the S parameter to a user written script on the RPi.

I have two fans connected to a hat on my RPi that add extra part cooling.