Results 1 to 4 of 4

Thread: Interactive Processing Sketch over UDP Connection to Ether Dream

  1. #1
    Join Date
    Jun 2016
    Posts
    2

    Question Interactive Processing Sketch over UDP Connection to Ether Dream

    I'm writing an interactive Processing sketch to control a laser projector by sending messages over UDP to the Ether Dream DAC. I have successfully compiled and run the C driver provided by the Ether Dream creator, and studied the protocol described here: http://ether-dream.com/protocol.html
    I am using the UDP library for Processing, and have successfully read the status signal that the DAC broadcasts every second. I can seemingly send messages (described in the DAC protocol) to the DAC using the udp.send() but I never get the acknowledgement message back.

    udp =new UDP(this,7654);

    When I initialize my UDP object this way I am able to read the broadcast message.

    but...

    udp =new UDP(this,7654,"192.169.0.101");

    When I initialize it this way I get the message:
    opening socket failed!
    > address:192.169.0.101, port:7654[group:null]
    >Can't assign requested addressI have also tried port 7765, which is also mentioned in the documentation but with the same result.

    The UDP library opens a connection like this:

    // open a new socket to the specified port/address
    // and join the group if the multicast socket is required
    try{
    InetAddress addr =InetAddress.getByName(ip);
    InetAddress host =(ip==null)?(InetAddress)null: addr;
    if(!addr.isMulticastAddress()){
    ucSocket
    =newDatagramSocket( port, host );// as broadcast
    log
    ("bound socket to host:"+address()+", port: "+port());
    }

    The C driver provided by the Ether Dream creator which runs successfully opens a connection to the DAC like this:

    struct
    etherdream_conn *conn =&d->conn;
    memset
    (conn,0,sizeof*conn);

    // Open socket
    conn
    ->dc_sock = socket(AF_INET, SOCK_STREAM,0);
    if(conn->dc_sock <0){
    log_socket_error
    (d,"socket");
    return-1;
    }

    unsignedlong nonblocking =1;
    ioctl
    (conn->dc_sock, FIONBIO,&nonblocking);

    struct sockaddr_in addr ={
    .sin_family = AF_INET,
    .sin_addr.s_addr = d->addr.s_addr,.sin_port = htons(7765)
    };

    // Because the socket is nonblocking, this will always error...
    connect
    (conn->dc_sock,(struct sockaddr *)&addr,(int)sizeof addr);
    if(errno != EINPROGRESS){
    log_socket_error
    (d,"connect");
    goto bail;
    }

    The repository for this driver can be found here.
    Why can't I establish a connection to the DAC through the Processing UDP library? How can I modify the Java implementation of the UDP library so that it matches the C driver which can successfully connect to the DAC? I'm relatively comfortable programming in Java/C/Processing but don't have any experience with network programming. Some help would be much appreciated!

  2. #2
    Join Date
    Feb 2013
    Location
    Dallas, TX
    Posts
    439

    Default

    You need someone that isn't me answering this, but I might as well try?

    When you successfully use "udp =new UDP(this,7654);" is there a way you can expand "this" to see what its equivalent is? Also, 192.169.x.x is outside of RFC1918 space, not that it probably matters in this context. Wish I could help more. Jacob may still haunt these parts, otherwise he (or colleagues of his) are certainly found on IRC.

    Good luck!

  3. #3
    Join Date
    Jun 2010
    Location
    Australia
    Posts
    3,734

    Default

    UDP is connectionless. Are you sure you can open a socket connection via UDP? (TCP instead?).
    This space for rent.

  4. #4
    Join Date
    Nov 2007
    Location
    Sydney, Australia
    Posts
    602

    Default

    The very first line in the "Ether Dream - Protocol" documentation states:

    "Communication with the DAC happens over TCP on port 7765."

    and the device only broadcasts UDP (port 7654) for discovery and status "each DAC broadcasts a status/ID datagram over UDP to its local network's broadcast address once per second"
    or listens on UDP port 60000 for OSC traffic responds on UDP port 60001

    and as hitekvoop said, the 192.169.x.x is public addressing, if you have this connected to a router/internet the traffic could weel be getting routed out to the internet, you should alway use RFC1918 address spacing
    RTI Piko RGB 4 Projector
    CT6215 Scanners & CT 671 Amps; CT6210 & Medialas Microamps.
    RGBLaser Systems 6000mW RGB Module - 638nm/445nm/532
    LD2000 Pro + QM2000.net + Beyond
    Etherdream + LSX

    Old Projector Build


Posting Permissions

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