4

I am new to linux and new to raspi. I need some help getting tvservice running. I am using the image from the raspberry thin client project which is based on raspbian. tvservice is installed.

If I log in via SSH I am able to run the command tvservice -s.

If I open a terminal window on the raspi itself and type tvservice -s I get bash: tvservice: command not found

I also tried to su first the same result.

I dont know where to look. Can anybody help me.

3
  • Hello and welcome! Note that I somewhat copy edited your post. If you feel that unneccessary you can always revert that edit. Also find my answer which addresses the issue.
    – Ghanima
    Commented Dec 12, 2015 at 15:54
  • @Mike Can you post the output of apt-cache policy libraspberrypi-bin ? Commented Dec 12, 2015 at 19:01
  • @Mike, could you please check echo $PATH both logged in via ssh and local terminal?
    – Ghanima
    Commented Dec 13, 2015 at 19:44

2 Answers 2

1

tvservice is not in $PATH, which is why you get the "command not found" message. Your shell simply does not find it. On my Pi it sits in /opt/vc/bin.

To run it type: /opt/vc/bin/tvservice -s using its full path.

11
  • 1
    Thanks the path /opt/vc/bin/ does not exists. How can i search for the correct pass
    – Mike
    Commented Dec 12, 2015 at 15:59
  • 2
    find / -name tvservice. If not run as root mind a lots "Permission denied" messages. If you find it, let me know to update the answer.
    – Ghanima
    Commented Dec 12, 2015 at 16:02
  • Log in via SSH and type which tvservice or type tvservice to find the path.
    – bryn
    Commented Dec 13, 2015 at 22:59
  • @bryn, unfortunately which does this by searching for an executable or script in the directories listed in the environment variable PATH (man which). So this will not work out, as we already know that it is not in PATH.
    – Ghanima
    Commented Dec 13, 2015 at 23:06
  • @Ghanima He states the command works fine via SSH, so then it's in PATH.
    – bryn
    Commented Dec 13, 2015 at 23:10
1

The tvservice command used to be part of libraspberrypi-bin package, which it contains various utilities for interacting with the Raspberry Pi’s video hardware interfaces (hdmi, camera, vga, etc). Recent versions of the package (as of Oct 2023) contain another utility which accepts multiple subcommands: vcgencmd <sudcommand> [<param>]

You may view the supported subcommands with this:

$ sudo apt install libraspberrypi-bin  # if not installed
...
$ vcgencmd commands
commands="commands, set_logging, bootloader_config, bootloader_version, cache_flush, ...

# E.g. to switch off screen:
vcgencmd commands display_power 0

See vcgencmd documentation and source code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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