So that no one else has to suffer through figuring this out:
On this link http://wiki.linuxmce.org/index.php/LG_42LB5D
under "Add Ruby Snippets to Commands" you will find this code
#355 Process Initialize
for iRetry in 0...4
print "Initializing unit\n"
conn_.Send("ke 01 01\r") # Send UnMute Command
buf = conn_.Recv(30,200) # Expected Return # ke 01 01\r\ne 00 OK01x\r\n
if !buf.nil? && buf.include?("OK")
print "Initialized ok\n"
print "Setting volume to 30%\n"
SetDeviceDataInDB( device_.devid_, 158, "15" )
# 158 = DEVICEDATA_Volume_Level_CONST
print "Failed to initialize. Wait 1 secs and try again\n"
#DisableDevice( device_.devid_, true )
#print "The device would not respond. Disabling it.\n"
Unfortunately it will cause a compile error in 7.10 in the "follow log" on the "advanced" link of the A/V device and will not allow your template to run. The compile error will state that it found a "kend" and was expecting "$end".
If you delete this code snippet from the template--leaving #355 blank---and restart the router, it will compile with no problem and the "send command to device" Link on the "advanced link of the GSD device seems to work through rs232 .
Since this page has been copied as a tutorial for other LG TVs and a request was put in a couple of weeks ago to have the code included as a pnp device for 8.10 http://forum.linuxmce.org/index.php?topic=9729
many would assume that it has been tested and works. This is not true.
It is probably very easy to fix--looks to me like the definitions at the top of this snippet were not copied into the tutorial, but I know nothing about Ruby or I would attempt it.
BTW, otherwise this seems to be a good template for LG TVs with serial ports. Some of the command need to be changed for later models <$xb 01 90\r$> instead of <$kb 01 07\r$> for inputing HDMI 1 for example, but generally a good guide for adapting it to your TV.
If the author of the tutorial or someone who has access to this page on the wiki could fix the code it would be greatly appreciated.