This document describes how I set up CEC on a Raspbian instalisation
Packages to install:
-
sudo apt-get install cmake
-
sudo apt-get install checkinstall
-
sudo apt-get install liblockdev1-dev
-
sudo apt-get install libudev-dev (Rasp3 needed apt-get update)
-
sudo apt-get install swig
-
sudo apt-get install g++-4.8 (Rasp3 didn't do this as g++ -v showed I already had 4.9)
The following I had problems with (fix-missing)
-
***???sudo apt-get install libxrandr-dev
-
***???sudo apt-get install python-dev
Download from git
-
CECDIR=/home/pi/libcecworkarea
-
echo ${CECDIR}
-
mkdir ${CECDIR}
-
cd ${CECDIR}
-
git clone --recursive https://github.com/Pulse-Eight/libcec.git
Building **Rasp3 Changed compiler to 4.9
-
cd ${CECDIR}/libcec/src/platform
-
mkdir build
-
cd build
-
cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1 -DCMAKE_CXX_COMPILER=g++-4.8 ..
-
make
-
sudo make install
Building something else
-
cd ${CECDIR}/libcec
-
mkdir build
-
cd build
-
export LIBRARY_PATH=/opt/vc/lib
-
cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=1 ..
-
make
-
sudo -E bash -c 'make install'
Commands
-
cec-client -l
Command | Function |
---|---|
|
List Commands |
|
Scan Devices |
|
Turn TV Off |
|
Turn TV On |
|
Set OSD Text |
Sources
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=117019
Getting commands working
I have made a script on the pi. (To backup here later) I will put all my commands in here
/home/pi/libcecworkarea/send.sh
RJM Article Type
Work Notes