12: Scripts
EMG™ Edge Management Gateway User Guide
275
loggedIn = True
slcPrompt = p.match.group(1).decode('utf-8')
if numPorts == 0:
print("Cannot determine number of device ports.")
p.terminate(True)
sys.exit(1)
print("Number of device ports:", numPorts)
# Terminate the CLI session
p.sendline("logout")
time.sleep(.500)
p.wait()
skipPorts = False
devicePort = 1
pList = []
if numPorts == 24 or numPorts == 40:
# Adjust port numbering for SLC8024 and SLC8040
skipPorts = True
numPorts = nu 8
# Loop through device ports, connect and try to detect the prompt
while devicePort <= numPorts:
if skipPorts and devicePort >= 9 and devicePort <= 16:
devicePort = devi 1
pList.append('')
continue
print("Scanning device port", devicePort, "...")
port = str(devicePort)
p=pexpect.spawn('portsession', ['-p', port])
# Login (if required), and wait for the first prompt
p.sendline("")
gotPrompt = False
emgDevice = False
cnt = 1
while not gotPrompt:
i = p.expect([pexpect.TIMEOUT, pexpect.EOF,
'login:', 'Error: (.*)\r\n',
'>'], timeout=10)
if i == 0: # Timeout
cnt = cnt + 1
if cnt == 3:
print("Timeout waiting to connect to DP", devicePort, ".")
p.terminate(True)
p.wait()
break
# may need to send a CR to get prompt
p.send("\r")
elif i == 1: # EOF
Summary of Contents for EMG 7500
Page 100: ...7 Networking EMG Edge Management Gateway User Guide 100 Figure 7 5 Network Wireless Settings ...
Page 353: ...15 Maintenance EMG Edge Management Gateway User Guide 353 Figure 15 12 About EMG ...
Page 474: ...EMG Edge Management Gateway User Guide 474 Figure E 3 EU Declaration of Conformity ...
Page 475: ...EMG Edge Management Gateway User Guide 475 Figure E 4 EU Declaration of Conformity continued ...