Cool, could I ask a favor, to post what array looks like so I can see the split regex action?
Original Message:
Sent: 05-25-2022 14:11
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Got it working how I want, so I'll share it here for anyone in the future who might be looking.
First I have the callback function in the API:
function callback (success, sentData, resultString, exception) { ogscript.debug('success: ' + success); ogscript.debug('sentData: ' + sentData); ogscript.debug('resultString: ' + resultString); params.setValue('MV_Response', 0, resultString); ogscript.debug('exception: ' + exception);}
Then a button to load the Input Label names into my array:
var IP = params.getValue('MV1_IP', 0);var port = params.getValue('MV1_Port', 0)rosstalk.sendMessageWithResponse(IP, port, '', 'END PRELUDE:', callback);var Inputs = params.getValueAsString('MV_Response', 0);Inputs = Inputs.split("\n\n")[2];Inputs = Inputs.split("\n");var InputArray = new Array();var entry;for (var n=1;n<=16;n++){ entry = Inputs[n] entry = entry.split(/\s(.+)/)[1]; InputArray.push(entry); } params.setAllValues('MV1_Sources', InputArray);
Maybe not the most elegant solution out there, but it works!
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 05-25-2022 13:46
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Thanks, that video helped out. I have made progress and a discovery. I think what is happening that even if I don't see the command in Putty it is still sending, but it is putting the protocol preamble initial data dump each time.
So I have managed to use the following code to extract just the Input labels:
var IP = params.getValue('MV1_IP', 0);var port = params.getValue('MV1_Port', 0)rosstalk.sendMessageWithResponse(IP, port, '', 'END PRELUDE:', callback);var Inputs = params.getValueAsString('MV_Response', 0);Inputs = Inputs.split("\n\n")[2];
Sending a black message because it gives back the data dump first no matter what. Callback function is defined elsewhere and sets the resultString to a "MV_Response" parameter. Then I can use the split function [2] gets me the "Input Labels" section, [3] will get me the "Output Labels" section, etc
So I have successfully got my data into Dashboard, next step is to try to split it all up into my actual string array parameter!
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 05-25-2022 11:56
From: Matt Rasmussen
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
It's called controlling third party devices. Has three examples and the last one is a listener. The associated downloads also contain the script for it.#
------------------------------
Matt Rasmussen
FinePoint Technology
Original Message:
Sent: 05-25-2022 11:30
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
The not seeing anything in Putty refers to sending commands from Dashboard. When I send from Dashboard the "CONFIGURATION:\r\nLayout: 2x2\r\n\r\n" for example I can see that command show up in my Putty window. When I send from Dashboard just the message "INPUT LABELS:\r\n\r\n" I don't see anything trigger or happen in Putty.
I looked for a video tutorial on listeners and couldn't find one. First thing I checked for before coming to the forums. Is it called something else?
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 05-25-2022 11:03
From: Matt Rasmussen
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Ah, I thought I read that you didn't see a thing in putty either. I think what happens in dashboard is when you do a simple TCP with message you would only receive the first line, I think the connection drops as soon as the first delimiter is reached. The listener video tutorial is helpful, it gives you a good example of how to begin parsing that data.
------------------------------
Matt Rasmussen
FinePoint Technology
Original Message:
Sent: 05-25-2022 10:55
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Yes, when I connect with Putty I see the initial data dump. The additional "INPUT LABELS:" command would just do another dump of only the data that I am looking for. Either way, the issue is to get the data into Dashboard for me to use and not just seeing it in Putty.
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 05-25-2022 09:25
From: Matt Rasmussen
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Hi Jake, I've controlled the videohub with Crestron before and when you connect with putty, you should see the initial data dump without having to do anything. It will dump all the input and output names etc.
You don't see that when you connect to TCP port 9990 in putty or other terminal?
------------------------------
Matt Rasmussen
FinePoint Technology
Original Message:
Sent: 05-24-2022 14:35
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Yes, I still didn't see anything trigger in Putty. Super weird how it can send commands perfectly fine to change something, but then to just try to send the command to get the status on something it won't work.
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 05-24-2022 14:07
From: James Peltzer
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
That would mean that the device did not send the response or that my guess that the 'end of message' would be indicated by 2 CRLF sequences is not what the device is actually sending.
------------------------------
James Peltzer
Ross Video
Original Message:
Sent: 05-24-2022 13:42
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Using that code I get "11:41:18:267: FAILED: java.net.SocketTimeoutException: Read timed out" in the debug
------------------------------
Jake Lew
Access Communications Co-Operative Limited
Original Message:
Sent: 05-24-2022 13:31
From: James Peltzer
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Hi Jake
If you are monitoring the incoming messages on the device you are trying to control, I agree that you should start with getting it to detect the request before trying to handle the details of processing the response back in DashBoard.
One thing you could try that is a little lighter than listeners is rosstalk.sendMessageWithResponse - this is handy if you know the response terminator on the device side. For example, if your INPUT LABELS command returns a blank line after the last label, you could send something like this:
function callback(success, sentData, resultString, exception){ if (success) { ogscript.debug("GOT BACK: " + resultString); } else { ogscript.debug("FAILED: " + exception); }}rosstalk.sendMessageWithResponse(IP, port, 'INPUT LABELS:\r\n\r\n', '\r\n\r\n', callback);
Cheers
James
------------------------------
James Peltzer
Ross Video
Original Message:
Sent: 05-24-2022 13:11
From: Jake Lew
Subject: Dashboard get status info of Blackmagic MultiView/Videohub via Telnet
Hi,
I am trying to build a custom panel to control some Blackmagic MultiView and Videohubs that we have. I seem to be able to send commands with no problems... what I am trying to do is to be able to read the current input/output labels and the current routes.... I know this involves setting up listeners, and I have found via these forums an example Dashboard panel that does so, but I can't make heads or tails of it or get it to work...
Although I have found that this may be due to another issue. As I said, I can send commands just fine.
For example:
var IP = params.getValue('MV1_IP', 0);var port = params.getValue('MV1_Port', 0)var telnetScript = "CONFIGURATION:\r\n" + "Layout: 2x2\r\n";telnetScript = telnetScript + "\r\n";rosstalk.sendMessage(IP,port,telnetScript);
Changes the layout of the MultiView no problem.
However, trying to send a message to it to get a status dump seems to not work:
var IP = params.getValue('MV1_IP', 0);var port = params.getValue('MV1_Port', 0)var telnetScript = "INPUT LABELS:\r\n";telnetScript = telnetScript + "\r\n";rosstalk.sendMessage(IP,port,telnetScript);
I have Putty open and connected, so I can see when I fire the command to change the layout I can see it fire in Putty. However for INPUT LABELS: command I don't see anything happen or fire.
So I suppose I would need to get that working before I would be able to even attempt to figure out these listeners.
Any help would be appreciated.
------------------------------
Jake Lew
Access Communications Co-Operative Limited
------------------------------