Control TV via serial cable (1 Viewer)

MTBikerTim

Portal Member
August 4, 2007
8
0
Home Country
What I would like to do is control my TV via serial cable from the computer. This is so the tv goes on and off when the pc is resumed and put into standby.

I have tried MCE Replacement and it can turn the TV off and on via the serial cable but for some reason it is not reliable and completely unpredictable as to when it will work. About the only pattern that I can see is that it seems to work once and then won't work for a minute or 2. This may have something to do the the TV trying to send acknowledgements back to the pc. Can anyone give me any recommendations on how to do this? Are there any other programs I could try that may work better with my TV. My TV is an LG but I am not at home so I can't give the exact model, all the serial commands are listed in the manual.

As a last resort I may try to write an app to do this for me but this will take time and I'd rather get this working quickly.

Thanks for any help in advance. Sorry that my first post is question. I try not to do this.

Edit:
Thought I had better add
I am using Media Portal 0.2.3rc1 and MCE Replacement Plugin 1.0.3.1.
 

MTBikerTim

Portal Member
August 4, 2007
8
0
Home Country
Update: As the TV sends back acknowledgement data I thought it would be best to write my own app to talk to the tv and to also display the data the tv returns. I have found that the problem seems to have nothing to do with what mce replacement is doing as my app is doing exactly the same thing. Any one have any clues or experience with talking do other devices via com port. Is there some mode the com port should be in? there must be something I am missing.
 

jburnette

Portal Pro
August 24, 2006
758
116
Kentucky
Home Country
United States of America United States of America
You might take a look at the directv control plugin. You may be able to get a better idea as to how to use the COM port. It controls directv boxes through the com port as well.
 

MTBikerTim

Portal Member
August 4, 2007
8
0
Home Country
I know tis is probably going to sound stupid but is it possible to get the source code for that plugin some where? I'm struggling to find even the mediaportal source at the moment. too early in the morning.
 

and-81

Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    Hey MTBikerTim,

    You could try putting a pause in a macro with the serial command to turn your tv on/off. It might be that windows hasn't "fully resumed" before it tries to send the serial command.

    Alternatively, I could add a serial read command that will read any ack the tv has sent back.

    Try the pause and let me know how you go, and I'll take it from there. Out of interest, is the TV's interface documented? Perhaps I could take a look at that and see if there's anything I should change in the plugin to be more compatible with it.

    I'm looking at incorporating better directv support into the plugin, but I don't have one so it's hard to know if I'm doing it right. This may ultimately lead to a better serial command interface ...

    Cheers,
     

    jburnette

    Portal Pro
    August 24, 2006
    758
    116
    Kentucky
    Home Country
    United States of America United States of America

    MTBikerTim

    Portal Member
    August 4, 2007
    8
    0
    Home Country
    Thanks jburnette and and-81.

    To jburnette thank you, of course the source code is on source forge. I'll use the excuse again that it was too early in the morning.

    Hi and-81 the serial interface on the TV is fairly well documented. I have attached the manual. I am obviously missing something though as my interpretation of what the manual says to send the tv to get it to power on and off gives strange results. If anyone would like to give me there interpretation I would appreciate it. I am just using the test button in the serial command section of your plug-in and I have tried writing my own code but both have the same results. The TV is set to set ID 1. When I send a command like "ka 1 \h0xff\r" the tv is just as likely to turn off or do nothing as it is to return it's status.
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    I've read the manual and I think I see the problem. You've got your serial command incorrectly structured.

    From the manual:
    Set ID: You can adjust the set ID to choose desired TV ID number in Setup menu. Adjustment range is 1~99. When selecting Set ID ‘0’, every connected the TV is controlled. Set ID is indicated as decimal (1~ 99) on menu and as Hexadecimal (0x0~ 0x63) on transmission/receiving protocol.

    It should be,

    For Power off:
    ka \x0h \x0h\r

    For Power on:
    ka \x0h \x1h\r

    There is nothing in the command structures that couldn't be generated by the plugin in it's current form... If the TV wont execute the command until the pc has received a reply then I could create an option for serial commands to also wait until they've received an acknowledgement before closing the port.

    I like this TV Set, these abilities it has are great. It would be nice if the volume control command could work with steps and not set levels... but the ability to change all the picture settings is nice, you could have completely different settings when watching a movie and then when watching tv...

    Once you get the power commands working you could string a few commands together in a macro to select the input and that sort of thing.

    Let me know how it goes.

    Cheers,
     

    MTBikerTim

    Portal Member
    August 4, 2007
    8
    0
    Home Country
    Yep thats is another thing I need to look into how to do macros in your plugin. I have tried what you said for tv on and off in my own little program and it still wouldn't work. I will give it another go with your plugin. Thanks for your help I will let you know how I go. Also I do like this serial conection feature too. It seems to be standard on LG sets. Now if only I could get it to work.
     

    and-81

    Retired Team Member
  • Premium Supporter
  • March 7, 2005
    2,257
    183
    Melbourne
    Home Country
    Australia Australia
    Have you tried using a terminal emulation program like HyperTerminal to connect to the TV?

    You would probably have to put your command into a file and send the file because you wouldn't be able to type the commands... But you would get the tv acknowledgement's back at you, and if it worked then maybe that's all that needs to be done ... leave the port open until something is sent back... I'll probably add this to my serial commands feature anyway ...

    Let me know if you get it working in the meantime.

    Cheers,
     

    Users who are viewing this thread

    Top Bottom