PDA

View Full Version : Controlling a LG 26LC7D


gizmosrcool
12-27-2007, 01:13 PM
Hello Everyone.

Newbie here just getting started. I am working on setting up and controlling my office setup before I work on the other parts of the house. I have CQC installed and running on a dedicated box and basic UI up and running controlling DTV box via serial and a Sony 355 changer via IR. This is running ok.

I had a rather new Philip's LCD, but they used cheesy IR and controls. Nothing discrete, so it went to another room and I picked up LG 26LC7D today primarily because it has a serial port and seemed to be easily controllable.

Long story short, after messing around with CQC and the LG serial drivers for a few hours, I can not get it to connect. The driver comes on-line and the driver state stays at "Wait for Connect".

Now I can use Hyperterminal and control it. Using the commands outlined in the manual, I can turn it ON and OFF, switch inputs, and hit the volume nicely. So it will work well for me if I can get CQC to talk to it. I also get feedback on the command and it verifies it was accepted and ok.

The manual is http://us.lge.com/download/product/file/1000002389/26LC7D_manual.pdf and contains a nice section of the protocol and commands.

I was wondering if anyone has suggestions and/or experience with the LG driver? Any help would be appreciated.

Thanks, T.

znelbok
12-27-2007, 01:46 PM
I have modified the existing driver to suit my LG as there were minor differences. It is only a PDL driver and it is very well structured to accomodate the changes. I wont profess to understand what is happening but it runs OK (I get some strnge replies for some reason sometimes).

I did the same for another LG and it wont work, so I wrote a simple two way driver for it.

I can have a quick bash at it if you want - no promises though, but you will need to wait a week or two as I have to finish off some other stuff first.

Mick

gizmosrcool
12-27-2007, 05:01 PM
ok. Thank you for the offer. I am guessing its not connecting because of the differences in the driver or something like that.

In the meantime I am off the next few days and will try and pound on it.

I have viewed the tutorial on Macro's and have started one to turn everything off and on, so I will look at figuring out how to copy, tweak, and tune the driver.

Do you, or anyone else, have a quick $.02 on how to copy and create a new driver. I see a manifest file and protocol file, but not being a programmer type, i have to look at things a lot before I figure them out. and I usually just cut and paste.

I will cut it down to just power and input selection to see if I can get it to work. Then add stuff back in.

Any help to point me in the right direction is appreciated.

Thx, T.

znelbok
12-27-2007, 09:00 PM
If you are happy eith one way control in the meantime then get my generic driver from the forums and use it. It is just has a passthrough field that sends the text you put in.

As for a new driver, if its PDL just modify the manifest and save it as a new name and do the same for the protocol file.

If you want to modify the existing LG driver file then you will be better off just leaving it all in.

Mick

gizmosrcool
12-27-2007, 09:21 PM
I would like two way eventually, but one way now is better than nothing. Can you point me in the way of the generic driver? I searched on it and nothing specific came up.

once I get the one way going, i will work on the driver.

Thx, T.

gizmosrcool
12-27-2007, 09:48 PM
I found it, but its for an older version of cqc. if you happen to have the text file of the driver and can post it, that would be great.

Thx, T.

znelbok
12-27-2007, 11:04 PM
Try these
http://users.1earth.net/~mhk01/LG_26LC7DC.CQCDrvPack (http://users.1earth.net/%7Emhk01/LG_26LC7DC.CQCDrvPack)
Dont know how well it will work, just had a quick bash at it (literally).

Here is the generic
http://users.1earth.net/~mhk01/Generic.CQCDrvPack (http://users.1earth.net/%7Emhk01/Generic.CQCDrvPack)

Mick

paul
12-30-2007, 11:54 AM
Mick do you know if there is a current Generic driver as the link to the one you posted is for older versions.

znelbok
12-30-2007, 12:13 PM
The one above should be for the current version of CQC - did I somehow link to an old version?

Mick

paul
12-30-2007, 12:25 PM
Yeah there was a popup saying that it is for an older version after i tried importing it.
Do you know if it will work with an IP addressed unit like the Elk?
I would like to have some simple control of my Canon VB-C50i IP camera and thought maybe the Generic would do it.

znelbok
12-30-2007, 12:32 PM
I will have to copy the correct version when I get home (Had to go to work today).
It's only serial ascii. So you wont be able to do anything with your camera - sorry.

paul
12-30-2007, 12:34 PM
Ok no problem.
Have a nice day Mick

znelbok
12-30-2007, 09:20 PM
The generic imported fine for me. It was the one I created yesterday as well. I created it using 2.3.3
Just to make sure I have e-mailed it to you as well.

Mick

gizmosrcool
01-01-2008, 02:52 PM
Thx for the assistance. I can get the one way to work, but not the two way. My attention span is way too short, so I got IR going on it now so I can work on my UI. I will circle back later and attempt to get it working once I have the basic UI working well.

znelbok
01-01-2008, 03:54 PM
Are you saying the two way driver I posted did not work?
Are you using the generic driver for the one way , or IR control via a USBUIRT or similar.

Mick

gizmosrcool
01-01-2008, 04:24 PM
Correct. The two way did not work. Just waits to connect. I can push one way commands to it. Right now I am using IR via USBUIRT.

One way does not help me out. I eventually want to use volume slider control and mute via serial plus poll a few items.

Thank you for your help. Regards, T.

znelbok
01-01-2008, 09:14 PM
You can use the generic with the volume slider and the variable driver.

It appears that you need to be on V2.3.3 to import the generic. V2.3.2 or lower will not work.

I will have a look at as to what is going on with the other driver - the connect is only looking at the power status so it must be giving back something that is not expected.

Mick

znelbok
01-02-2008, 12:24 AM
Can you also check that you have the SetID set to 1. Anything else will not allow the set to repsond to the driver.

Mick

gizmosrcool
01-02-2008, 05:24 PM
yes, its set to 1. when in hyperterminal, the TV responds to either 00 or 01. according to the manual, 00 means all TV's if they are chained together.

znelbok
01-03-2008, 12:08 AM
can you tell me what you get if you query the power (ka1ff from memory)

Mick

gizmosrcool
01-03-2008, 05:55 PM
I get a "a 00 NG00x"

now when i issue a "ka 01 ff" I receive a "a 01 OK01x" as expected.

The first command "k" and the second command "a" can be right next to each other, but it seems there must be a space after it, then the SETID, another space, and then the data.

Does this help? Thx, Tom.

bph
01-06-2008, 11:16 PM
With spaces would be the normal LG pattern, yes.

znelbok
01-07-2008, 12:53 AM
yep spaces are the norm. Not sure if it is case sensative though. I dont believe that mine is and hence it is working, I am stumped as to why it is not with this one though.

If possible I would like to get remote access one night to see the response that comes back and try a few things

Mick

gizmosrcool
01-12-2008, 09:00 PM
Sure. How far ahead or behind are you from USA eastern time? Maybe PM me with a time that is good for you and I can figure out what time that is here for me and make the time. Thx for the offer. Tom.

rm1759
01-15-2008, 05:57 AM
I am interested in this as well. I just got an LG 42lc7d. I will assume the protocol is similar, and the current LG drivers won't work for mine.

The documentation states that it needs a null modem cable, did you find this to be the case? I just ordered a connector to let me flip the lines...

znelbok
01-15-2008, 12:21 PM
Yup, null modem is needed.

Mick

znelbok
01-26-2008, 12:38 PM
I think the reason that the existing driver does connect is because the state machine is looking for a lf and or carriage return at the end of the reply and it appears to not have either. The state machine I used only looks for the x at the end of the reply, so it should work for just about any LG now.

The only problem with a generic driver as Byron did, is that the inputs and IR code all differe between the models, so A specific driver is better. It takes no time at all to whip one up that gets you going when you already have one. At least all the commands are the same.

The driver just needs the ack/nak now to deal with power off. Some TV's will be dead when off and other will reply with NG00, which gives you a false state at the moment with my driver (the 00 is ths data part of the reply).

Mick

bph
01-27-2008, 09:32 PM
Just to clarify, my driver was never a generic driver. It was a driver for my television.

znelbok
01-28-2008, 02:02 AM
Ahh yes that may be the case, but the documentation tends to indicates otherwise. I think it would be prudent to modify the manifest files to indicate which TV it works for to prevent people from thinking it was for all.

While LG pretty much have the same protocol for all there are enough small differences to not make it work.

Mick

rm1759
01-28-2008, 05:48 AM
Znel, is the link to the driver on the first page still your most recent attempt? I would like to give this a whirl, I am hoping the protocol is the same between the 26LC7D and the 42LC7D, since they seem like the same generation, but different screen sizes..

znelbok
01-28-2008, 11:03 AM
Not yet. I am working on it. I thought I was all but, but there seems to be an issue I need to attend to. Once it is sorted I will let you know.

The 26LC7D is covered by the same manual as the 42LC4D so the driver will be suitable for both.

Mick

znelbok
01-28-2008, 06:04 PM
Here is the lastest beta for the LG LCD 26,32,37LC7D and 42LC4D.

The Aspet Ratio does not poll becasue it was not retunring correct values for some reason.

The documentation was also incorrect with respects to the inputs. If you find that they are wrong then it may the specific model of TV that was wrong (42" was used in the test)

Give a go and let me know how well it works.


mick

rm1759
01-29-2008, 04:34 PM
OK, I think I finally have my cabling working (DB-9 null modem -> RJ45 -> patch panel ->RJ45 -> DB-9 I like to make my life complex).

anyways, driver is stuck trying to connect. I have a com port sniffer I put on the serial port, and it looks to me like the driver is sending stuff, and the tv is responding, here is a screenshot of the sniffer:

http://i205.photobucket.com/albums/bb127/rm1759/LGCOMSniffer.jpg


EDIT: I should also mention again that I have the 42LC7D, I do not know if this makes a difference, the driver is sitting in the "wait for connect" state. Should we move this to the beta driver forum?

znelbok
01-29-2008, 09:49 PM
Here is where it is different again. Yours has a carriage return and a line feed at the begining of the return string. The driver does not look for that and thus finds data in the wrong spot and wont connect.

I also have inadvertantly given the driver the wrong name. It should be 42LCD4D - which does not suit yours.

Let me find the manual and make some quick changes and I'll post it for you.

I have updated the file above to show the correct one.

Mick

znelbok
01-29-2008, 11:52 PM
OK, I think I finally have my cabling working (DB-9 null modem -> RJ45 -> patch panel ->RJ45 -> DB-9 I like to make my life complex).

anyways, driver is stuck trying to connect. I have a com port sniffer I put on the serial port, and it looks to me like the driver is sending stuff, and the tv is responding, here is a screenshot of the sniffer:


Can you turn the TV off and see if there is a reply from the TV. Some are still responding to requests while off.

Mick

znelbok
01-30-2008, 12:05 AM
Try This and let me know

Mick

rm1759
01-30-2008, 08:07 AM
Can you turn the TV off and see if there is a reply from the TV. Some are still responding to requests while off.

Mick

I will double check this tonight, but I am 90% sure the tv was off and still responding...

kblagron
04-13-2008, 07:50 PM
I was contemplating buying an LG 32" 32LC7D, since they are being closed out and some good deals are out there.

Has the 32" TV ever been tested with this driver that you know of?

bph
04-14-2008, 08:04 AM
I was contemplating buying an LG 32" 32LC7D, since they are being closed out and some good deals are out there.

Has the 32" TV ever been tested with this driver that you know of?
Not to my knowledge. The LG protools are all basically the same, and the driver is PDL (the easier to understand of the two driver languages), so you should be able to tweak it.

sic0048
04-14-2008, 08:40 AM
Share the love.....

Where are you seeing good deals on this TV? I'm always looking for a bargain :)

Thanks

kblagron
04-14-2008, 06:26 PM
$699 at newegg. Conn's here locally has a 42" (same version) for less than $1000.

http://www.newegg.com/Product/Product.aspx?Item=N82E16889005008&Tpk=32lc7d

kblagron
05-05-2008, 06:27 PM
I went ahead and purchased a 32" LG 32LC7D TV and loaded the last version posted of the LG42LC7D (Version 0.9) it starts to load, but eventually loses its connection. The other Version that was posted previously (Version 1.1) did not connect at all, and it looks like it may have been for a different TV (LC4D ?).

If I am watching it in the CQC Field Browser, it loads these fields okay -

Passthrough
Power
SendIRCode

And then loses connection. The 4 it fails to load are:

Aspect Ratio
Mute
Source
Volume

It will continue to cycle and go through this loading sequence about every 10 seconds. It is reporting the Power correctly.

I am on Version 2.2.4


Here is a log file excerpt when the verbose is set to High:

05/05 20:41:33-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2644, Status/App Status
Driver 'LG32' has lost its communcations resource
}
05/05 20:41:33-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
GenProtoS, GenProtoS_Maps.cpp.558, API Failed/Not Found, Error: 6804/0/0
Map SourceMap does not contain an item with the value 0
}
05/05 20:41:28-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2497, Status/App Status
Driver 'LG32' has connected to its device
}
05/05 20:41:25-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2457, Status/App Status
Driver 'LG32' is trying to connect to its device
}
05/05 20:41:25-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2426, Status/App Status
Driver 'LG32' has its comm resource
}
05/05 20:41:25-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2386, Status/App Status
Driver 'LG32' is trying to get its comm resource
}
05/05 20:41:20-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2644, Status/App Status
Driver 'LG32' has lost its communcations resource
}
05/05 20:41:20-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
GenProtoS, GenProtoS_Maps.cpp.558, API Failed/Not Found, Error: 6804/0/0
Map SourceMap does not contain an item with the value 0
}
05/05 20:41:15-CQCSERVER, CQCServer, CQCDrv_LG32_Thread2
{
CQCKit, CQCKit_DriverBase.cpp.2497, Status/App Status
Driver 'LG32' has connected to its device
}


Any help would be appreciated,

Blake

Dean Roddey
05-05-2008, 06:36 PM
Looks like it's returning different information for the source query and freaking the driver out.

kblagron
05-05-2008, 08:00 PM
Well I played around with the proto file a bit, and got the connection issues to turn off by commenting out the lines below.


MsgMatching=

//Some LG sets will respond with a CR and a LF at the end of the reply. Others have neither. The commented
//lines are for sets that do have the extra charactes in the reply.
//If there is no CR and LF, then we look for the x at the end of the reply
StateMachine=
State=WaitX
WaitCR=Equals(&InputByte, 0x78);
WaitX=Not(Equals(&InputByte, 0x0D));
EndState;

State=WaitCR
WaitLF=Equals(&InputByte, 0x0D);
WaitCR=Not(Equals(&InputByte, 0x0A));
EndState;

// State=WaitLF
// <Accept>=Equals(&InputByte,0x0A);
// EndState;

// State=WaitX
// <Accept>=Equals(&InputByte, 0x78);
// WaitX=Not(Equals(&InputByte, 0x0D));
// EndState;

EndStateMachine;


I realize I commented out more than the comments said to do, but it was the only way I saw any difference to where the driver would connect.

Now that it will fully connect, I can control the Power On and Power Off fine through the field browser, but the Aspect Ratio, Mute, Source, and Volume are Red in the browser, and if I try and change the Passthrough or SendIRCode (which are black), I get a message that that field is in error state.

Maybe this will help in the debug.

Dean Roddey
05-05-2008, 08:07 PM
If it's just waiting for an X, then you'd probably want just this:


StateMachine=
State=WaitX
<Accept>=Equals(&InputByte, 0x78);
WaitX=True;
EndState;
EndStateMachine;


I would think.

kblagron
05-05-2008, 08:53 PM
I commented out the other lines and added yours, and it gave the same result - Power Worked but changing the text inputs put the field in an error state, although the driver did stay connected.

I will see if BPH or Mick has any suggestions.

Hard to believe LG has so many diff protocols for the same series of TV's.

Thanks for the assistance,
Blake

znelbok
05-06-2008, 01:16 AM
Its most likely the poisition of the data value in the return string.

The protocol is pretty much the same, just they seem to implement slightly different replies which prevent the driver from working with every TV.

Let me get the manual and then I can make some changes for you

Mick

znelbok
05-06-2008, 01:40 AM
Check your PM

Mick

rm1759
05-09-2008, 04:23 AM
Blake, I have the LG 42LC7D. I worked at it for an afternoon or two trying to get a pdl driver working for it. it (kinda) works, but I am still having some trouble with the driver losing the connection.

does your model return status while in standby mode?

How is this driver working for yours?

kblagron
05-09-2008, 06:06 AM
After playing around with the 42LC7D driver as I had mentioned before, I decided to try some of the other LG drivers, and I got the LG_50PC1D driver to load up fine, but did have some problems with it being stable if I made any field changes.

I then increased the time from 1 to 2 seconds in the Polling Sections (i.e. Period=2000;WaitFor=2000;) and this made the driver very stable. I then took this modified 50C1D driver and adjusted it so that it had the correct Aspect Ratio and Source Selections, and it is working fine.

The Mute field is still not being read correctly (i.e. red in the field browser), and the SendIRCode and Passthru fields are in error state. Mick is working to see why.

To make a long story shorter, I can turn it on, off, adjust volume, aspect ratio, and source without problems, which is about all I need to be honest. Mute would be nice, but not required.

I have not checked to see if it returns status when powered down, but I am guessing it does since the field browser reads and shows "Power" as off. Remember, I am a novice on modifying the drivers, but learning.

My guess is that your TV might work like mine with this driver since you were having the same issues as me. Let me know if you want me to send it to you and you can have a try at it.

Blake

znelbok
05-09-2008, 12:13 PM
The TV's dont return anything when powered down. They are classed as a Dead if off device which means the driver goes into a special state where it still polls bet gets nothing, but does not go into error.

There is a special field that can be used while in this special state called a revivefield (notally the power so you can turn it on). Once the power command has been send it will probably go offline for a couple of seconds and then come back with all fields available. This field will show False when the TV is off becasue it cant get a positive reply.

While I am pretty hopeless at driver writing, I am starting to suspect that there may be an issue with the PDL stuff that Dean may need to look at - I have started seeing some stuff that just does not make sense at all. saying that - it may make sense to someone who knows and it is just me.

Blake - As for the Mute field. It was red and then it suddenly came good after I tried to send a passthrough command - not sure why.

WHat you have done with the 50PC1D driver is what I have been doing most of the time, just changing the fields to suit and then the bit offset in the reply. THe bit offset on one of the TV's has moved backwards and forwards making it impossible to get the driver working.

Mick