DietPi icon indicating copy to clipboard operation
DietPi copied to clipboard

Out of the box support for case fans?

Open privacyguy123 opened this issue 3 years ago • 13 comments

Creating a bug report/issue

Required Information

  • DietPi version | G_DIETPI_VERSION_CORE=8 G_DIETPI_VERSION_SUB=4 G_DIETPI_VERSION_RC=2 G_GITBRANCH='master' G_GITOWNER='MichaIng'
  • Distro version | bullseye 0
  • Kernel version | Linux DietPi 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux
  • SBC model | RPi 4 Model B (armv7l)
  • Power supply used | ThePiHut 5v
  • SD card used | SanDisk Ultra 32GB

Additional Information (if applicable)

  • Software title | WiFi Hotspot + Pi-hole
  • Was the software title installed freshly or updated/migrated? Freshly installed
  • Can this issue be replicated on a fresh installation of DietPi? Yes

Steps to reproduce

  1. Plug in case fan. (https://thepihut.com/products/raspberry-pi-4-case-fan)
  2. It doesn't work.

Expected behaviour

  • The fan should work ...

Actual behaviour

  • It doesn't work. Pulling my hair out with these fiddly bugs ... enough to make me want to go back to Raspbian even if it is more bloated. 😞

privacyguy123 avatar May 05 '22 14:05 privacyguy123

Did you set respective configuration to control the fan? https://github.com/MichaIng/DietPi/issues/4003#issuecomment-751254845

echo 'dtoverlay=gpio-fan,gpiopin=14,temp=60000' >> /boot/config.txt

Joulinar avatar May 05 '22 14:05 Joulinar

Works with option but seems to ignore the settings?

Almost feels as if it's overriden to go full speed? It's SO loud.

privacyguy123 avatar May 05 '22 15:05 privacyguy123

Did you try to change the GPIO pin, if that setting is respected? And the temperature is definitely lower? vcgencmd measure_temps

MichaIng avatar May 05 '22 16:05 MichaIng

did you reboot after setting the value?

Joulinar avatar May 05 '22 17:05 Joulinar

Did you try to change the GPIO pin, if that setting is respected? And the temperature is definitely lower? vcgencmd measure_temps

It does seem to be in GPIO pin 14 though - isn't that correct? Yep, temps sitting at 47 and it's going full blast.

did you reboot after setting the value?

Yep.

privacyguy123 avatar May 05 '22 19:05 privacyguy123

It does seem to be in GPIO pin 14 though - isn't that correct?

When you change the pin and re-attach the fan (the TX cable) accordingly, it still works? So only the temp option is ignored, not the gpiopin option.

MichaIng avatar May 07 '22 10:05 MichaIng

It does seem to be in GPIO pin 14 though - isn't that correct?

When you change the pin and re-attach the fan (the TX cable) accordingly, it still works? So only the temp option is ignored, not the gpiopin option.

I guess so yes, the fan is stuck on at full speed it seems.

privacyguy123 avatar May 08 '22 11:05 privacyguy123

Just to rule it out, could you try to enable dbus and systemd-logind?

apt install dbus
systemctl unmask systemd-logind
systemctl start systemd-logind

MichaIng avatar May 09 '22 06:05 MichaIng

Marking as closed. Feel free to reopen if required.

MichaIng avatar Jul 23 '22 12:07 MichaIng

Reopening - now this, much quieter fan, also doesn't work. The script claims it can only be installed in RPI OS but I've made a python virtual environment to run the script in and it installs fine ... yet the fan won't listen to the script commands.

https://learn.pimoroni.com/article/getting-started-with-fan-shim

privacyguy123 avatar Aug 12 '23 17:08 privacyguy123

@MichaIng

privacyguy123 avatar Aug 12 '23 18:08 privacyguy123

If the script does not run on DietPi, I guess some setup steps are missing, likely the correct GPIO/overlay configuration. But we should be able to simply hack DietPi support inside, since DietPi on RPi is RPi OS in all relevant parts.

The script tries to install it as Python 2 module on all systems but Bullseye. So it has never been updated to be made compatible with Bookworm and any newer Debian distro. And another problem I see, while it installs it as Python 3 module on Bullseye, it creates the configuration variables by using the python (Python 2) command, which of course cannot work: https://github.com/pimoroni/fanshim-python/blob/master/install.sh

So it requires some fixes/updates, but I do not see where it claims to only support RPi OS?

MichaIng avatar Aug 19 '23 14:08 MichaIng

@privacyguy123 Is this still an issue? If so, can you try to download the script and change python to python3 in this line: https://github.com/pimoroni/fanshim-python/blob/master/install.sh#L45C1-L45C12

MichaIng avatar Jan 16 '24 16:01 MichaIng

Marking as closed due to outstanding reply. Feel free to reopen if required.

MichaIng avatar Jul 11 '24 20:07 MichaIng