My experiences - LG Smart-TV with Linux control
Hardware:
Raspberrypi 2 Model B
Smart-TV LG TV 55LB580V
Connection Raspberrypi via HDMI cable with Smart-TV HDMI Port 2 established
Smart-TV Software Version
http://www.pedaltreter.at/jsan/lgtv/LGTV_ver.jpg
Download and install
Image with PIXEL desktop based on Debian Jessie
Version:January 2017
Release date:2017-01-11
Kernel version:4.4
https://www.raspberrypi.org/downloads/raspbian/
For headless setup, SSH can be enabled by placing a file named 'ssh', without any extension, onto the boot partition of the SD card.
https://www.raspberrypi.org/documentation/remote-access/ssh/README.md
default user = pi, passwd = raspberry
after first login ….
$ sudo passwd root, su root, raspi-config, apt-get update, apt-get upgrade usw.
http://constey.de/2014/10/fernseher-ueber-hdmi-per-raspberry-pi-steuern-cec/
With this guide CEC-client brought to run.
After the Line …
To compile libCEC on a new Raspbian installation, follow these instructions:
commands processed
https://github.com/Pulse-Eight/libcec/blob/master/docs/README.raspberrypi.md
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
```
root@storeme:/opt/lgcommander# cec-client -i
libCEC version: 4.0.2, git revision: libcec-4.0.2, compiled on Sam Feb 11 19:09:25 UTC 2017 by root@storeme on Linux 4.4.38+ (armv6l), features: P8_USB, DRM, P8_detect, randr, RPi
root@storeme:/opt# cec-client -l
libCEC version: 4.0.2, git revision: libcec-4.0.2, compiled on Sam Feb 11 19:09:25 UTC 2017 by root@storeme on Linux 4.4.38+ (armv6l), features: P8_USB, DRM, P8_detect, randr, RPi
Found devices: 1
device: 1
com port: RPI
vendor id: 2708
product id: 1001
firmware version: 1
type: Raspberry Pi
root@storeme:/opt# cec-client -s - got Error
root@storeme:/opt# echo "on 0" | sudo cec-client -s -d 1 - got Error too
ERROR:
[
69]
RegisterLogicalAddress -
vc_cec_set_logical_address(E) returned invalid arg (8)
ERROR:
[
69]
Open - vc_cec could not be
initialised
https://github.com/Pulse-Eight/libcec/issues/191
I was able to fix this problem for myself by doing: tvservice --off. This will power down the HDMI and open it up for connections again if something you can't identify has taken over.
root@storeme:/opt# tvservice --off
After that i could turn the LG Smart-TV via HDMI on.
root@storeme:/opt# cec-client -s
opening a connection to the CEC adapter...
DEBUG: [ 102] Broadcast (F): osd name set to 'Broadcast'
DEBUG: [ 109] logical address changed to Free use (e)
DEBUG: [ 113] Open - vc_cec initialised
NOTICE: [ 116] connection opened
root@storeme:/opt# echo "on 0" | sudo cec-client -s -d 1
opening a connection to the CEC adapter...
Television with CEC-Client switching off:
echo "standby 0" | sudo cec-client -s -d 1
Get power-Status with CEC-Client:
echo "pow 0" | sudo cec-client -s -d 1
Use CEC-Client for switching to another HDMI Port:
echo "tx 4F 82 10 00" | cec-client -s
https://github.com/ypid/lgcommander
Installation performed according to the instructions ...
apt-get install python3 python3-tk unzip
cd /opt/ && wget https://github.com/ypid/lgcommander/archive/master.zip
unzip master.zip && rm master.zip
mv lgcommander-master/ lgcommander
cd lgcommander
On the Smart-TV IP address determined
(Settings Network status)
http://www.pedaltreter.at/jsan/lgtv/LGTV_ip.jpg
root@storeme:/opt/lgcommander# ./lgcommander.py -H IP_DES_FERNSEHERS -P roap
Bottom right on the Television you can see the Pairing-Key
http://www.pedaltreter.at/jsan/lgtv/LGTV_cnc.jpg
..write down the pairing Key (in this example 398129).
Switch up one channel
./lgcommander.py -H 192.168.201.106 -P roap -k 398129 -c 27
Switch Television off
./lgcommander.py -H 192.168.201.106 -P roap -k 398129 -c 1
Command |
Action
|
||||
27 | Channel up | ||||
28 |
Channel down |
||||
24 |
Volume up |
||||
25 |
Volume down |
||||
26 |
Sound on/off |
||||
34 |
Pause |
||||
33 |
Play |
||||
1 |
TV Power off |
||||
23 |
Back-Key |
||||
20 |
OK-Key |
||||
403 |
Play Last Channelstop | ||||
35 |
Play stop |