[ANSWERED] trigger a telnet comand
-
hello, we have to send some simple telnet commands from isadora to obsidian onyx lighting control software. onyx is receiving telnet commands on port 23 on a pc with win10.
we checked it with win enbedded telnet client. we have to open a telnet connection, and then we are able to send commands like "clrclr" (clesr,clesr) and "gql 1,4" (go to cuelist 1, cue number 4) to the ip of the onyx machine on port 23.
the problem for us here is the starting point in isadora. isadora is our main switch unit so we have to trigger from there. and onyx do not allow direct cue calling with midi or osc.
do we have to ask some phyton developer, do we have to learn java, is it enought to buy isadora 4, because there is an telnet send actor?
or maybe someone here can help us?
thx.
-
hello, we get this, so we think we open the connection, but no command transfer.
thx.
-
-
Hi there! Could you give me a bit more information regarding the specific Onyx desk that you have to your disposal?
Since OSC is a protocol that most Onyx desks support, especially if you have a network port.And if that is not an option and your device has a MIDI port, I would personally send MSC (Midi Show Commands) to the desk. Since that is natively supported in Isadora.
-
@deflost said:
If you have Isadora 4 and the new Pythoner actor you can create a Telnet client inside Isadora and send the commands to your client as you wish.
I haven't been able to test this script. If you have Isadora 4 and wish to use this method, please let me know and I will setup a test environment to ensure the script is complete.
import telnetlib # Telnet library to handle Telnet communication (part of the standard Python library) # Define Pythoner inputs and outputs # iz_input 1 "command" # iz_input 2 "trigger" # iz_output 1 "status" # Define global variables TELNET_IP = "192.168.1.100" # Replace with the IP address of the Onyx machine TELNET_PORT = 23 # Default Telnet port CONNECTION_TIMEOUT = 10 # Timeout for the Telnet connection # Initialize variables telnet_connection = None def python_init(command, trigger): """ This function initializes the Telnet connection. """ global telnet_connection try: telnet_connection = telnetlib.Telnet(TELNET_IP, TELNET_PORT, CONNECTION_TIMEOUT) return "Initialized" except Exception as e: return f"Initialization failed: {e}" def python_main(command, trigger): """ This function sends the command over Telnet when triggered. """ global telnet_connection if trigger: if not telnet_connection: return "Error: No connection. Initialize first." try: telnet_connection.write(command.encode('ascii') + b"\n") return f"Command sent: {command}" except Exception as e: return f"Error sending command: {e}" else: return "Waiting for trigger" def python_finalize(): """ This function closes the Telnet connection. """ global telnet_connection if telnet_connection: try: telnet_connection.close() return "Connection closed" except Exception as e: return f"Error closing connection: {e}" return "Finalize completed" if __name__ == "__main__": """ This block allows the script to run in an IDE for testing. It is not executed within the Pythoner actor in Isadora. """ test_command = "clrclr" python_init(test_command, True) print(python_main(test_command, True)) python_finalize()
The above script should be able to be cut and paste into Pythoner (some indenting may need to be corrected. Be sure to select all, as white space is important in Python). It will provide 2 inputs, one that will take your telnet command, and the other to send the command.
NOTE: I suspect that due to the way a Telnet client is created, that you can use only one of these at a time, since it will 'own' the port and raise an error is another client tries to use the same ip/port.