Results 1 to 10 of 10

Thread: 42LG50 RS232 Receive

  1. #1
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    151

    Default 42LG50 RS232 Receive

    Hi Guys,

    I've been pouring over the forum trying to figure out how to receive rs232 commands back from my LG LCD TV. I've read through some very similar posts but nothing seemed to help.

    I can send commands to the TV fine via girder, but I do not receive anything back. I've attached my init.lua and my LGTV.lua

    When I use hyperterminal, I can see that the TV is sending back responses:
    Code:
    ka 0 0
    response:  a 00 NG00x
    The "x" is the terminator for the LG's rs232 protocol.

    However, in girder, all i ever receive in the LuaConsole is:

    Code:
    Serial:  LGTV :  Simple Send:   6B 61 20 30 20 31 2F 72      ka 0 1/r
    Serial:  LGTV :  Simple Receive:  Data    Code:  16384
    Serial:  LGTV :  ERROR: No response to last command
    Any thoughts as to what I have wrong in my LGTV.lua?
    Attached Files Attached Files
    Scott

  2. #2
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    You're sending /r rather than \r (ie a carriage return)
    --Rob

  3. #3
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    151

    Default

    Ah good catch Rob. That was a typo that I had fixed prior to uploading.

    However, my situation is still the same - I can send commands to the TV and I am controlling it fine via girder, so the send side of my lua script seems to work fine.

    I still do not receive any responses back from the TV. (This sample turns the TV on fine. note I renamed the TV id to "1" in this example)

    Code:
    Serial:  LGTV :  Simple Send:   6B 61 20 31 20 31 0D      ka 1 1.
    Serial:  LGTV :  Simple Receive:  Data    Code:  16384
    Serial:  LGTV :  ERROR: No response to last command
    Last edited by gravy; December 7th, 2008 at 08:46 AM.
    Scott

  4. #4
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    You also have the ReceiveTerminator set to 'x' - it should be '\r' as well shouldn't it?

    Actually it should be '\r\n' I believe.
    Last edited by Rob H; December 7th, 2008 at 09:10 AM.
    --Rob

  5. #5
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    151

    Default

    I tried '\r\n' with no difference in results, Rob.

    I think 'x' is the right receive terminator, based on what I see in hyperterminal results, as well as the rs232 manual for this set:

    http://www.merrimacs.ca/misc/hyperterm.JPG

    From the LG manual:
    Code:
    [Command2][ ][Set ID][ ][OK][Data][x]
    
    OK Acknowledgement
    The TV transmits ACK (acknowledgement) based on this format
    when receiving normal data. At this time, if the data is
    data read mode, it indicates present status data. If the data is
    data write mode, it returns the data of the PC computer.
    * In this model, TV will not send the status during the standby mode.
    * Data Format
    [Command 2] : Use as command.
    [Set ID] : Use the small character, if set ID is 10, it will send the ‘0’, ‘a’.
    [DATA] : Use the small character, if data is 0 x ab, it will send the ‘a’, ‘b’.
    [OK] : Use the large character.
    I even tried moving to a fixedlength setup with no luck. I wonder what could be different between Hyperterm and Girder's receive methods?! I have the com parameters setup identically.
    Last edited by gravy; December 7th, 2008 at 09:48 AM.
    Scott

  6. #6
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    151

    Default

    Update:
    I installed a serial port monitor and viewed how the communications are setup differently between hyperterminal and girder.

    According to the port monitor, Girder sets up the connection with the following settings:
    Code:
    Baud rate 9600
    DTR off
    RTS off
    Data bits=8, Stop bits=1, Parity=None
    Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
    Handflow: ControlHandShake=(), FlowReplace=(XOFF_CONTINUE), XonLimit=128, XoffLimit=128
    RTS on
    DTR on
    Purge the serial port: RXCLEAR
    When i issue a command, I can see that the TV does not respond with data.

    Here is how Hyperterminal looks when it connects to the port:
    Code:
    COM port is opened
    In/out queue size 8192/8192
    Baud rate 9600
    RTS on
    DTR on
    Data bits=8, Stop bits=1, Parity=None
    Set chars: Eof=0x00, Error=0x00, Break=0x00, Event=0x00, Xon=0x11, Xoff=0x13
    Handflow: ControlHandShake=(DTR_CONTROL, ERROR_ABORT), FlowReplace=(TRANSMIT_TOGGLE, RTS_CONTROL, XOFF_CONTINUE), XonLimit=80, XoffLimit=200
    Set timeouts: ReadInterval=10, ReadTotalTimeoutMultiplier=0, ReadTotalTimeoutConstant=0, WriteTotalTimeoutMultiplier=0, WriteTotalTimeoutConstant=5000
    When I send a command via hyperterminal, the port monitor shows that the TV responds!

    So the question is... how do I configure girder to establish the connection in the same fashion as hyperterminal!
    Last edited by gravy; December 7th, 2008 at 12:41 PM.
    Scott

  7. #7
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    This is very strange, I can't think of any reason why you shouldn't be able to receive characters from that port.

    Is this a genuine serial port, a USB<->Serial adaptor or something else?
    --Rob

  8. #8
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    151

    Default

    I'm using a USB -> Serial Adapter. (I control about 5 rs232 devices, 4 of them with USB -> Serial adapters, one with a true serial port.)

    I'll try using a true serial port tonight as a test - but you'd think if it was a transcoding issue with the dongle, that Hyperterminal wouldn't work either.
    Last edited by gravy; December 8th, 2008 at 01:52 PM.
    Scott

  9. #9
    Join Date
    Aug 2004
    Location
    Winnipeg, MB, CANADA
    Posts
    151

    Default

    Update: There was no difference between using a "real" serial port and a serial->USB converter.

    ?? I'm stumped. Is there anything further within the init.lua or serial.dll I can use to setup the connection more similarly to hyperterminal? Or are the differences noted by the serial monitor tool just a red herring?
    Scott

  10. #10
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    That's very strange. You say that you've tried CB_FIXEDLENGTH before - what happens if you do that but set the length to 1?

    The other possibility is to try Girder 5 to see if that makes a difference I guess.
    --Rob

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •