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:
I found Phil Randal's blog at http://www.philrandal.co.uk/blog/archives/2019/07/entry_214.html,
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!
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.
BeantwoordenVerwijderenYes the script does not work as it is :(
BeantwoordenVerwijderenThanks for the git link works PERFECT now :D
BeantwoordenVerwijderenHappy to hear it!
Verwijderen