1. Got a question or need help troubleshooting? Post to the troubleshooting forum or Search the forums!

Can I program the RPi to shut down after a print?

Discussion in 'Software' started by Jeff Lastofka, Mar 23, 2018.

  1. Jeff Lastofka

    Jeff Lastofka Member

    Joined:
    Feb 21, 2016
    Messages:
    62
    Likes Received:
    25
    I'd like to be able to use a remote WiFi outlet to power down the printer later in the day when away from home after a print finishes and I won't be back for hours and hours. I'd rather not just kill the power without doing the proper software shutdown first. I know we can add custom G-codes after a print, but that won't talk to the RPi if I'm thinking right.
    I've programmed different computers over the years, including a little on the RPi, but I haven't gotten around to looking into this one yet. If someone points me to an easy answer, that's the first choice. Second choice is some more digging into this.
     
  2. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,521
  3. Jeff Lastofka

    Jeff Lastofka Member

    Joined:
    Feb 21, 2016
    Messages:
    62
    Likes Received:
    25
    Thank you very much. I'd rather start with some sites like probably those last two, recommended by someone playing around in this area as opposed to just diving in somewhere at random:)
     
  4. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    369
    Likes Received:
    97
    mark tomlinson likes this.
  5. Jeff Lastofka

    Jeff Lastofka Member

    Joined:
    Feb 21, 2016
    Messages:
    62
    Likes Received:
    25
    Thanks, it sounds like what I was looking for. I also see there's apparently an option to turn on web access to the Octoprint controller itself, so maybe I can just log into it and shut down from the menu. I'll try that first.
     
  6. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    369
    Likes Received:
    97
    I have to be honest. I use a local machine at my house running some Remote Desktop connection-like software. (The one i use is called parallels access). Anyway, I don’t like to open my firewall up too much, so one machine, only allowed from a certain subnet of IP addresses is my preference



    Sent from my iPad using Tapatalk Pro
     
  7. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,521
    Please note that these Raspbian coomands do not actually shutdown the printer, only the rPi. So the printer is in the same state that the LCD shutdown command puts it in with a black screen but not actually off. If you are fine with that then... nevermind.
     
  8. supercazzola

    supercazzola Active Member

    Joined:
    Jun 1, 2017
    Messages:
    369
    Likes Received:
    97
    True. One thought, could we use a PWM servo to somehow cut the power and control it though some M355 commands ?


    Sent from my iPad using Tapatalk Pro
     
  9. WheresWaldo

    WheresWaldo Volunteer ( ͠° ͟ʖ ͡°)
    Staff Member

    Joined:
    Feb 18, 2015
    Messages:
    5,806
    Likes Received:
    3,521
    Possibly. I have never wanted to do that so I haven't investigated the feasibility.
     
  10. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,138
    Likes Received:
    6,997
    Yes, that will work
     
    supercazzola likes this.
  11. drbanks

    drbanks Active Member

    Joined:
    Dec 29, 2017
    Messages:
    141
    Likes Received:
    39
    Seems like a WEMO plug or some other remotely controllable power relay socket would be sufficient for that, but definitely lacking in the cool factor of a PWM service controlled by a GCode command.

    Although the problem with gcode is that it isn't going to give the rPi a chance to do its orderly shutdown and after the orderly shutdown relaying gcode becomes a lot more difficult
     
  12. mark tomlinson

    mark tomlinson ༼ つ ◕_ ◕ ༽つ
    Staff Member

    Joined:
    Feb 21, 2013
    Messages:
    21,138
    Likes Received:
    6,997
    Tag the gcode to a relay that inputs to the Pi which then does a shutdown and at the tail end outputs to a second relay :)

    Mode complicated, but hardcore.
     
    supercazzola likes this.

Share This Page