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

kodi on raspberry pi display_power command gives exception #8

Open
rocus opened this issue Jul 21, 2019 · 6 comments
Open

kodi on raspberry pi display_power command gives exception #8

rocus opened this issue Jul 21, 2019 · 6 comments
Labels
question Further information is requested
Milestone

Comments

@rocus
Copy link

rocus commented Jul 21, 2019

I use this plugin to switch off my TV. The only method that works is turning the display_power off. I confirmed this on the command line of the raspberry: vcgencmd display_power 0. The plugin gives an error message when it cuts the display_power:

NOTICE: [Turn Off] Turn display signal off using method 2
ERROR: [Turn Off] Exception running 'vcgencmd': [Errno 2] No such file or directory
When I change in the screensaver.py (the python file of this plugin) the lines "vcgencmd display_power 0/1" the text "vcgencmd" in "/opt/vc/bin/vcgencmd" the plugin works correctly.

@unalterable
Copy link

try creating a symbolic link where it expects vcgencmd to be:

sudo ln -s $(which vcgencmd) /usr/bin/vcgencmd

I believe this addon was made for raspbian and libreelec which store the vcgencmd in /usr/bin/vcgencmd. But OSMC and some other OSs install vcgencmd in: /usr/bin/vcgencmd

Looking at the code, i can't see why this error occurs - but the symbolic link worked for me.

@rocus
Copy link
Author

rocus commented Aug 13, 2019

You made a "small" typo at the end of your reply,"unalterable". OSMC install vcgencmd in the directory /opt/vc/bin. In a shell this directory is in the path. In Kodi it is apparently not. My solution was a change in the python file itself but your solution is the better one. (because updates destroy my solution)

By the way, I am not completely satisfied with this screensaver solution to turn of my TV.
If the display power of the raspberry is turned off, the TV set shuts down (goes into standby) after some time and that is what I want.

But I prefer to turn off the TV with the CEC command but that does not work. I use Yatse as the remote for my Kodi raspberry and now the question is: who's fault is it. I would like to make a small (python) program that is supposed to send the "turn off" command to the TV set. I have sent an email to the TV maker support group but they answered with the suggestion to turn on the CEC command mode. If I had not done that already .

I could not find much documentation on this subject. Do you know of a simple program that sends CEC commands to the TV set? I am inclined to say the TV set is at fault and not Kodi. But I would like to have "hard" evidence.

Thanks very much.

@rocus
Copy link
Author

rocus commented Aug 13, 2019

To answer my own question: the raspberry and other linux systems have a tool cec-client that lets you control an attached TV. Because I am now not near my TV set I can not see results but because I can reach my OSMC / Kodi raspberry over the internet I can see the TV responds to the cec-client commands. To be continued...

@dagwieers
Copy link
Collaborator

I don't want to exclude CEC bugs (or incompatibilities) on Raspberry Pi, but some devices simply do not support CEC (like computer monitors or some TVs) or in some cases CEC is undesirable (projectors) and being able to remove the HDMI signal does work fine in those cases.

@dagwieers
Copy link
Collaborator

The problem with your PATH and Kodi is that Kodi was not started from a normal shell, and therefore does not get the same PATH (usually a very dumbed down PATH).

You have to report this to your Kodi platform upstream or packager so they can include a more extensive PATH so Kodi add-ons can find those useful tools. IMO these tools ought to go into standard binary paths (/bin or /usr/bin) rather than anything custom though.

@FallingSnow
Copy link

Adding the following to /etc/environment places /opt/vc/bin in all environments.

PATH=/opt/vc/bin

@dagwieers dagwieers added the question Further information is requested label Oct 27, 2019
@dagwieers dagwieers modified the milestones: v0.10.1, Future, v0.11.0, v0.10.2 Oct 29, 2019
@dagwieers dagwieers modified the milestones: v0.10.2, v0.11.0 Nov 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants