Sorry for reanimating an old thread (sometimes they come back…), but I have the same problem. Not with Opera/JSON, but the TCP answer of FreeStyler.
I already got to work FreeStyler receiving TCP commands via LAN either as Byte or as ASCII, both working fine (I now use ASCII exclusively because I can't find the right way splitting codes above 255 into MSB/LSB). FreeStyler on the other PC receives and executes the commands. The
Connection Test is fine, too.
But when I try to request the button captions from FreeStyler, I get no result.
The documentation states as follows:
Code: Select all
Byte Protocol: 9 bytes
byte 0: “F”
byte 1: “S”
byte 2: “B”
byte 3: “C”
byte 4,5 and 6 : Code (see table)
byte 7,8 and 9 : 0
[Code:]
001 Cue captions
[…]
examples:
"FSBC001000" -> You will receive the 20 captions of the current cue (comma separated)
[…]
This is the Java code I use (for clarity I removed the try/catch phrases):
Code: Select all
address = InetAddress.getByName("Nanako");
port = 3332;
socket = new Socket(address, port);
InputStream is = socket.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
message = br.readLine();
It's the same code I use for sending code, there of course with
OutputStreamWriter and
BufferedWriter.
I tried br.read() in a loop, too. I get "160" from time to time, but no captions or other text / values.
It seems the documentation is not clear enough or at least ambiguous. I would gladly help overhauling some documentation, as I started in the Wiki.
It has to work, otherwise there wouldn't be apps and adddons using it like your Remote App, Mattotone.
Can someone please help me to get my head around this function?