Results 1 to 5 of 5

Thread: Simple Transport to send ASCII to an IP socket

  1. #1
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    36

    Default Simple Transport to send ASCII to an IP socket

    I need some asistance with a simple Transport lua to send ASCII strings to my multizone amplifier.

    I can use a simple script as follows to turn on Zone 2 for example;

    local socket = gip.Open('192.168.123.123',9621)
    if socket then
    socket:Write ('EVENT C[1].Z[2]!ZoneOn \r')
    end

    I haven't been able to build a Transport to send the same string (EVENT C[1].Z[2]!ZoneOn) via an Action (I've tried modifying the Tutorial files). Any assistance ia appreciated.

  2. #2
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,346

    Default

    It's probably a good idea to build upon the transport structure not the GIP structure. There are a few examples in the manual. Basically what is going wrong here is that GIP and transport are asynchronous. This means that even though you get a socket it's actually not yet connected. Check out the examples on how to catch the connect.
    Ron
    No support through PM

  3. #3
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    36

    Default

    Thanks Ron

    When you say "the examples on how to catch the connect" are you referring to the Transport tutorials in section 7.6? That's what I've been trying to modify without success - GC Tutorial 1 (and 2).

  4. #4
    Join Date
    Jan 2000
    Location
    Jupiter, FL
    Posts
    11,346

    Default

    That's the ones. Post what you have so far...
    Ron
    No support through PM

  5. #5
    Join Date
    Mar 2010
    Location
    Sydney, Australia
    Posts
    36

    Default

    I've tried a few different things - attached is the Transport that I've had some success with (modified version of mysimple from Shaun5).

    I can use it successfully with the following script but I can't use it to send the same string in a Transport Send.

    local txManager = ComponentManager:GetComponentUsingName('Transport Manager')
    local tp = txManager:GetTransportUsingName('My mysimple_MCA-C5')
    tp:Send('EVENT C[1].Z[2]!ZoneOn\r');
    Attached Files Attached Files
    Last edited by watch; August 23rd, 2012 at 04:26 AM. Reason: progress

Posting Permissions

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