telnet to Cognex In-Sight 4001 camera

chris.annin at gmail.com chris.annin at gmail.com
Mon Feb 25 22:52:43 CET 2013


On Monday, February 25, 2013 1:15:54 PM UTC-8, MRAB wrote:
> On 2013-02-25 20:27, Chris Annin wrote:
> 
> > Ive tried: read_until("Login: "), read_until("User: ") and read_all()
> 
> > all 3 ways return the same thing: "Welcome to In-Sight(R) 4001 Session
> 
> > 1\r\nUser:"
> 
> >
> 
> [snip]
> 
> Does the returned string end exactly with "User:" (no space at the
> 
> end)? I ask because you're asking it to read until "User: " (space at
> 
> the end).

yes it does have the space - sorry. does it make a difference if I use tn.read_until vs tn.read_all?  will it close the connection or not accept a write command if I  dont read_until?  the fact that I get a traceback error when I read_until and I get ",,," when I use read_all - does this mean the connection has been closed?

also when I try tn.open(host) it will give me the welcome screen with the words "session 1" included in the string.  if I then immediately try tn.open(host) again it will give me the same welcome message with "session 1"  could the connection be closing before I get a chance to write the user name?



More information about the Python-list mailing list