Author Topic: LG LCD Template  (Read 16694 times)

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #30 on: October 11, 2010, 11:07:54 am »
Thanks for the tip. Just used a similar command and got a response. I used ttyUSB0.

/usr/pluto/bin/TestSerialPort -p /dev/ttyUSB0 -P N81 -b 9600 -t "ka 1 01\r\n" -s "a 01 " -i 8

Response was
a 01 OK01x

Once this template is confirmed working we can use these commands to query the LG to figure out the model and launch the right template. New templates can be created based on this one for each model range.

I'd just like to see this template working for someone else.
Barney

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #31 on: October 11, 2010, 09:27:19 pm »
OK. Just made a change to script #355 Process Initialize in my earlier post:
http://forum.linuxmce.org/index.php?topic=9729.msg74457#msg74457

I have set a fixed volume level. Please try this and report back.
Cheers
Barney

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #32 on: October 11, 2010, 10:04:18 pm »
Looks like we've got success with this template.

The only addition is the ability to set the initial volume within the device data of the template. That way users can choose a start-up volume to suit their own preferences.
 ;D

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5501
  • DOES work for LinuxMCE.
    • View Profile
Re: LG LCD Template
« Reply #33 on: October 12, 2010, 06:30:55 am »
Any start-up volume should not be stored in the template. I will not accept a template that accepts this or explicitly sets this. End of story.

-Thom

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #34 on: October 12, 2010, 02:17:02 pm »
Agreed.

Please see amended #355 Process Initialize in previous post.
http://forum.linuxmce.org/index.php?topic=9729.msg74457#msg74457

We now query the TVs volume level and simply re-set it to the same level to initialize the device.
 ;)
Barney

ladekribs

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: LG LCD Template
« Reply #35 on: October 12, 2010, 08:53:05 pm »
Hi Barney,

I must have done something wrong with my setup, but I tested Your #313 and #355 on an other Linuxmce machine and they appear to be working on my 47LH4000

will qontinue testing

BR Stefan

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #36 on: October 12, 2010, 11:46:40 pm »
Hi Stefan,

I've made quite a few changes over the last couple of days. Maybe you tried a different version (I keep updating the same post with the improved configuration).

I'm pretty happy with it now. Let me know if it is fully working for you.

Barney

huh

  • Guru
  • ****
  • Posts: 235
    • View Profile
Re: LG LCD Template
« Reply #37 on: October 18, 2010, 06:23:12 am »
B4rney- got my null modem cable tonight and once plugged in, Sarah detects my TV and I am able to click through the options- it appears to work great on my 32LH40 (btw, using RGB and an audio cable because my latitude D810 has no other video outputs...)

The only problem I have discovered is with the audio up/down.  Surprisingly, mute works great, but volume up/down do not work.  I have confirmed that the correct command (kf 01 ___) are listed for command #313 Set Volume.

Maybe like ladekribs, something quirky happened with this installation (don't know what snapshot I'm using currently).  Will experiment and post back as I go.

Thanks again




ladekribs

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: LG LCD Template
« Reply #38 on: October 19, 2010, 08:46:55 pm »
B4arney,

I have Reinstalled core, replaced USB/serial adapter,
but while testing I messed up the template, could you please post your #373 Private Method Listing?

BR Stefan

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3046
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: LG LCD Template
« Reply #39 on: October 20, 2010, 08:04:33 am »
If you messed up a template locally, you can always revert. in web admin - Advanced / sqlCVS / Diff - select the IR repo if you messed with the codes, select diff. Choose the change you made and select revert.

ladekribs

  • Veteran
  • ***
  • Posts: 85
    • View Profile
Re: LG LCD Template
« Reply #40 on: October 20, 2010, 10:03:18 am »
Thank You POSDE,

actually I looked their but got confused , will try again with your instruction.



BR Stefan

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #41 on: October 22, 2010, 11:42:08 am »
Hey Guys,

Sorry for the delay.

@ladekribs, posde's advice is the best way to revert to the current template. Once done you can try again. Below is #373 Private Method Listing if you're sure that is your problem. This is simply the send command with additional arguments.
Code: [Select]
# Private - Date: 28.02.2008
# the docs are wrong.  they say responses are terminated with a \r.  In reality some sets do, others don't.

def SendCommand(command,timeout,retransmit)
for i in 0...retransmit
conn_.Send(command + "\r")
# wait up to 8 seconds since it may be very slow if this is an 'on' command

    buf = conn_.RecvDelimited("x", timeout)
   
    if( !buf.nil? && (!buf.index("01 OK").nil? || !buf.index("01 NG").nil?))
print "Received good reply in less than ", timeout, "ms: ", buf, "\n"
return
else
buf = conn_.Recv(1000,1000);
print "Flushed buffer: ", buf, "invalid resonse in ", timeout, "seconds\n"
end
end
end

b4rney

  • Guru
  • ****
  • Posts: 454
    • View Profile
Re: LG LCD Template
« Reply #42 on: October 22, 2010, 11:47:04 am »
@huh

Sorry you're having problems. Make sure you have the latest #355 from the earlier post:
http://forum.linuxmce.org/index.php?topic=9729.msg74457#msg74457

This now queries the TV for the current volume level then simply sets it to the same level. If this is working you should see the TVs volume bar appear after a 'quick reload router' as your md sends the command.

If not then try replacing cmd_313(volume_level) in #355 with a fixed number like this:
cmd_313(8)

This will simply set the volume to 8. This is not best practice but if it works it will help me diagnose the problem.

Please keep me informed as I'd like to nail this.
Barney
« Last Edit: October 22, 2010, 11:57:48 am by b4rney »

huh

  • Guru
  • ****
  • Posts: 235
    • View Profile
Re: LG LCD Template
« Reply #43 on: October 23, 2010, 04:56:23 am »
Thanks b4rney- I have a different issue ATM.  As discussed in another thread, my usb-to-serial devices keeps getting detected and asks me which room it is in.  If I ignore it for now, it asks in a short while and if I ignore it permanently then my TV isn't controlled.  And, setting it up again adds another device in the web admin.

I believe the answer in the other thread was to add a stand-alone pci to serial adapter and be done with it- not an option in my case where I am on a Dell Latitude D800.  The laptop does, however, have a serial port on the back.  When I plugged the TV into that, I initially thought the port was disable because nothing was detected.  Upon reboot, I saw that it was connected, so for kicks I changed the com from com1 to com2 and reboot LMCE (this is a MD BTW- not my core) with the TV connected.

I have not played with it a whole lot yet, but thus far it is not being detected....  not sure where to go, but am using a snapshot from september or so, so probably time to kill it and start again.


huh

  • Guru
  • ****
  • Posts: 235
    • View Profile
Re: LG LCD Template
« Reply #44 on: October 24, 2010, 07:15:11 am »
OK- manually set the comm port to TTSY2 in the admin page and using putty, I can control the tv- e.g. /usr/pluto/bin/TestSerialPort -p /dev/ttyS2 -P N81 -b 9600 -t "kf 01 08\r"  sets the volume at 8.


Manually, it works great.  I can control the volume, on/off, etc.  Not sure why LMCE doesn't control it directly- pushing the green MCE button on my remote does not turn on the TV as it did before and pushing volume up/down does not change the volume. I'm convinced the template works great, just something odd on my system...