Disable/Enable network by power state?



  • Hello,
    because I'm having issues with the wifi autoconnect, I would like to do a temporary workaround.

    I'm powering my duet separated from the main power. And my main power is automatically shuting down when power is below a certain level for a set period of time.

    My idea was to disable networking with M552 S-1 when power is lost and enable when power is present. I saw the M911 command for power loss, so i could do like M911 R23.0 P"M552 S-1" to shutdown network when power is down.

    But I havent found a way to run a code after power is present.


  • administrators

    There isn't a command run when power is restored.

    One option would be for you to arrange for a spare endstop input to be triggered when VIN power is applied or removed. That could be done using an NPN transistor and 2 resistors. Then you could set up M581 triggers to act on changes to that endstop input state.


Log in to reply