Want to run FAH only when plugged into a fast charger

Moderators: Site Moderators, FAHC Science Team

Post Reply
sssheridan
Posts: 4
Joined: Wed Mar 11, 2020 11:22 am

Want to run FAH only when plugged into a fast charger

Post by sssheridan »

Hey all,

I've got a laptop with an Nvidia card. My problem with GPU work units is that, on the go, I use a USB C charger or power bank with only 45W input. Since FAH sees that the computer is plugged in, it plows ahead; the GPU power consumption causes the CPU to throttle to 0.4 GHz, and the computer becomes unusable. Even if I only use CPU WUs, there's still the disadvantage of draining my power bank quickly. My patience with manually switching FAH on and off every time I move the computer is wearing thin.

What I'm looking for is some way to trigger FAH to run/pause based on the charger state. Windows is aware of the charger state: it gave me a "PC Charging Slowly over USB" notification (until I disabled it). So all I need is a setting or short script that will keep FAH paused when that state is present, just as it does when the laptop is on batteries.

As for myself, I'd be fine with a hacky solution, although I would suggest that making this an option (perhaps default), as for pausing while on battery, might be useful for an increasing number of users. High- and middle-end laptops sold these days tend to have USB C charging, and USB chargers have a range of power outputs. (In my case, my computer simply won't take more than 45W from USB, even if the charger is capable of more.)
Joe_H
Site Admin
Posts: 7946
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Want to run FAH only when plugged into a fast charger

Post by Joe_H »

Welcome to the folding support forum.

The default setting for the client is to pause when running on the battery. That can be overridden with a setting, but remains the default when the slider is set on the Light position. Adding a setting to detect the difference between being on a fast charger vs. a slow charging source might be possible, but would be a low priority for the developer.

Since Windows provides a notification about being charged "Slowly over USB" you might be able to script a solution. The FAHClient process can be accessed using the Telnet protocol on the local net address 127.0.0.1 on port 36330. Scripts have been posted here in the past to start, top and do other thing based on time or use of a game. Something along those lines could be modified

There is also an API for controlling folding. The page describing that is here - https://github.com/FoldingAtHome/fah-co ... Client-API. The API was provided for third party programmers to use for enhanced monitoring and control apps. A few have been created, for example HFM.net can keep track of multiple systems and keeps stats on what WU's have been folded and the points connected to them. Another allows control of folding client on the local network from an iOS device such as an iPad.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
Joe_H
Site Admin
Posts: 7946
Joined: Tue Apr 21, 2009 4:41 pm
Hardware configuration: Mac Pro 2.8 quad 12 GB smp4
MacBook Pro 2.9 i7 8 GB smp2
Location: W. MA

Re: Want to run FAH only when plugged into a fast charger

Post by Joe_H »

One additional note, there have been reports that the telnet provided by Windows does not work. Using another telnet client such as putty has worked.
Image

iMac 2.8 i7 12 GB smp8, Mac Pro 2.8 quad 12 GB smp6
MacBook Pro 2.9 i7 8 GB smp3
bruce
Posts: 20824
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: Want to run FAH only when plugged into a fast charger

Post by bruce »

I think it depends on your definition of "does not work"

The telnet output contains the Linux NewLine characters rather than the Windows CR/LF so the output is semi-impossible to read. There are methods to convert Linux text streams to Windows text streams. Putty is a very good alternative.
Post Reply