Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pironman 5 case fans always on in the last butterfly + wrong filesystem reported by the case display #13091

Open
ZeroNoRyouki opened this issue Dec 20, 2024 · 4 comments

Comments

@ZeroNoRyouki
Copy link

Batocera build version

41 2024/12/17 02:17 (butterfly)

Your architecture

Raspberry Pi 5 B 1.0

Your Graphic Processor Unit(s) (GPU)

integrated VideoCore VII

Issue description

in V40, the pironman 5 case RGB fans turned on only if the Pi temperature required it, after installing V41 they are always active from the get-go

The "free drive space" reported by the case LCD display is the one of, I think, the root filesystem (about 256 MB free) which is not that usefull: it should report the free space of /userdata (I was told by the pironman support guys to report this to you guys)

Detailed reproduction steps

n/a

Details of any attempts to fix this yourself

I've reinstalled the pironman 5 services in V41 (see below)

Details of any modifications you have made to Batocera.

I've installed (first in V40 and then again in V41 butterfly) the pironman 5 services as detailed here: https://docs.sunfounder.com/projects/pironman5/en/latest/set_up/set_up_batocera.html

Logs and data

No response

@ZeroNoRyouki
Copy link
Author

ZeroNoRyouki commented Dec 30, 2024

I found a bit of time today to debug the fan problem, starting from this error from the pironman5 service:

24/12/30 13:40:57.991 [DEBUG] FanControl init
24/12/30 13:40:57.992 [DEBUG] Init GPIO Fan with pin: 6
/usr/lib/python3.11/site-packages/gpiozero/devices.py:295: PinFactoryFallback: Falling back from lgpio: 'can not open gpi
warnings.warn(
GPIO Fan init error: Cannot determine SOC peripheral base address
24/12/30 13:40:58.035 [WARNING] GPIO Fan init failed, disable gpio_fan control

I've traced it back to a problem in gpiozero : gpiozero/gpiozero#1166

The proposed workaround of symlinking /dev/gpiochip4 to /dev/gpiochip0 seems to do its job: the RGB fans are now off. The PWM fan is now recognised by the kernel correctly too (something that was not happening since I've installed V41 but I didn't notice before):

cat /sys/class/thermal/cooling_device0/cur_state
1

cat /sys/devices/platform/cooling_fan/hwmon/*/fan1_input
768

Both were 0 before creating the symlink. I'll keep an eye the fans and how they respond to changes in the temperature of the Pi

@ZeroNoRyouki
Copy link
Author

ZeroNoRyouki commented Dec 30, 2024

The fans works fine, they respond correctly to temperature changes.

Fixed the oled problem too:

[root@BATOCERA /usr/lib/python3.11/site-packages/pm_auto]# diff pm_auto.py.ORG pm_auto.py
174c174
<         disk_info = get_disk_info()
---
>         disk_info = get_disk_info('/userdata')

@jlm70
Copy link

jlm70 commented Jan 28, 2025

Hi @ZeroNoRyouki!
Thanks for your suggestions: for v41 I've the very same problems.
I'm not a super expert of linux, but I tried following your suggestions.

In the first case I did modify the pm_auto.py file... inserting '/userdata' at line 174.
But, after a reboot, my NVME 1TB SSD still reads as a 256MB one.
I looked back at the pm_auto.py file and... is back as the original one (while I did save my changes, closed vi editor, loaded it again and the new string was there... so... is the RPi restoring the original file at start? I entered as root so...)
Is the system in a sort of read only mode?

For the second hint, instead, I tried to issue the command:
ln -s /dev/gpiochip0 /dev/gpiochip4

But my two "cats" still reply with 0. And the fans are always on.

Any hints? Super thanks

@ZeroNoRyouki
Copy link
Author

ZeroNoRyouki commented Jan 28, 2025

Hi there.
Batocera is restoring the file on boot. What I did, as a quick and dirty fix, was storing a copy of the modified pm_auto.py file in a directory under /userdata and running a couple of scripts at startup.

cat /boot/postshare.sh <-- this is executed after Batocera has mounted /userdata, it just execute the second script

/userdata/system/fixes/pironman5/pironman5_fix.sh

cat /userdata/system/fixes/pironman5/pironman5_fix.sh <-- this one creates the symlink and copy over the modified .py file

#!/bin/bash
# pironman5 temp fix

ln -s /dev/gpiochip0 /dev/gpiochip4

cp --force /userdata/system/fixes/pironman5/pm_auto.py /usr/lib/python3.11/site-packages/pm_auto/pm_auto.py

ciao
Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants