Posts

Showing posts from April, 2012

Controlling an LG TV via serial from Linux.

I have an LG plasma TV. Like most electronic home entertainment stuff these days, it comes with a port on the back for controlling it. In this case a serial port. LG helpfully put all the commands for controlling it in the back of the manual.  The commands are along the lines of: ka 01 00 - Which turns the power off. or kf 01 ff - Which is query, "what is the power status?" Which will return: a 01 OK01x     - A string as to whether the TV is On or Off, in this case "ON". This is useful as it provides a feedback mechanism, rather than shooting commands down the line and hoping that they'll have an effect (a la X10). So if I want to increase the volume by 1, I can read the current volume and add 1 to it. So this gives me the opportunity to automate tasks based on external events. Now a lot of my stuff I control from BASH Linux shell scripts and this is no different.  To control it from BASH is quite easy, you can just "echo" to or &