1

So I have managed to control the LG TV (Simplink Enabled) with the cec-client library on the RPi 4.

The problem is when I turn the TV back on, it defaults to the TV tuner input.

There is no TV aerial connected and I have had a look through the LG TV's settings but could not find anyway to set the default input to HDMI.

  • Simplink is enabled
  • RPi is connected to HDMI1
  • Connection is set as PC

Is there a way with the cec-client to tell the TV to use HDMI 1?

2

The "as" command sets the RPi to the active source, which tells the TV to use the port the RPi is on.

Give this a try:

Turn TV on:

echo "on 0" | cec-client RPI -s -d 1

Set active source:

echo "as" | cec-client RPI -s -d 1

For a particularly stubborn monitor I created the following "tvon.sh" script:

#!/bin/bash
echo "on 0" | /usr/bin/cec-client &
cecpid=$!
echo $cecpid
sleep 15s
kill $cecpid
echo "on 0" | /usr/bin/cec-client &
cecpid=$!
echo $cecpid
sleep 15s
kill $cecpid
echo "as" | /usr/bin/cec-client &
cecpid=$!
echo $cecpid
sleep 15s
kill $cecpid

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.