Luke Cyca .com

Reviving an ancient APC AP9211 MasterSwitch PDU for HomeAssistant

The MasterSwitch AP9211 by APC is a simple PDU (power distribution unit) that is basically an overbuilt power bar designed for enterprise network rack cabinets in data centres and whatnot. This particular one has a AP906 network management card, providing a bit of smarts that allows it to turn each outlet on and off over a network. Even though this device is 20+ years old and is available for almost free at your local electronics recycler, its modest purpose is just as relevant now as back then. I scavenged this from a pile of e-waste, and want to use it as smart outlets for HomeAssistant.

Getting Started

This forum post has all the details for connecting, resetting its password, etc. Mine seemed to already be reset to factory defaults, so I connected it directly to my laptop's ethernet port, and then ran `tcpdump` to observe its network chatter and determine its IP address. Then I reconfigured my interface to the same subnet, and was finally able to connect using apc/apc.

HomeAssistant and SNMP

There was already some discussion about how to switch PDUs from SNMP in HomeAssistant, but it was for a different model and the OIDs were different. After much web searching and dusting of cobwebs, I found the appropriate MIB documentation for this model of PDU. Here is my configuration, which goes in `configuration.xml`. There is one stanza for each port on the PDU.

        switch:
        - platform: snmp
            name: pdu1-1
            host: 192.168.12.34
            community: [redacted]
            version: "1"
            baseoid: 1.3.6.1.4.1.318.1.1.4.4.2.1.3.1
            payload_on: 1
            payload_off: 2

        - platform: snmp
            name: pdu1-2
            host: 192.168.12.34
            community: [redacted]
            version: "1"
            baseoid: 1.3.6.1.4.1.318.1.1.4.4.2.1.3.2
            payload_on: 1
            payload_off: 2

        ...
        

Recapping

Just after I tidied up the wiring and had considered this project done, I noticed that the device would periodically become unresponsive. If HomeAssistant tried to do an automation while the device was offline, it would be skipped. Pinging the device for 24 hours straight revealed that it was offline nearly 50% of the time, for tens of minutes at a time.

I tried changing configuration, shutting off services in this ancient firmware such as telnet, ftp (!), and the like. I tried reflashing the firmware. I considered thermal issues (and used my new-to-me Flir thermal camera). I even considered reverse engineering the electronics and creating a ESP32 retrofit, keeping just the relays, outlets, and the chassis.

On a hunch, I replaced these two capacitors on the onboard AP9606 network management card. That fixed it! Not the tidiest job, as the only capacitors of suitable value that I only had on hand were through-hole, and I lifted a trace while removing the old ones. But it'll do.
Luke Cyca .com