Results 1 to 8 of 8

Thread: Need help with Lua, RS232, Hex, checksum, recieve values

  1. #1
    Join Date
    Sep 2011
    Posts
    6

    Question Need help with Lua, RS232, Hex, checksum, recieve values

    Hi
    I'm trying to control my reciever(NAD T763) by RS232.
    After monitoring the serial interface while using the dedicated NAD control application I've been able to document the commands I need. I've been able to utilize this commands via the Transport Send funcions, and the included SimpleSendAndRecieve-lua script.

    However, I want more
    1: I want to query values, like volume, source etc
    2: I want these values available on the girder webpage
    Here's where I need help. I don't know what to add to the lua file, the rs232-documentation is a lot more advanced that I'm used to, and I don't know how to present these values in the web page.

    My forum user is not allowed to add url's to the RS232-documentation, but I'll try to explain:
    Basicly the format is like this: <start>, Command, Data, <checksum>, 8-bit Checksum
    Where <start> is always 01, <checksum> is always 02, and the 8-bit Checksum is ones complement of the sum of the Command and Data bytes.
    Also note that values 0-19 is reserved, and need to be encoded with a flag character of 94

    Set examples:
    01 16 C2 02 27 - Set Source 1
    01 16 C0 02 29 - Set Source 2
    01 16 8C 02 5D - Set Volume -1 dB
    01 16 88 02 61 - Set Volume +1 dB
    Query examples: HEX14(DEC20)=Query
    01 14 14 02 D7 Answer:01 14 14 54 37 36 33 02 E3

    Best Regards, Sigurd

  2. #2
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    342

    Default

    Whats the exact question?
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  3. #3
    Join Date
    Sep 2011
    Posts
    6

    Default

    Need help modifying the simple lua file to receive answer to queries. Right now I'm just sending values to change volume etc. I will also need to calculate checksums as well, but my first priority is to actually receive a value, and present it in girder.
    So first things first.
    I want to send "01 14 14 02 D7", the receiver will reply with "01 14 14 54 37 36 33 02 E3"(1,20,20,84,55,54,51,2), where 84,55,54,51=T763. I want to display T763 on screen.

    Best Regards, Sigurd

  4. #4
    Join Date
    Sep 2011
    Posts
    6

    Default

    And I guess the first question is: What should I define as the the terminator character?

  5. #5
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    342

    Default

    Quote Originally Posted by Wernicke View Post
    And I guess the first question is: What should I define as the the terminator character?
    From the example you gave I have the impression that its not a terminated protocol, but a fixed length protocol (every message/response has the same number of bytes).
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  6. #6
    Join Date
    Jul 2007
    Location
    Netherlands
    Posts
    342

    Default

    Quote Originally Posted by Wernicke View Post
    Need help modifying the simple lua file to receive answer to queries. Right now I'm just sending values to change volume etc. I will also need to calculate checksums as well, but my first priority is to actually receive a value, and present it in girder.
    So first things first.
    I want to send "01 14 14 02 D7", the receiver will reply with "01 14 14 54 37 36 33 02 E3"(1,20,20,84,55,54,51,2), where 84,55,54,51=T763. I want to display T763 on screen.

    Best Regards, Sigurd
    What is "the simple lua file", what code are you currently using? and displaying; on what screen?
    Using: Win7 MCE, Girder, xPL, RFXcom, HomeEasy

    http://www.thijsschreijer.nl

  7. #7
    Join Date
    Sep 2011
    Posts
    6

    Default

    SimpleSendAndReceive.lua in the transport/devices folder.
    By displaying I meant OSD, but receiving a reply in the log is sufficient.

  8. #8
    Join Date
    Sep 2011
    Posts
    6

    Default

    Looks to me that it can be different lenght.
    01 15 39 5E 41 02 B0 = Radio preset 1
    01 16 CE 02 1B = Speaker A On/Off

    Is it possible to define the termiator as HEX 02 + one byte?

Tags for this Thread

Posting Permissions

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