Seeking Simple IP Sockets Example

Discussion in 'Pascal Logic Code Examples' started by random78, Sep 15, 2018.

  1. random78

    random78

    Joined:
    Sep 11, 2018
    Messages:
    5
    Likes Received:
    1
    Hi All,

    I am a long time lurker, first-time poster. I have done my best to search the following question but apologise if I missed the glaringly obvious topic that addresses this question.

    I am currently experimenting with LUA through a SHAC (and PACA) to see if I can port over some of my more complex automation tasks across IP connected devices but am struggling to find example/documentation. Most of these devices are running simple TCP socket-based IP bridges to their existing RS-232 control interfaces. Would someone have easy access to a LUA sockets primer of sorts or a simple sample TCP socket application in LUA that includes a 3-way handshake followed by a command and response?

    eg (for a JVC projector):

    Open Connection to IP:pORT (TCP)
    Wait for "PJ_OK" (up to 5s)
    Reply with "PJREQ"
    Wait for "PJACK" (up to 5s)
    Send Command (typically Hex, eg; \x 06 89 01 50 57 0A)
    Wait for Response (typically Hex, eg; \x 40 89 01 50 57 RR 0A)
    Close Connection

    Any support would be appreciated.

    Kind Regards
     
    random78, Sep 15, 2018
    #1
  2. random78

    znelbok

    Joined:
    Aug 3, 2004
    Messages:
    1,151
    Likes Received:
    17
    Panasonic Projector?
     
    znelbok, Sep 15, 2018
    #2
  3. random78

    random78

    Joined:
    Sep 11, 2018
    Messages:
    5
    Likes Received:
    1
    JVC in this case. But the approach is broadly the same for similar for similar IP bridged RS232 based controls.

    I have had some success with a Denon AVR despite the less than optimal lua documentation but have not tackled how to send hex-encoded strings.
     
    random78, Sep 18, 2018
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.