News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

LG rs232 script

Started by Esperanto, March 18, 2014, 01:15:34 PM

Previous topic - Next topic

Esperanto

When I connect my LG TV via rs232 the detection script does not find it. When I run the command manually I get:

# ./20_LG_TV.sh 1 2 /dev/ttyUSB1
LG TV detection script queue 2
A 01 OK01x\r\n
A 01 OK01x\r\n
It's not a LG TV


However the connection works fine as when I do:
# /usr/pluto/bin/TestSerialPort -p /dev/ttyUSB1 -P N81 -b 9600 -t "ka 01 00\r\n" -s "a 01 OK" -i 2
A 01 OK00x\r\n


it turns off and with
# /usr/pluto/bin/TestSerialPort -p /dev/ttyUSB1 -P N81 -b 9600 -t "ka 01 01\r\n" -s "a 01 OK" -i 2
A 01 OK01x\r\n


it goes on again.

This is the content of the script:
#!/bin/bash
echo "LG TV detection script queue $2"
# make sure its on
/usr/pluto/bin/TestSerialPort -p $3 -P N81 -b 9600 -t "ka 01 01\r\n" -s "a 01 OK" -i 2
# double check that its on
/usr/pluto/bin/TestSerialPort -p $3 -P N81 -b 9600 -t "ka 01 FF\r\n" -s "a 01 OK" -i 2

if [[ "$?" -ne 0 ]]; then
echo "It's not a LG TV"
#/usr/pluto/bin/MessageSend dcerouter -r 0 $1 1 806 224 $2 13 "$4" 44 0
exit
fi
echo "test"
# older TVs should not have a "xb" command
/usr/pluto/bin/TestSerialPort -p $3 -P N81 -b 9600 -t "xb 01 FF\r\n" -s "b 01 OK" -i 2
if [[ "$?" -eq 0 ]]; then
echo "LG TV with newer command set"
#/usr/pluto/bin/MessageSend dcerouter -r 0 $1 1 806 224 $2 13 "$4" 44 2126
exit
fi
# double check that it responds correctly to the older command
/usr/pluto/bin/TestSerialPort -p $3 -P N81 -b 9600 -t "kb 01 FF\r\n" -s "b 01 OK" -i 2
if [[ "$?" -eq 0 ]]; then
echo "LG TV with older command set"
#/usr/pluto/bin/MessageSend dcerouter -r 0 $1 1 806 224 $2 13 "$4" 44 1915
fi


Anyone sees what needs to be changed? thx

Esperanto

This looks to be case related.

trac.linuxmce.org/trac/ticket/2095

pigdog

Hi,

Just curious - was the LG TV in standby mode?

Cheers.

Esperanto


pigdog

O.K.

It was just that "most - meaning newer" LG panels won't transmit/send "FF" status when in standby mode.

It was just a thought.

Good Luck.

pigdog

#5
Hi,

I was just wondering, what the timing delay was from turning on the TV, waiting for the TV to actually power up and receive a signal through the AVReceiver (or directly from your sat/cable provider)?

Since TV sets are not instant on, how long was your delay between sending the "on" message to sending the status query?

Cheers.