add-ons / screensaver.turnoff

Kodi screensaver that turns your screen off to save power
Other
21 stars 14 forks source link

No Signal on Raspberry Pi (using vcgencmd) doesn't work on Kodi 18 on RPi #7

Open begasslmaier opened 5 years ago

begasslmaier commented 5 years ago

"Error 2 File not found" is reported. Changing screensaver.py to contain the full path "/opt/vc/bin/vcgencmd" makes it work, so this path might not be included in the command search path.

dagwieers commented 5 years ago

I guess it depends on the platform, as I use it like this on LibreELEC:

LibreELEC (official): 9.0.2 (RPi2.arm)
kodi01:~ # which vcgencmd
/usr/bin/vcgencmd

And this is why we don't put an absolute path in the command.

u-quark commented 2 years ago

Not adding the full path to the vcgencmd command is the right call. The problem is that the environment variable PATH seems to not have the correct value when the plugin runs. Not sure why or where is the right place to change that. On OSMC Released 2022-03-14 with a Pi 4 when I ssh the $PATH includes: /usr/osmc/bin:/opt/vc/bin while PATH from inside the plugin python code does not include those. Given OSMC is quite popular on RPi, consider altering PATH to include those paths in the plugin code, something like:

import os
os.environ["PATH"] += ':/usr/osmc/bin:/opt/vc/bin'

A bit of a hack but I think it is worth it.

th3gr33n commented 1 year ago

vcgencmd doesnt work anymore with newer Kernels see https://github.com/raspberrypi/firmware/issues/1740 https://forums.raspberrypi.com/viewtopic.php?t=331817

could u implement a replacement ? because right now there is now way in Kodi to turn HDMi off it seems