Concept for DYI PDUs: Use ESP8266/ESP32 with ESPHome as PDU für Raspberry PI 4

I started setting up a home lab using cheap WiFi smart plugs as PDU with a custom power driver for x86 thin clients. I’d love to get that merged in time for MAAS 2.9. Any sponsors out there?

I have ordered some Raspberry PI 4 and would love to use ESPs as PDU with a small state machine to achieve soft power off with a hard timeout.

Does hooking an ESP8266 to the 40-pin header for

  • 3.3V power (pin 1),
  • ground (e.g. pin 6),
  • gpio-shutdown (pull pin 5 from up to down to initiate shutdown),
  • gpio-poweroff (pin 26 transitions from low to high at the end of the shutdown)
    and adding a state machine - with a watchdog timer for hard power off - to turn the simple “on/off” signal from MAAS into a “proper PDU” sound like a workable plan?

I’m still scratching my head about the chicken/egg issue with the RPI powering the ESP that will cut it’s power. I think I’ll end up with a separate 5V+3.3V PSU that powers both devices.

If you have a managed switch with PoE, perhaps a PoE hat for the rpi4 would mitigate the chicken/egg construct.

So long as you have power to the switch - and remote access to said switch - the ability to turn on/off the rpi4 seems feasible.

That’s a good idea, too. I have Unifi PoE switches, like other users interested in using RPI4. I’m happy to test a Unifi PoE power driver.

But then I’m back to hard power cuts :slight_smile: