OoM_JaN
Posts: 1
Joined: Sat Mar 01, 2014 3:07 pm

Installing LIBCEC on Wheezy (tested on a Samsung TV)

Sat Mar 01, 2014 3:21 pm

Step by step installation of the LIBCEC module on a Wheezy Rapberry.



Start in the home directory

Code: Select all

cd /home
Install the necessary tools for compiling:

Code: Select all

sudo apt-get install build-essential autoconf liblockdev1-dev libudev-dev git libtool pkg-config
Clone the git repository:

Code: Select all

sudo git clone git://github.com/Pulse-Eight/libcec.git
Compile:

Code: Select all

cd libcec

Code: Select all

sudo ./bootstrap

Code: Select all

sudo ./configure --with-rpi-include-path=/opt/vc/include --with-rpi-lib-path=/opt/vc/lib --enable-rpi

Code: Select all

sudo make

Code: Select all

sudo make install
Link the libraries so that cec-client can find them:

Code: Select all

sudo ldconfig
Check that cec-client have found the device by running:

Code: Select all

cec-client -l
Found devices: 1

device: 1
com port: RPI
vendor id: 2708
product id: 1001
firmware version: 1
type: Raspberry Pi

To send commands to for instance a connected TV:

Turn off TV:
echo “standby 0” | cec-client -s

tomtomclub
Posts: 29
Joined: Wed Apr 03, 2013 7:23 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Thu May 08, 2014 3:27 pm

how to do in OpenELEC xbmc

Xumpy
Posts: 15
Joined: Tue Jun 04, 2013 9:23 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Sat Jun 14, 2014 10:33 am

I just want to add that you need all your libraries set in /opt/vc

Check if there is an include and lib folder in /opt/vc. If there isn't one download the raspberry firmware master repos: https://github.com/raspberrypi/firmware

Copy the opt/vc folder from this repos to your own /opt/vc folder and the configure will work flawless. If you don't do this then you will get the error: configure: error: Raspberry Pi API not found or incompatible with libCEC

Regards

Xump

User avatar
hanzelpeter
Posts: 68
Joined: Mon Jul 09, 2012 11:56 am

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Mon Jun 16, 2014 8:10 am

Hello.

Will this library work with Samsung LCD monitor with HDMI input. Or CEC is just for TVs?

danielblarg
Posts: 1
Joined: Thu Nov 27, 2014 8:53 am

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Fri Nov 28, 2014 6:07 am

Thanks for this, I've got it working well with my Panasonic TV.
It wasn't working until I switched to a different HDMI cable.

Now I'm using python-cec (https://github.com/trainman419/python-cec) to make a script to control the Pi with the TV remote.

L1ttl3J1m
Posts: 1
Joined: Mon Dec 29, 2014 5:53 am

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Mon Dec 29, 2014 6:15 am

Beautiful - works almost perfectly out of the box, thank you very much!

Just a couple of points:

For the git clone command, if you leave off the "sudo" from the beginning, it creates the directory under your own user account, thus obviating the need for the "sudo" command through the rest of the steps up to

Code: Select all

sudo make install
This is also the preferred method because it means you don't end up with files belonging to root (which you can't edit or delete) in the user home directory.


Secondly, there is a development in automake (specifically, libtoolize) that is going to break the process as described here because the macros that

Code: Select all

./bootstrap
uses to create the files that

Code: Select all

./configure
works on need to be in their own directory at the top of the source tree.

What that means (in non-geek speak) is that after

Code: Select all

sudo git clone git://github.com/Pulse-Eight/libcec.git

cd libcec
you need to create the m4 directory;

Code: Select all

mkdir m4
and then edit configure.ac;

Code: Select all

 nano 
(or your editor of choice)

Code: Select all

 configure.ac
After the line

Code: Select all

CFLAGS="$cflags_reset"
add

Code: Select all

AC_CONFIG_MACRO_DIR([m4])
and in Makefile.am (nano again, or your equivalent to edit it), add

Code: Select all

ACLOCAL_AMFLAGS = -I m4

then continue with

Code: Select all

 ./bootstrap 
If you're seeing the errors

Code: Select all


 libtoolize: Consider adding `AC_CONFIG_MACRO_DIR([m4])' to configure.ac and
libtoolize: rerunning libtoolize, to keep the correct libtool macros in-tree.
libtoolize: Consider adding `-I m4' to ACLOCAL_AMFLAGS in Makefile.am.

this is how you fix that!

drgeoff
Posts: 7313
Joined: Wed Jan 25, 2012 6:39 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Mon Dec 29, 2014 8:42 pm

hanzelpeter wrote:Hello.

Will this library work with Samsung LCD monitor with HDMI input. Or CEC is just for TVs?
Probably will not work because of no CEC on monitor. Consult the specs of the monitor. If the monitor does not have a remote control (of the TV type) with 'transport' buttons (play, stop, rewind etc) then the chances are slim.

sebi
Posts: 13
Joined: Thu May 01, 2014 10:55 am

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Sat Apr 04, 2015 3:28 pm

Hi,

Sorry for this post in this old thread.

But they have changed the compile method of LibCEC.

So you can't run the shell script by the command ./bootstrap.

Do anybody know which Release will work.

Sebi

sebi
Posts: 13
Joined: Thu May 01, 2014 10:55 am

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Sun Apr 05, 2015 5:44 pm

Hi

I have tested it with the Release 2.2.0, but i have to use this configure command

Code: Select all

sudo ./configure --with-rpi-include-path="/opt/vc/include" --with-rpi-lib-path="/opt/vc/lib/" --enable-rpi
https://drgeoffathome.wordpress.com/201 ... pberry-pi/

Can anybody tell me, what I have to do, to compile it with cmake?

magro
Posts: 2
Joined: Mon Apr 13, 2015 6:27 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Mon Apr 13, 2015 6:31 pm

Did somebody have success with libCEC version 3 ?

nlrb
Posts: 6
Joined: Mon Apr 13, 2015 7:50 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Tue Apr 14, 2015 7:11 pm

Yes, I've the listed the steps in this post.

magro
Posts: 2
Joined: Mon Apr 13, 2015 6:27 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Thu Apr 16, 2015 2:46 pm

TKS nlrb. It works fine.

spiru
Posts: 5
Joined: Sun Sep 06, 2015 3:31 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Sun Sep 06, 2015 3:35 pm

Can someone please tell me why I am getting ./bootstrap: command not found after I try sudo ./bootstrap. I'm a newbie in linux guys.
I would appreciate help cause this is killing me

User avatar
DougieLawson
Posts: 29690
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Sun Sep 06, 2015 11:25 pm

Because dot slash (./) in front of a file name means look in the current working directory and your "bootstrap" script isn't in there.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.

spiru
Posts: 5
Joined: Sun Sep 06, 2015 3:31 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Mon Sep 07, 2015 12:49 pm

Thanks for the reply. So Do I have to get the libcec bootstrap file from somewhere? or bootstrap is an OS command file, is it installed in a default directory?

dragos
Posts: 23
Joined: Tue Sep 08, 2015 4:50 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Fri Jun 24, 2016 9:25 am

Hi, has anybody solved this ./bootstrap problem? I also get command not found! How do I solve it? Thought this is a good tutorial but full of wrong info!

acki
Posts: 1
Joined: Thu Dec 29, 2016 6:54 pm

Re: Installing LIBCEC on Wheezy (tested on a Samsung TV)

Thu Dec 29, 2016 6:59 pm

Have a look at the documentation for raspberry included!

To compile libCEC on a new Raspbian installation, follow these instructions:

Code: Select all

sudo apt-get update
sudo apt-get install cmake libudev-dev libxrandr-dev python-dev swig
cd
git clone https://github.com/Pulse-Eight/platform.git
mkdir platform/build
cd platform/build
cmake ..
make
sudo make install
cd
git clone https://github.com/Pulse-Eight/libcec.git
mkdir libcec/build
cd libcec/build
cmake -DRPI_INCLUDE_DIR=/opt/vc/include -DRPI_LIB_DIR=/opt/vc/lib ..
make -j4
sudo make install
sudo ldconfig
I tried this für libCEC version 4.0.0 on a quite fresh OSMC-installation and it worked fine!

Return to “Advanced users”

Who is online

Users browsing this forum: No registered users and 15 guests