Send bytes over udp (VISCA over ip)

Bonjour tout le monde. Je me permet ce message en français car beaucoup plus simple pour moi, mais je peux repasser avec un anglais moyen si besoin.

Je cherche à envoyer via udp des infos en bytes pour avoir accès a des fonctions avancées d'une ptz. J'ai fait mes tests avec le format [HEX_FF] mais sans succès. Lorsque je monitor via Chataigne, je reçois des data qui semble être des entiers (je reçois 255 pour FF par exemple). J'ai peut-être loupé quelque chose.... J'ai une solution sous le coude via châtaigne justement mais si (grâce aux scripts) je peux tout faire dans Millumin ça peut être vraiment top !

Merci beaucoup !

Comments

  • Hello @pierreadrien,

    I am replying in French, so everybody could follow the conversation. If you want to speak in French, you should rather reach us via email.

    What UDP port are you using ? 52381 ?

    What are you sending in your data-track ? According to VISCA-over-IP specifications, you can have up to 24 bytes in your VISCA command. Thus, because VISCA is a binary format (not a string), you can have to write up to 24 times something like [HEX_XX]

    Best. Philippe

  • edited July 18

    Thanks for your answer !

    I'm using the port 5231 according to my PTZ specs. I send something like : [HEX_81][HEX_01][HEX_7E][HEX_01][HEX_0A][HEX_00][HEX_02][HEX_FF]

    (an example that turn on the Tally Lamp)

    I'll recheck the port next week with the PTZ in front of me !

    Best. Pierre-Adrien

  • Hello @pierreadrien,

    According to VISCA specifications, you need to add a "header" in your message.

    Here is a script that does so (and you can change the VISCA command, so it is more practical) :

    commandString = "81017E010A0002FF" // VISCA command : make tally control red 
    commandLength = commandString.length/2
    
    headerString = "0100" // payload type = command
    headerString += commandLength.toString(16).padStart(4,"0") // payload length
    headerString += "00000000" // sequence number = 0
    
    string = headerString+commandString
    finalString = ""
    for(i=0; i<string.length; i+=2)
    {
      finalString += "[HEX_"+string.substr(i,2)+"]"
    }
    
    log("HEADER = "+headerString+"\nCOMMAND = "+commandString)
    Millumin.sendString("127.0.0.1:1234", finalString)
    


    As you can see, the total hexadecimal message is :

    01 00 00 08 00 00 00 00 81 01 7E 01 0A 00 02 FF


    Best. Philippe

    PS : in next beta update (5.15.g), you will be able to stack hexadecimal values, so writing directly [HEX_010000080000000081017E010A0002FF] instead of every byte one by one

  • It works !! Thanks !

Sign In or Register to comment.