Hey,
In my project, when the main power is down, I want the Raspberry pi to show a message, close some programs safely, and then shut down. Then, once I connect the main power again, the pi turns on automatically. That means I don't want to interact with the onboard button since the pi will be closed in a case. I referred to the Hardware documentation (https://wiki.geekworm.com/X708-Hardware) and could enable the automatic switch on when I connect the power, but that only happens when the X708 hat is off. Showing a message and shutting down the Pi is simple, but my problem is turning off the x708 ups hat.
My problem now is how to switch the hat OFF through the software so that when I connect the power again, the pi will automatically turn on. I referred to the Software documentation (https://wiki.geekworm.com/X708-Software), followed the directions, and repeated many times, but the "x708off" doesn't switch the hat OFF. When I run it on the command line, I get "X708 Shutting down..." but the x708 is still ON even after the command finishes running. I uninstalled and reinstalled the files many times, but the same thing happened every time.
I2C is enabled, and I can detect when the power is lost, but I can't switch off the x708. Also, when I run "plsd.py", it gets stuck at "Shutdown in 5 seconds", but it never shuts down.
I appreciate your help,
I'm using Raspbian GNU/Linux 10 (buster) on raspberry pi 4