I suppose you could use a command like this just to try it out briefly with no need for further typing:
vcgencmd display_power 0;sleep 10;vcgencmd display_power 1
Well, yes, there is that. :-)
-Rus.
I suppose you could use a command like this just to try it out briefly with no need for further typing:
vcgencmd display_power 0;sleep 10;vcgencmd display_power 1
Well, yes, there is that. :-)
-Rus.
Turning off your monitor on the remote machine? SSH works fine in that situation.
Russel,
That would indeed be a way to test if vcgencmd command works.
Though the problem is its suggested use, not the command itself.
Although you did not mention it, I take it you picked up on that just disabeling HDMI output doesn't cause my TV to switch back to its previous input. Which means that that vcgencmd doesn't seem to be the sought-for solution (and nullifies the need to test it).
Regards, Rudy Wieser
Lawrence,
What are you talking about ? A "remote machine" ? This is about my RPi and the TV its connected to, with both being located directly next to each other. Nothing "remote" about that.
Also, I think I made quite clear that I *didn't* want my TV to be turned off. Just for it to switch to its previous inputs when the RPi is shut down.
As it looks as if we are not quite understanding each other maybe you could explain how your "SSH" suggestion is supposed to work ?
Regards, Rudy Wieser
I understand your position, and you're almost certainly right. I have to admit, I hadn't previously realised the full implications of this thread as a whole.
-Rus.
I just asked ChatGPT if it knew an answer, and it did (not that I am certain if it works):
Yes, it is possible for a Raspberry Pi to send a signal to a TV to switch the HDMI input before shutting down. This can be done using CEC (Consumer Electronics Control), a feature available through HDMI that allows devices to communicate with each other and exchange basic control commands.
Here’s how you can do it:
Check if the TV supports CEC: Not all TVs support CEC, and it may be branded under different names like "Anynet+" (Samsung), "BRAVIA Sync" (Sony), "Simplink" (LG), etc.
Install CEC tools: On the Raspberry Pi, you can install the cec-utils package, which includes a tool called cec-client. This tool allows you to send CEC commands.
bash Code kopieren sudo apt-get update sudo apt-get install cec-utils Send CEC commands: You can use cec-client to send various commands to the TV. For example, to instruct the TV to switch to a different HDMI input, you can use specific CEC commands.
Create a script: You can create a simple script that sends the CEC command when the Raspberry Pi is about to shut down. For example:
bash Code kopieren #!/bin/bash echo "as" | cec-client -s The command echo "as" | cec-client -s tells the CEC client to switch the active HDMI source.
Execute the script on shutdown: To automatically run the script when the Raspberry Pi shuts down, you can add it to the /etc/rc.local file or create a Systemd service.
Keep in mind that the exact commands and setup may vary depending on your TV model and the supported CEC functions. It's a good idea to refer to your TV's manual for specific information about its CEC support.
-jw-
Joerg,
[snip]Thank you for that extensive answer. Andy Burns also mentioned that "cec-client" program, but having a bit more info about it is always good.
By the way, I'm curious :
was that the first answer it gave, or did you have to hit "refresh" a couple of times ?
Regards, Rudy Wieser
Joerg,
A partial success. After having installed the cec-client software I was able to do a scan and switch the TV off (meaning : the TV does respond to CEC commands).
However, the "as" argument didn't seem to do anything.
I also tried a few "tx" arguments (found on the Web) with the TV (0.0.0.0) as the target but could not evoke a back-to-tuner-input response either.
Any idea(s) ?
Regards, Rudy Wieser
apt install cec-client
You'll then need to find the commands change the source, which will depend on your TV. Pages such as this may help
---druck
Oops, that should be cec-utils
The one you are SSHing to.
Lawrence,
I have no idea what you are saying here. I'm supposed to be "SSHing" ? Whats that and how am I supposed to be doing it ?
And I still don't get the "remote machine" part. I think I already mentioned that I've got an RPi which is sitting under my TV at about 3 to 4 meters away. Not what I would call remote.
Wait a minute ... You keep saying "remote machine". Maybe you do that to differenciate it from other (nearer?) machines. But if so, what have those machines (wherever they are) got to do with anything ?
Regards, Rudy Wieser
The answer may be buried here ... but buried quite deep ...
The first answer, which appeared immediately, was in German, so as a second I just said "Now the whole thing in English".
-jw-
Druck,
Thank you. Joerg Walther posted a bit more extensive instructions to install the utils, and as such that part went without a hitch.
[snip]:-) It so happens I found the same page.
But alas, neither the "as" command nor the "tx" commands I tried caused the TV to switch back to its own tuner.
Remark: the "scan" as well as the "standby 0" worked fine (meaning: the TV does understand CEC)
Yesterday I didn't think of it, but today I'm going to switch my DVR on as well (so the TV has two HDMI sources) and see if I can get the TV to switch to the DVR and back- just to make sure the "swich to" command(s?) are actually understood.
Regards, Rudy Wieser
Joerg,
Thanks.
Though I was curious if it perhaps gave responses which where not quite as usable (rubbish perhaps?) as the one you posted (I heard about an AI's capacity to "halucinate").
Regards, Rudy Wieser
Andy,
Thanks. I have seen it mentioned elsewhere a few times too.
But to go hunt for something that /may/ be in there while not even being sure if I would be able to recognise it if it would slap me in the face isn't quite my cup of tea I'm afraid.
I'll just keep googeling for a while, and, nonwithstanding how well I could use it, drop the whole thing if nothing turns up.
Maybe my (oldish) Philips TV simply isn't able to do it ... :-(
Regards, Rudy Wieser
I think the whole "SSH distraction" arose when someone suggested a command which would disable the HDMI output, then a command to undo it, and someone wondered how you'd type a command when you couldn't see what you were typing because the screen would be black ... I think most people could manage to type a command "blind" to re-enable the screen, but then someone suggested you could SSH to the Pi from somewhere else to type the command to re-enable the screen
Sorry I've not go the patience to go back and read the thread to see who the various "someones" were ...
The less info there is available online on any given subject the more likely it is that the machine is going to make up information because in its very depths it is supposed to keep up some chatty behaviour.
-jw-
Andy,
I, the OP, was
...
I seem to have a couple of years of experience with myself (duh :-) ), and have noticed that I am /very/ likely to make typos when trying to do that. Even to lauhghable proportions when I'm tired.
But thats not the point.
The one suggesting it was Lawrence. And his whole suggestion was exactly four characters, "SSH?". IOW, not having /any/ of the info you, in the above, have provided (and he still hasn't by the way).
After which I wrote that that would be solving one problem but by it creating another.
Based on his responses I had to conclude that Lawrence has absolutily no idea what I'm talking about, so I asked him to explain his solution. Hey, perhaps his SSH solution is different from the one I know, and cannot ever be(come) a problem.
I'm still waiting for that explanation though, as no matter how strongly I indicated I need some he refuses to supply it. All he's posted is a few words which start with "SSH" - without any explanation to them - and a few iterations of "remote machine" - again, without a sliver of explanation of what it is or how its supposed to be used.
So yes, there is a distraction going on, but it isn't the "SSH?" suggestion one itself (it might have worked in quite a few circumstances). Its Lawrence there verbally dancing around, trying to evade having to say anything at all. Why ? Only he knows.
... Though my guess is that he doesn't actually know much of anything about it. Just some "big words" he tried to impress me with.
Regards, Rudy Wieser
Have something to add? Share your thoughts — no account required.
Ask the community — no account required