Page 1 of 1

Pause folding when on UPS

Posted: Mon Apr 21, 2025 2:09 pm
by targaryenturtle
Hello all!
I finally got a headless FaH client running in an LXC on my main Proxmox machine but I've got a small issue in that folding significantly reduces the runtime of my UPS. So, I figured, what if I just stop folding while the power is out? What I want to know is, is it possible to stop and start folding (the actual folding, not the folding client) using the CLI so I can have it stop folding when the power goes out and resume folding once the power has come back on? My only other idea right now is to shut down the folding client or LXC if the power goes out and restart it when the power comes back, but that would mean I would have to restart the folding manually.

Re: Pause folding when on UPS

Posted: Mon Apr 21, 2025 2:52 pm
by Joe_H
There is a machine setting to not run on battery. It is present in both v7 and v8 clients. It depends on your OS detecting the on battery state, usually through an USB connection. Folding should pause when the system is on battery, it has worked for me in the past on both desktop and laptop systems.

I haven't tried the v8 On Battery detection personally, it was not working in versions prior to v.8.3.2.

Re: Pause folding when on UPS

Posted: Tue Apr 22, 2025 6:42 pm
by targaryenturtle
Joe_H wrote: Mon Apr 21, 2025 2:52 pm There is a machine setting to not run on battery. It is present in both v7 and v8 clients. It depends on your OS detecting the on battery state, usually through an USB connection. Folding should pause when the system is on battery, it has worked for me in the past on both desktop and laptop systems.

I haven't tried the v8 On Battery detection personally, it was not working in versions prior to v.8.3.2.
I do see that option in the control panel, but I'm not sure that it will work in my situation.

A couple things I really should have clarified in my post:
1. I am running the FaH client in a Debian 12 LXC on Proxmox.
2. The Debian LXC is headless. It has no GUI and the FaH client is setup using the config.xml file.
3. My UPS is connected to Proxmox and is connected to a Network UPS Tools (NUT) server.
4. I tried adding the NUT client to the Debian LXC and while I am able to connect to the NUT server, the FaH client does not report the machine as having a battery.
5. I'd like to be able to manually start and stop folding if possible as I'd like to do things like pause folding when on battery, when the UPS runtime is too low, or when the load on the UPS is too high.

My only other idea right now is to use the NUT client to start and stop the FaH client / LXC and manually restart folding.

Re: Pause folding when on UPS

Posted: Tue Apr 22, 2025 6:59 pm
by muziqaz
sudo systemctl stop fah-client
sudo systemctl start fah-client
These might be of help. Otherwise, your system is too specific with too many obstacles for the dev to even consider implementing something you could use. I mean, not only you are on proxmox, but headless and also you are using UPS as battery on top of that.

Re: Pause folding when on UPS

Posted: Tue Apr 22, 2025 8:20 pm
by calxalot
fahctl -h

Re: Pause folding when on UPS

Posted: Tue Apr 22, 2025 10:03 pm
by targaryenturtle
calxalot wrote: Tue Apr 22, 2025 8:20 pmfahctl -h
Thank you! This is exactly what I was looking for! I needed Pip to install websocket-client to get it working, but I can now stop and start folding from the command line. I have modified my NUT config so it should run "fahctl pause" when the system goes on battery and, once power has been restored, waits 5 minutes before running "fahctl fold".
Going to have to wait till I get home to pull the plug and test it.

Will try to report back once I know if it works.