When I run this Python 3.1 code to access a device using telnetlib, it works as expected:
import telnetlib
tn = telnetlib.Telnet("15.39.100.126", "23")
tn.write(b"menu\n")
tn.write(b"0\n")
print(tn.read_all().decode('ascii'))
Then, I run this code (very similar to above, but this port presents different menus) to port 223 and get nothing:
import telnetlib
tn = telnetlib.Telnet("15.39.100.126", "223")
tn.write(b"ipconfig\n")
tn.write(b"exit\n")
print(tn.read_all().decode('ascii'))
When running the telnet session to 223 manually, it reports this:
WinCEPocket CMD v 6.00
\>
Has anyone ever run into something like this with different telnet behavior with Python on the same device but different ports, or does anyone know what special approach I need to take with WinCE Pocket? Port 23 does NOT use WinCE Pocket - only port 223 does. Both telnet programs run equally well from the same windows command shell.