Coder Social home page Coder Social logo

tvcec's Introduction

tvcec

Control TV using HDMI-CEC from Raspberry PI. For example, assuming you are using a TV with 2 HDMI input sources and not using an antenna connection.

HDMI 1 = Chromecast
HDMI 2 = Raspberry PI

The idea with tvcec is to run as a UDP server and receive messages for controlling the TV via HDMI. This is achieved by issuing commands to the TV via the cec-client application that must be installed on the PI:

sudo apt install cec-utils

tvcec messages

TV Function tvcec UDP message cec-client command
on cec-on {addr} on {addr}
standby cec-standby {addr} standby {addr}
volume up cec-volup volup
volume down cec-voldown voldown
mute cec-mute mute
Source HDMI 1 cec-hdmi 1 txn 4f:82:10:00
Source HDMI 2 cec-hdmi 2 txn 4f:82:20:00
Source HDMI {n} cec-hdmi {n} txn 4f:82:{n}0:00
n/a exit n/a !

The cec-client commands are issued as in this example (turn TV on):

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

Disable Raspberry PI screen saver

If you are switching to the HDMI input source corresponding to the Raspberry PI, it might be that the PI screen saver is activated and then you see only a blank screen. To avoid this, it is possible to permanently disable Raspberry PI screen saver. Edit this file to do it:

sudo nano /etc/lightdm/lightdm.conf

add the following line under the [Seat:*] section:

xserver-command=X -s 0 dpms

After a reboot, the screen saver will be permanently disabled (to re-enable screen saver remove the line and reboot).

tvcec's People

Contributors

arnholm avatar

Stargazers

Salem Harrache avatar  avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.