Cleartext UDP and buggy TCP control documentation
Just dropping some info/feedback.
Cleartext UDP Message Format
Your official documentation states regarding the message format of UDP messages that these should conform to OSC which has a specific format.
Your example: Set PB 1 to Level 161
General format: /LS/Level/PB/1 161.182159
OSC/UDP
Char: /LS/Level/PB/1\00\00,f\00\00C!.\a2
Hex: 2f 4c 53 2f 4c 65 76 65 6c 2f 50 42 2f 31 00 00 2c 66 00 00 43 21 2e a2(Personal comment: please don’t unnecessarily use floats instead of ints to make things more complicated than necessary. if levels were normalized to [0.0,1.0], fine, but if the value range is [0,255] what’s the purpose?)
This information is incomplete as it is perfectly possible to send commands as simple strings without any binary data using the S-prefix as to be used for TCP
Examples on the command line:
# note: 10.0.0.10 is the IP of my lightshark device
# go to 2
echo S/LS/Page 2 | socat - UDP-SEND:10.0.0.10:8000
# set PB 2 level to 200
echo S/LS/Level/PB/2 200 | socat - UDP-SEND:10.0.0.10:8000This means:
It’s really easy to send commands from any command line.
using the “S” prefix makes lightshark interpret the following data as string
————> Please document this instead of requiring users to have implement a complicated binary format. Really.
BUG TCP Connection management BUG
Lightshark terminates any TCP connections after receiving and processing a single command.
This goes against the idea of maintaining a connection and UDP should be used instead. To test wether a device is reachable, just do a sync-request over UDP.
Alternative ideas:
Reuse the same format as used for serial (one command per newline without prepending S). This would also be cool because one could use commands like on a terminal.
Prepend a command length either in a binary or text-based format. Or actually, do everything completely binary instead of text-based (but that’d go against your current approach).
TCP Command format
You mention that commands should be formed like OSC messages but be prefixed with an S.
You do not state wether commands should be binary (like actual OSC messages, or the UDP examples given) or just plain text.
Please be clear about this.
Edit: Oh yes, most recent lightshark and documentation version 16.0.01