I added a mod to safely turn my printer on and off through OctoPi without tinkering in main powers. I’d like to share it with you.

First things first. Here is where I got the idea, so most credit goes to ArduinoSverige.HardwareHere is a list of what you need:Any 3D printerRaspberry Pi running OctoPrint433Mhz transmitter/switch(Link to Swedish/Norwegian reseller)(Link to similar product on Ebay)433Mhz Learning Receiver (Has to learn how to listen to any transmitter.)(Swedish/Norwegian reseller.)(Link to similar product on Amazon (US version))Relay. I used a 5V relay as they are most common.(Swedish/Norwegian reseller)(Link to similar product on Ebay)Transistor. I used an NPN 2N5088 which is easy to find on both Ebay and probably your local electronics shop.Jumper cables for the GPIO pinsHere is how I wired it all up.This is a schematic of the circuit. I had to use a transistor in order to push 5V to the relay, as the GPIO pins only deliver 3.3V. The right part of the schematic is my 433Mhz remote.Here’s and image of what it currently looks like for me, meaning you’ll be able to hide it almost anywhere.SoftwareI connected my relay to the GPIO17 pin, and here is the code I use in order to turn it on. Link to PastebinHere is the script for turning it off. Link to pastebinAnd here is a second script for turning it off with a delay, as Octoprint seems to send out the finished command before the end Gcode is being sent. Link to pastebinIn order to add these commands to Octopi, you have to SSH into the pi. While inside the pi, change your directory to ‘.octoprint/’ and edit a file called ‘config.yaml’. If you aren’t familiar in the Linux terminal, here are the commands for that:cd .octoprint nano config.yaml While in the document you should find a lined called system, followed by actions. Add the end of this image, so that the result becomes similar to thisIf you only want to be able to remotely power it on or off, you’re done here. But if you want the printer to turn off after a finished print, you’d want to add the following to the end. The entire ‘events’ part isn’t included, so you’ll have to add it.I hope what I’ve written is coherent enough to understand. If you have any questions, feel free to ask me and I’ll try to answer them to the best of my knowledge.Happy printing! http://ift.tt/1URciXj

Leave a Reply