I have an X728 v1.2 with a Raspberry Pi 4B, and I'm trying to get the whole system (both UPS and RPi) to power down in a safe manner.
I have a simple script of my own that is initiating an automatic shutdown of the UPS when it detects PLD for more than 20 seconds. It does this by setting GPIO 13 to high for four seconds to simulate a 4-second button press (just like x728softd. This causes the UPS MCU to instruct the RPi to commence shutdown, and then cuts the power.
The problem is that the UPS cuts power to the RPi before it has finished the shutdown! By carefully watching the HDMI output from the RPi I can see that the RPi is still in the process of unmounting filesystems and bringing down network interfaces when the power is cut. A complete RPi shutdown takes at least another 5 seconds, but it doesn't get that chance.
I understand that the MCU controls this wait time - can we have an update for the MCU that keeps power to the RPi for, say, a full 15 seconds after initiating shutdown? It seems too eager to cut the power.
Alternatively, there's actually a way for the MCU to determine when the RPi has completed shutdown, by monitoring the UART TX pin (needs the UART enabled in /boot/config.txt) - when the RPi has completed shutdown this pin is held low, so the MCU could watch it for a few seconds to confirm it is held low, then cut the power then.
Note: just shutting down the RPi on its own doesn't work for me, because the RPi is not powered off and therefore cannot power back up when the external power supply is restored. Also the batteries might end up over-discharged which is a fire hazard.