- Posts: 4
- Joined: Tue Jan 23, 2018 10:27 pm
- Real Name: David Taylor
Hi Dave -- I can help you with this, at least get you started.
But because I too had a hell of a time finding instructions how to do this, I hope you'll indulge me -- I'd like to write all this out longhand so it's on the forum and available for the next time someone goes looking for this information. In my own experience over the past couple of days, I have been amazed how little there is on the web dealing specifically with communicating via TCP from the OS X Terminal application, or the MacOS command line. The HyperDeck manual goes into great detail about all the things you can do in a TCP session with the HyperDeck, but doesn't actually tell you how to start a TCP session -- it assumes you already know how to do that. And on the web, while there's a fair amount of discussion about TCP in general, and how it differs from UDP, getting to the crux of your question -- and mine! -- about how to do all this in OS X or macOS, is suprisingly hard to do.
I'd be strongly in favor of the HyperDeck manual including a section with something like "how to start your first remote session with your HyperDeck," where it went into these details for Mac, Windows, and Linux users -- telling us WHAT the commands are, but not WHERE to use them, is frustrating.
OK, so your first question -- you mentioned nc. Great little program, absolutely lousy name for search engines! So although "nc" is the program name on the Mac command line, I'm going to refer to it as netcat, since that's probably the term one would be searching for if one were looking for this information.
You need to know the IP address of your HyperDeck. Ideally, you've assigned it a static address, especially if you're planning to do any long-term scripting. But for purposes of this test, you can simply go to the HyperDeck's menu. Under the "Settings" tab, the deck shows the IP address it's currently assigned to.
From the HyperDeck manual, we know that HyperDeck listens for TCP connections on port 9993. Meaning (again, for someone who might be searching for this information), that in order to establish a TCP connection with the IP address the deck is using, you need to send the request to that port.
Using netcat, (or, as it's known in OS X / macOS, simply nc), you can open a TCP session with the deck.
Open the Terminal application and type the following:
nc [deck's ip address] 9993
Now -- this is the part where I got really tripped up. We are conditioned as web users and programmers to expect lots of different sorts of punctuation in order to help the program figure out what's what on a command -- quotes, commas, semicolons, etc. Even Blackmagic's communication protocol requires colons after each command as part of the syntax. Critically -- netcat does NOT. So in the above command, if your deck's IP address is 10.0.1.3, the command simply is
nc 10.0.1.3 9993
That's it -- no colon before the port, no http:, not quotes, nothing.
Assuming you've got your deck's IP address right, and it's working correctly, the above command will open a TCP session with the deck. HyperDecks are chatty little things, so you'll get the following long-winded response:
500 connection info:
protocol version: [version number
model: Blackmagic HyperDeck Studio Mini (or whichever version you're using
At that point, the session is open and the HyperDeck is ready to take commands. Critically, you will NOT see any sort of a prompt -- no mycomputer: ~myusername$ like you get when you first open the terminal window. All you'll get is a cursor on a new line.
Try typing a couple of commands to see if the deck responds. Again, no quotes or anything like that:
play
device info
ping
...and so on. Presto -- you are communicating with your Hyper Deck, via the MacOS terminal/command line, using a TCP session.
And BTW, the process is exactly the same using Telnet. Instead of using netcat or nc, from the command line, simply type (again, assuming your IP deck's IP address is 10.0.1.3 -- replace with whatever your deck is using:
telnet 10.0.1.3 9993
You should again get the longwinded "500 connection info" message from the deck, after which you'll just have a cursor on a blank line. From there, you can send any of the commands in the manual.
I hope that's helpful!
Matt