You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a simple python script that switches the preview source but I'm finding that it often takes multiple attempts to connect to the ATEM on the same physical network (both devices on the same switch). Am I using this API incorrectly (apologize, I am a Python novice).
def connect_to_atem():
"""Establish connection to ATEM with retry logic"""
switcher = PyATEMMax.ATEMMax()
max_attempts = 5
try:
logger.info(f"Attempting to connect to ATEM at {ATEM_IP}")
switcher.connect(ATEM_IP)
for attempt in range(max_attempts):
logger.info(f"Connection attempt {attempt + 1} of {max_attempts}")
if switcher.waitForConnection(timeout=10.0):
logger.info("Connected to ATEM")
return switcher
else:
logger.warning(f"Attempt {attempt + 1} failed")
if attempt < max_attempts - 1:
time.sleep(1)
switcher.disconnect()
time.sleep(0.5)
switcher.connect(ATEM_IP)
return None
except Exception as e:
logger.error(f"Error connecting to ATEM: {e}")
return None
The text was updated successfully, but these errors were encountered:
Hi,
I've got a simple python script that switches the preview source but I'm finding that it often takes multiple attempts to connect to the ATEM on the same physical network (both devices on the same switch). Am I using this API incorrectly (apologize, I am a Python novice).
The text was updated successfully, but these errors were encountered: