How to read a power loss pin in firmware?

I have tried Repetier-Server Rescue mode. It doesn't seem to be able to detect power outages immediately. After I cutted down the power of printer, I found the server still sending commands to the printer. So I try to use a extra power monitoring module for 3D Printer to do that.

https://usa.banggood.com/Dlion-5V-UPS-Power-Monitoring-Module-For-3D-Printer-Part-p-1354115.html

It has two signal pins. One pin is power loss output singal, another on is input single to control power.  Can Repetier firmware read this power loss signal and tell the Repetier Server? How to configure? Thanks for help.

Comments

  • From the official config with comments it is visible and documented:

    /** Enable rescue system that helps hosts to reconnect and continue a print
    * after a disconnect. */
    #define HOST_RESCUE 1
    /** What to do if power loss during print is detected.
    * 0 = just stop where you are,
    * 1 = raise z only
    * 2 = go to safety park position
    * Increasing value needs more remaining time with power. USV is required
    * normally to be able to handle this.
    */
    #define POWERLOSS_LEVEL 0
    // Pin that signals power loss, -1 = off
    #define POWERLOSS_PIN -1
    // State to signal power loss
    #define POWERLOSS_DETECTED 0

    That is all related to power loss detection. Important for server is that HOST_RESCUE is set to 1.
  • Repetier said:
    From the official config with comments it is visible and documented:

    /** Enable rescue system that helps hosts to reconnect and continue a print
    * after a disconnect. */
    #define HOST_RESCUE 1
    /** What to do if power loss during print is detected.
    * 0 = just stop where you are,
    * 1 = raise z only
    * 2 = go to safety park position
    * Increasing value needs more remaining time with power. USV is required
    * normally to be able to handle this.
    */
    #define POWERLOSS_LEVEL 0
    // Pin that signals power loss, -1 = off
    #define POWERLOSS_PIN -1
    // State to signal power loss
    #define POWERLOSS_DETECTED 0

    That is all related to power loss detection. Important for server is that HOST_RESCUE is set to 1.
    Thanks. I thought there was no such function because I didn't see this parameter in the configuration tool
  • Not sur eif I have it in there. Is quite new.
Sign In or Register to comment.