FoldingAtHome / fah-client-bastet

Folding@home client, code named Bastet
GNU General Public License v3.0
74 stars 12 forks source link

"While on battery" toggle not working #240

Closed wvm4 closed 6 months ago

wvm4 commented 6 months ago

On lenovo ideapad 5 pro running ubuntu 23.10, does not pause when on battery power.

local logs sometimes show "has battery" as false and sometimes as true, not sure if it changes depending on if AC power is connected or depending on which WU the log is part of; most recent one had GPU WU as false and CPU WU as true.

On battery is always false.

Web interface machine details shows both as false, while on battery is set to false.

00:20:23:I1:WU2:**** System **** 00:20:23:I1:WU2: CPU: AMD Ryzen 7 7840HS with Radeon 780M Graphics 00:20:23:I1:WU2: CPU ID: AuthenticAMD Family 25 Model 116 Stepping 1 00:20:23:I1:WU2: CPUs: 16 00:20:23:I1:WU2: Memory: 27.18GiB 00:20:23:I1:WU2:Free Memory: 26.10GiB 00:20:23:I1:WU2: Threads: POSIX_THREADS 00:20:23:I1:WU2: OS Version: 6.5 00:20:23:I1:WU2:Has Battery: true 00:20:23:I1:WU2: On Battery: false 00:20:23:I1:WU2: UTC Offset: 2 00:20:23:I1:WU2: PID: 1424 00:20:23:I1:WU2: CWD: /var/lib/fah-client/work 00:20:23:I1:WU2:****

jcoffland commented 6 months ago

The messages from the core about the battery status are not important. E.g. those prefixed with something like 00:20:23:I1:WU2:. The WU part indicates it's from the core not the client. The only battery messages that matter are those from the client which you can see at the beginning of the log in the first "info" block.

What do you see when you run this command?:

ls /sys/class/power_supply
wvm4 commented 6 months ago

This: wvm@laptop:~$ ls /sys/class/power_supply ADP0 BAT0

wvm4 commented 6 months ago

Just checked the first info block in the logs and that one has "Has Battery" as false:

02:14:47:I1:* System ** 02:14:47:I1: CPU: AMD Ryzen 7 7840HS with Radeon 780M Graphics 02:14:47:I1: CPU ID: AuthenticAMD Family 25 Model 116 Stepping 1 02:14:47:I1: CPUs: 8 02:14:47:I1: Memory: 27.18GiB 02:14:47:I1:Free Memory: 23.18GiB 02:14:47:I1: OS Version: 6.5 02:14:47:I1:Has Battery: false 02:14:47:I1: On Battery: false 02:14:47:I1: Hostname: laptop 02:14:47:I1: UTC Offset: 2 02:14:47:I1: PID: 5188 02:14:47:I1: CWD: /var/lib/fah-client 02:14:47:I1: Exec: /usr/bin/fah-client 02:14:47:I1:***

jcoffland commented 6 months ago

Thanks for the feedback. The issue is that the client is looking for the name AC or AC0 instead of ADP0. I've updated the code. The v8.3.15 release will have this fix. Unfortunately, I don't have any way to test it so please report back. The new alpha release will be available with in the next hour.

wvm4 commented 6 months ago

Thanks, will do later today

jcoffland commented 6 months ago

v8.3.15 is available now. https://foldingathome.org/alpha/

wvm4 commented 6 months ago

Doesn't seem to be fixed yet, "Has Battery" is still false and it still continues to fold when I remove AC power. Don't see any other changes in the logs.

jcoffland commented 6 months ago

Can you post the output of these commands?:

cat /sys/class/power_supply/ADP0/type
cat /sys/class/power_supply/ADP0/online
cat /sys/class/power_supply/BAT0/type
wvm4 commented 6 months ago

Here you go: wvm@laptop:~$ cat /sys/class/power_supply/ADP0/type && cat /sys/class/power_supply/ADP0/online && cat /sys/class/power_supply/BAT0/type Mains 1 Battery

wvm4 commented 6 months ago

This was with AC connected, if I disconnect it before the command the 1 becomes a 0

jcoffland commented 6 months ago

That just how it's supposed to work. Must be something else.

jcoffland commented 6 months ago

I think I've fixed it this time. Try v8.3.16: https://foldingathome.org/alpha/

wvm4 commented 6 months ago

Yes, it works now

jcoffland commented 6 months ago

Great. Thanks for the report and testing.