Author Topic: LG rs232 script  (Read 3538 times)

Esperanto

  • Guru
  • ****
  • Posts: 281
    • View Profile
LG rs232 script
« on: March 18, 2014, 01:15:34 pm »
When I connect my LG TV via rs232 the detection script does not find it. When I run the command manually I get:

Code: [Select]
# ./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:
Code: [Select]
# /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
Code: [Select]
# /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:
Code: [Select]
#!/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

  • Guru
  • ****
  • Posts: 281
    • View Profile
Re: LG rs232 script
« Reply #1 on: March 20, 2014, 12:48:58 pm »
This looks to be case related.

trac.linuxmce.org/trac/ticket/2095

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1105
    • View Profile
Re: LG rs232 script
« Reply #2 on: March 20, 2014, 07:50:28 pm »
Hi,

Just curious - was the LG TV in standby mode?

Cheers.

Esperanto

  • Guru
  • ****
  • Posts: 281
    • View Profile
Re: LG rs232 script
« Reply #3 on: March 21, 2014, 12:48:05 pm »
iirc not

pigdog

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1105
    • View Profile
Re: LG rs232 script
« Reply #4 on: March 21, 2014, 01:33:08 pm »
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

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1105
    • View Profile
Re: LG rs232 script
« Reply #5 on: March 22, 2014, 10:32:09 am »
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.
« Last Edit: March 22, 2014, 10:33:43 am by pigdog »