Jump to content


Photo

Solution for standby mode on LG-TV via HDMI-CEC Simplink - replaced by RS232.

Simplink RS232 LGTV

  • Please log in to reply
2 replies to this topic

#1 s3n0

  • Senior Member
  • 640 posts

+62
Good

Posted 26 February 2017 - 04:43

Hi all !

Have you a troubles with the particular Simplink-CEC protocol on LG-TV ?
Have you a problem with LG-TV power-off ?
You can try the simple RS232C connection... so... what do you need ?

(1)
As first you need the RS232 serial cable - with basic pinouts, called as "null modem - without handshaking".

I used the standart pair cable designed for the audio technology (stereo). Veins for the left and right channels are used as the Rx and Tx lines. Shielding of both channels are combined into one GND. Need to use the "spinning" pair (Twister-Pair) is irrelevant because it is a short distance - cable length is 30 cm only.

You can look here or here for the example.

300px-Null_modem_DB-9_xon-xoff.svg.png
Connector pinouts:
(null modem cable, without hardware handshaking)

 STB    TV

GND 5 -- 5 GND
 Tx 3 -> 2 Rx
 Rx 2 <- 3 Tx

(2)
Testing the connection over RS232 between your LG-TV and your satellite box (Shell command in Telnet):

echo "ka 01 00" > /dev/ttyS0                 # shut-down TV
echo "ka 01 01" > /dev/ttyS0                 # shut-on TV

(3)
When the connection does not working, you need change the connection speed maybe... so, try the following command:


stty -F /dev/ttyS0 ispeed 9600 ospeed 9600

(4)
If TV-shutdowning is already working.....

OpenATV 5.3 / 6.0:

- edit the Python source code in downloaded file Standby.py from Github-server
- so, download the actual encrypted Standby.py file from Github server (Enigma2 folder) and change the source code:


..........search and add following lines to the section "def __init__(self, session)" (under "class Standby2(Screen)") :

      # ############## tv power on
      open("/dev/ttyS0","rb+").write("ka 01 01\n")      
      print "[Standby] LGTV turn on - ttyS0 send:  ka 01 01"  
      # ##############

..........search and add following lines to the section "def __onClose(self)" (under "class Standby2(Screen)") :

      # ############## tv power down
      open("/dev/ttyS0","rb+").write("ka 01 00\n")      
      print "[Standby] LGTV turn off - ttyS0 send:  ka 01 00"
      # ##############

- WARNING ! you must follow the TABs in current format of the script ! Python syntax is TAB-sensitive ! you must follow the right TABs (paragraph, identation) in the source code of Standby.py !
- when source code is done, upload the file over FTP to your satellite box:
/usr/lib/enigma2/python/Screens/Standby.py

- set the execute rights on this file and reboot the satellite box (after rebooting Python script source code {.py} will automatic compiled to executable Python script {.pyo} ) :

chmod 775 /usr/lib/enigma2/python/Screens/Standby.py
reboot

OpenPLi 4.0:

- there exists a Bash-script-calling code over the Standby.pyo original file
- so, all what do you need is making the new Bash scripts !

- example of standby_enter.sh bash-script file:


#!/bin/sh
echo "ka 01 00" > /dev/ttyS0        # prikaz pre vypnutie LG TV prostrednictvom RS232 rozhrania

- example of standby_enter.sh bash-script file:

#!/bin/sh
echo "ka 01 01" > /dev/ttyS0        # prikaz pre zapnutie LG TV prostrednictvom RS232 rozhrania

- create the directory if does not exist (/script/ folder) + create the new files (you can copy both files over FTP connection too):
/usr/script/standby_enter.sh
/usr/script/standby_leave.sh

- take the execute rights to both of them and reboot the satellite box:

chmod 775 /usr/script/standby_*.sh
reboot

(5)
The shutdown of your LG-TV over Standby mode does not work on first start smile.gif ! So, try shutdown of your box for the first time... do it the second time... and from now it does still working always ;-)


Used sources:
[1] LG TV Hack – Kimyabu
[2] https://www.lg.com/u...c-ba-rs232c.pdf

 

Good Luck !

 

 

Attached Files



Re: Solution for standby mode on LG-TV via HDMI-CEC Simplink - replaced by RS232. #2 s3n0

  • Senior Member
  • 640 posts

+62
Good

Posted 20 March 2017 - 01:27

EDIT 20.3.2017:

 

After last update of the image OpenATV 5.3 / 6.0, image now contains a new version of the file "Standby.pyo".

User bash-script files support was added. Two bash-script files are executed by entering to stanby mode and/or leaving from standby mode.

 

https://github.com/o...df66739990b3d26

 

So you can now use the same guide like in OpenPLi 4.

 

Caution:

OpenATV 5.3 / 6.0 images are using the different filenames as in OpenPLi-4 :

/usr/script/StandbyEnter.sh
/usr/script/StandbyLeave.sh



Re: Solution for standby mode on LG-TV via HDMI-CEC Simplink - replaced by RS232. #3 s3n0

  • Senior Member
  • 640 posts

+62
Good

Posted 23 March 2017 - 23:59

LOL !

I can not use the feature to EDIT my posts.

So... again... my another post with repaired bash-script files to download :

Attached File  two_bash_scripts_for_OpenATV-&-OpenPLi.zip   1.63KB   13 downloads

(there two newer OpenATV userscripts + two standard OpenPLi userscripts)





Also tagged with one or more of these keywords: Simplink, RS232, LGTV

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users