Doorgaan naar hoofdcontent

[RPi4][ Using the PiMoroni Fan Shim on LibreElec including the LEDs!

I recently bought a brand new Raspberry Pi 4, and wanted to try Kodi on it.
There is only one Kodi-distribution which has more or less decent support for RPi 4 at the moment, and that's LibreElec (although still Alpha).

Since the RPi 4 is famously overheating and throttling without a fan or at least a heatsink, I got a PiMoroni Fan Shim. Nice piece of hardware, but their library cannot run on LibreElec, because they do not support installing python libraries through pip etc... On LibreElec, the whole rootfs is a read-only squashfs image.

So there's no way you can install the Pimoroni python library on LibreElec, but I found an alternative:
where he described how to get at least the Fan portion of the Fan Shim working on LibreElec.

I decided to build on that, and port the LED functionality to LibreElec as well, without the need for "pip install" or anything not supported.

First, you need to install the Raspberry Pi Tools addon in LibreElec.
-> Addons / install from repository / libreelec add-ons / program add-ons / Raspberry Pi Tools.
Then, use these script below to have Fan + LED control on your LibreElec RPi4.

Save it as /storage/fanshim.py,
$ chmod +x /storage/fanshim.py

Then edit /storage/.config/autostart.sh so it contains the line:
nohup /storage/fanshim.py &

Reboot your Pi 4 for it to take effect.

You can find the code here:
https://gist.github.com/maximevince/2257338ea8f97dfdea7dd91656443352

Enjoy!

Reacties

  1. Hello! Could you please share the code using some online code sharing tool ? Like gists.github.com for example. Because there are indentation issues that break your python script.

    BeantwoordenVerwijderen
  2. Yes the script does not work as it is :(

    BeantwoordenVerwijderen
  3. Thanks for the git link works PERFECT now :D

    BeantwoordenVerwijderen

Een reactie posten

Populaire posts van deze blog

Arch Linux: Fixing empty/blank windows for graphical applications that require root

When running applications such as "unetbootin" or "tuxboot", you might get a blank window, instead of the actual application. Even when running it through "gksudo", or having a decent polkit running (e.g. inside Gnome). E.g.: This is because these application use MIT_SHM (Shared memory), which for some reason does not work when running graphical applications as root, while being logged in as a regular user in X. The solution is to disable MIT_SHM. E.g.: $ sudo QT_X11_NO_MITSHM=1 tuxboot

The excellent JTAGenum for Arduino

As I said before, I've been fiddling with finding the JTAG port on a Verbatim PowerBay NAS. I did not succeed (yet), but have had the chance to try out JTAGenum for Arduino. It is an excellent JTAG pin finder (and other things too). Check it out here: http://deadhacker.com/2010/02/03/jtag-enumeration/ The guy's description of the tool is: 1. Given a large set of pins on a device determine which are JTAG lines 2. Enumerate the Instruction Register to find undocumented functionality 3. be easy to build and apply It's really easy to use, but it did not manage to find the JTAG pins on my device. There might be another problem, such as: - JTAG is disabled once the device is powered up - The pins I'm fiddling with are not JTAG pins - I ruined the circuitry already - I'm just not trying hard enough Back to JTAGenum: Since Arduino IDE 1.0.1 , some things have changed and so the GIT version of JTAGenum would not compile as-is. Therefor the JTAGenum sketch had