Powering on using TP-Link smart Plug

  • Hello friends,
    First of all, please pardon my poor english, French is my native language πŸ™‚

    I'm new to Duet, and I'm trying to make my Duet Wifi mobo powering on my printer. I know it's possible with an ATX Supply... but I have no ATX PSU at the moment.

    I don't know how it Octoprint exactly works, but my Octoprint server manage to send M80 commands to wake up my printer, via a TP-LInk smart Plug and a special plugin.

    Could DWC possibly do the same? That would be great.
    Thank you very much for your advice.

  • administrators

    It would be possible, but it would require some code to be added to DWC to control the Smart Switch. I found some Python code at https://github.com/softScheck/tplink-smartplug that could be translated into Javascript for use in DWC.

    I'll alert chrishamm to this request (he maintains Duet Web Control).

  • you could set up an openhab instance on a raspberry pi.
    use the gpio plugin to read the ps_on signal from the duet.
    then use the TP-Link Smart Home Binding to turn on the plug.

  • @dc42 Thanks you so much, that would be great. We are numerous using the Tplink plug with our Cr10 printers here in France. πŸ˜€πŸ˜€πŸ˜€

  • @veti thank you for your answer but it seems a bit complicated to me as I have no idea of how to do that concretelyπŸ˜ŸπŸ˜‰

  • Maybe I'm missing something here but why not simply plug the printer in via the smartplug and use your smartphone or even better Alexa to turn the printer on & off. That's what I do, before I go to my workshop I say "Alexa, turn on workshop" and everything that's plugged in via a smartplug switches on. Of course I can control each smartplug individually too.
    Another advantage is that I can leave the workshop with the printers finished printing but with the hotend fan still running while the printers cool down and turn everything off later. Previously I'd wait, twiddling my thumbs, until the hotend had cooled down before switching off for the night.

  • Hello,
    The interest is to switch power off automaticly with a simple M81 gcode command when print job is finished. You can also switch it off in case of emergency even when not at Home.

  • I might be missing something, but can't you assign a PS_ON pin in RRF?
    DWC seems to know about 'ATX Power On' and Off on my setup.

    That pin then needs to drive an external relay. Problem is the pin is 3.3V and most relay modules are 5V. There might be a similar 3V trigger one, but I already had the 5V one.

    So I use the pin output to control the gate on a mosfet to drive the relay board. Just like the Duet HW schematic.

    Here is my current setup for controlling my ATX controlled printer-

    alt text

    I use the same setup to control a opto-coupled relay like this one to control a Meanwell psu on a different printer.

    alt text

    The 5V realy can be triggered either high or low. I use it to control the mains voltage to my printer.

  • @sinned6915 said in Powering on using TP-Link smart Plug:

    That pin then needs to drive an external relay. Problem is the pin is 3.3V and most relay modules are 5V. There might be a similar 3V trigger one, but I already had the 5V one.

    On a duet PS_ON is driven by a mosfet last time I checked? Think v0.6 and v0.8.5 could only switch about 5V but duet 2 had no problem switching 24VDC force guided safety relays once flyback dioded were added.

    ...I will however now go away and check!

    Edit: Page 3 of the Duet2wifi 1.4 schematic shows a PMV40UN2 which is rated for 30V gate - source.


    That'll be a bit dejavu for someone on here because I had advised to use a relay in order to sink anything over 5V using the PS_ON and they posted more-or-less the above verbatum!

  • umm, the schematic in the pic i posted is a snip from the Duet 2 wifi schematic.

  • @sinned6915 that diagram wasn't loading when I commented, maybe an issue my end. Either way I'm not sure I follow the need for the extra external electronics?

  • Thank you very much for your answers.... There are already several discussions on the forum about using an ATX power supply Or a Meanwell PSU to remotely power the printer on/off... but the original subject was about powering on/off using a TP Link smart plug... (wich means having a plug'n'play solution, with no need to have any special skills in electronics) πŸ˜‰

  • Octoprint and the TP-Link plugins use python scripts and API keys to manage the smart plug.

    If you want to use the DWC capability to remotely turn off and turn on the printer then you must use a hardware device wired to the board to control a device.

    If you already use Octoprint and the TP-link plugin, then why don't you just keep using it? PSU control and TP-Link will still work the the Duet board connected via USB.

Log in to reply