Looking for API Event to GPIO plugin

Surely someone has made this already?

Looking for a plugin that sets GPIO HIGH/LOW when an API event fires (such as print done, print started, print failed, etc).

Example: Print is done, GPIOx is set HIGH. I can then use that as a trigger in some PLC automation ideas I am working on.

Suggestions?

Hello @probably.intelligent !

You may have a look on this:

You may also look into PSU Control.

No plugin with this exact type of functionality that I know of but if you can write a simple Python script to do what you want and call it using event subscriptions which are in core.

https://docs.octoprint.org/en/master/events/

There are a few options on this one that look promising! I'll try it out today and see. Thanks!

Thanks! I have this one for turning on/off my printer, but it doesn't do quite what I need for this request. Appreciate the consideration!

Thanks! will dev if I need to, but I'm all about not reinventing the wheel - especially if someone already built a plugin.

I wrote some simple stuff in the past e.g.

  • sending printer events through MQTT
  • switching a GPIO depending to a temperature.

bring some of this stuff together in your own python file depending to your needs is not reinventing the wheel. You'll just need to know some basic stuff e.g. chapter1 of this Doc: Plugin Tutorial β€” OctoPrint master documentation. The rest can be pulled from existing plugins.

totally agree, thanks!

I'm working with the exact same thing! Maybe this could be of interest: GPIO Control

How did it go?

I checked out the recommended plug ins and they are awesome, but not quite what I'm looking for.
Switching gears and using GCODE System Commands, with WiringPi and some BASH scripts. I think it will work nicely.
There must be a nuance to the System Commands that I haven't figured out though. If I add OCTO100 (my command linked to BASH), in the gcode or in the startup scripts, I'm getting an error. But the log file only says.. wait for it...
"Error".
LOL so helpful.
No worries though, I'll figure it out!

Don't

http://wiringpi.com/wiringpi-deprecated/

GAH!! Not sure how I missed that. Thanks!