COMPLETE Cheap, simple, quick installed OctoPi "always on" solution

Discussion in 'Guides, Mods, and Upgrades' started by Alex9779, Apr 7, 2016.

  1. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    I mentioned it earlier here in the forums and on G+ I think but here is it described with links and stuff, hopefully to be followed by word and working afterwards.

    There is a more sophisticated solution out there by @JvdP I think he only posted on G+ yet, see here.

    What you need

    Connecting the transmitter to the Pi
    To connect the transmitter to your Pi you need three jumper cables. Colour does not matter, I used red for power, black for ground and white for signal.
    1. Connect the 'VCC' or '+' PIN of the transmitter with a 5V output of the Pi (PIN 2 or 4 of the GPIO).
    2. Connect the ground 'GND' PIN of the transmitter to a ground PIN of the Pi (PIN 6, 9, 14, 20 or 25 of the GPIO).
    3. Connect the signal 'DATA' PIN of the transmitter to the Pi PIN 8 of the GPIO.
    Here a picture:
    RPi 433 MHz cabling_Steckplatine.png
    In the picture the transmitter has 4 PIN, you might get one that has only three. The froth is to connect the optional antenna. If yours has only three then there is somewhere on the transmitter board a solder point where you have to solder the antenna.

    Preparing the Pi

    To be able to only switch our printer off you have to supply your Pi with extra power. Normally the BigBox is designed to supply the Pi from the main PSU so if you use the main switch of you printer your printer AND the Pi turn off.
    That is what the extra power supply for the Pi is needed for.
    Just unplug the Pi from the internal power converter and connect the external power supply to it. I pulled the cable through the USB port cut out on the backside:
    IMG_0529.JPG IMG_0530.JPG

    Installing software packages
    You have to install additional software packages on your Pi. For this to do you need to open a terminal session with your Pi. On Windows use putty, on Mac you can use the terminal app.

    Once connected install the following packages:

    • git (for getting the packages)
    • WiringPi
    • Raspberry-Remote
    Here are the commands to get and build all the packages:
    Code:
    apt-get install git-core
    cd
    git clone git://git.drogon.net/wiringPi
    cd wiringPi
    ./build
    cd
    git-clone git://github.com/xkonni/raspberry-remote.git
    cd raspberry-remote
    make send
    sudo cp send /usr/local/bin/
    Configure the outlets
    The outlets should have DIP switches to configure their system code and their unit code. Normally there are 5 switches for each:
    IMG_0528.JPG
    In my case they are labelled 1-5 for the system code and A-E for the unit code.

    Set the system code to whatever you want.

    Normally the unit code can be 1 to 5, if you switch A on it is 1, B on is 2 and so on.
    Set the outlet's unit code to some value.

    Take care you don't use those codes on any other system you might be using at home or your neighbour or someone else could accidentally switch on and off you outlets!

    First test

    Plug in the outlet and open again a terminal connection to your Pi.
    With the following commands you can switch on and off the outlet (system code 01010, unit code 1):
    Code:
    sudo send 01010 1 1 // switch on
    
    sudo send 01010 1 0 // switch off
    You should hear or see the outlet switches on and off when firing one of the commands. Some outlets have an indicator. If not you can plug in a lamp or something to see if it is working.


    Commands for OctoPrint
    To be able to switch your printer on and off from OctoPrint you can add system command to OctoPrint or add commands to the control tab. Whatever you like.
    For adding system commands I recommend using the "System Command Editor" plugin.
    For adding commands on the control tab I recommend using the "Custom Control Editor" plugin.

    I added system commands with a confirmation for turning off:
    Bildschirmfoto 2016-04-07 um 11.07.05.png Printer on.PNG Printer off.PNG

    Conclusion
    This way you can switch on and off your printer from OctoPrint.
    OctoPrint will be always on.
    It is cheap (the
    components cost me about 30 € and I had 3 transmitters, 3 outlets), fast to install and easy to set.

     
    JvdP and Miasmictruth like this.
  2. Miasmictruth

    Miasmictruth Well-Known Member

    Joined:
    Sep 4, 2015
    Messages:
    758
    Likes Received:
    112
    Very nice! I may have to add this to my BigBox second upgrade pass!
     
  3. JvdP

    JvdP Well-Known Member

    Joined:
    Aug 3, 2014
    Messages:
    56
    Likes Received:
    22
    Nice mod, great writeup!

    My advice after my mod is to also build a "manual switch" because sometimes you want to simply turn it on when you stand in front of it ;-).

    What I did is wire a push-button) to one of the Pi's GPIOs that would listen for a connection. If contact is made (button is pushed) it will switch the relay and boom, BigBox goes on!
     
  4. Alex9779

    Alex9779 Moderator
    Staff Member

    Joined:
    Sep 4, 2015
    Messages:
    2,405
    Likes Received:
    731
    @JvdP I have that somehow with my mod too.
    Raspberry-Remote support two modes for numbering the outlets.
    The "normal" mode is what you use if you just use the outlets with the supplied remote control. Then you can have up to 5 outlets per system code, either one of the unit switches is on, all others are off. My supplied remote control only has support for up to four outlets though.
    The other mode you can use is "binary" then you can have more outlets in one system code but you can't use the supplied remote control.

    For me I thought 5 (4) are enough at the moment, and you can still use just another system code, then you can use the remote control too.

    So if I stand in front of the box and want to turn it on I use the remote control.
    Buttons A are for my UM2, B for the BigBox.
     
  5. Stian Indal Haugseth

    Stian Indal Haugseth Well-Known Member

    Joined:
    Sep 11, 2015
    Messages:
    573
    Likes Received:
    95
    I like this idea as well. As I have an home automation system with z-wave I thought using a Qubino dual relay as they run on 24V. It also measures the power used. As long as I can get a low signal from RPI I can trigger the Qubino the same way you are talking about.

    The issue is the relay can handle 10A and the RUMBA hot bed input is rated max 11A. I could use two relays, one for the 11A input and one for the 5A input. Or if I do not care about power measurement I could just wire a bigger external relay. I will probably add a 230V wall plug as well and get power measurement from there.
     

Share This Page