Rank: Advanced Member
Groups: Registered
Joined: 4/3/2014(UTC) Posts: 58 Location: UK
Thanks: 19 times Was thanked: 4 time(s) in 1 post(s)
|
I am trying to write a script that does a telnet connection to a remote system
I need to define a variable as TCPClient but the type is not defined in the script editor
Essentially i need this: Imports System.IO Imports System.Net Imports System.Net.Sockets
Help please fine vMixer folks :)
Keith
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/15/2018(UTC) Posts: 82 Thanks: 5 times Was thanked: 10 time(s) in 8 post(s)
|
Originally Posted by: smudge1977 I am trying to write a script that does a telnet connection to a remote system
I need to define a variable as TCPClient but the type is not defined in the script editor
Essentially i need this: Imports System.IO Imports System.Net Imports System.Net.Sockets
Help please fine vMixer folks :)
Keith
please explain more what is needed , scripting where ? xamls ??
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 4/3/2014(UTC) Posts: 58 Location: UK
Thanks: 19 times Was thanked: 4 time(s) in 1 post(s)
|
I would like to send TCP commands to a BlackMagic Video hub matrix from a vMix script
this should be just a telnet command to port 9990
I also want to be able to conteol Barco E2 which is also telnet on a custom port
I think i will end up instead doing it via a DLL that i load as a title as i then have the full vb blend enviroment available!
Keith
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 3/12/2015(UTC) Posts: 482 Location: Kansas City, MO USA Thanks: 151 times Was thanked: 75 time(s) in 57 post(s)
|
Originally Posted by: smudge1977 I would like to send TCP commands to a BlackMagic Video hub matrix from a vMix script
this should be just a telnet command to port 9990
I also want to be able to conteol Barco E2 which is also telnet on a custom port
I think i will end up instead doing it via a DLL that i load as a title as i then have the full vb blend enviroment available!
Keith
This is a Very interesting project that I have been thinking about for a long time. Please keep us posted with your progress and details. Good Luck, Steve
|
|
|
|
Rank: Advanced Member
Groups: Registered
Joined: 8/22/2013(UTC) Posts: 92 Location: Rochester, NY Was thanked: 13 time(s) in 9 post(s)
|
In case anyone else wants to send a tcp message to another client using vMix scripting, I just figured it out... Create a new script and add the following code. Be sure to change your destination IP address, port and the message you want to send Code:
Dim clientIP as String = "XX.XX.XX.XXX"
Dim clientPort as String = "XXXXX"
Dim message as String = "YOURMESSAGE"
Dim client As New System.Net.Sockets.TcpClient(clientIP, clientPort)
client.SendTimeout = 1000
client.ReceiveTimeout = 1000
' Translate the passed message into ASCII and store it as a Byte array.
Dim data As [Byte]() = System.Text.Encoding.ASCII.GetBytes(message)
' Get a client stream for reading and writing.
Dim stream As System.Net.Sockets.NetworkStream = client.GetStream()
' Send the message to the connected TcpServer.
stream.Write(data, 0, data.Length)
' Receive the TcpServer.response.
' Buffer to store the response bytes.
data = New [Byte](256) {}
If stream.CanRead Then
Dim myReadBuffer(1024) As Byte
Dim myCompleteMessage As System.Text.StringBuilder = New System.Text.StringBuilder
Dim numberOfBytesRead As Integer = 0
' Incoming message may be larger than the buffer size.
Do
Try
Threading.Thread.Sleep(100)
numberOfBytesRead = stream.Read(myReadBuffer, 0, myReadBuffer.Length)
myCompleteMessage.AppendFormat("{0}", System.Text.Encoding.ASCII.GetString(myReadBuffer, 0, numberOfBytesRead))
Catch ex As Exception
stream.Close()
client.Close()
Exit Sub
End Try
Loop While stream.DataAvailable
' Close everything.
stream.Close()
client.Close()
Exit Sub
Else
Exit Sub
End If
Smudge . . . you were close. Since there is no "Imports", you just have to use your classes explicitly. So for example, to set the output on a videohub: Code:
Dim clientIP as String = "XX.XX.XX.XXX"
Dim clientPort as String = "9990"
Dim input as String = "1"
Dim output as String = "7"
Dim message as String = "VIDEO OUTPUT ROUTING:" & Environment.NewLine & output & " " & input & Environment.NewLine & Environment.NewLine
...
:-) -Brian TESN.US
|
3 users thanked tesn for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 10/20/2020(UTC) Posts: 1 Location: Utah
|
I'm trying to create a script using the code mentioned in this thread. I'm trying to send Telnet commands to a Vaddio Roboshot20 PTZ camera. I have successfully sent commands from command prompt and PowerShell, but I'm not having success in vMix. I think that my issue might be that there is a username and password that you have to enter before you can throw commands at the camera. This is what I've tried so far. Quote:Dim clientIP as String = "192.168.3.101" Dim clientPort as String = "23" Dim message as String = "admin" message = "password" message = "camera preset recall 1"
... I'm not much of a coder so my apologies for my noobiness.
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 2/7/2021(UTC) Posts: 1 Location: Paris
|
Hi jthrup,
Did you find some solutions for your usecase? I've the same situation as you. I am looking to send telnet commands from vmix. I don't have to fill username or password. Only a command like "page 1000: read" with an ip and a port.
It works fine with powershell. But, the script above doesn't work for me either.
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The vMix Forums uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close