Re: telnet to Cognex In-Sight 4001 camera

Discussion in 'Python' started by MRAB, Feb 25, 2013.

  1. MRAB

    MRAB Guest

    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).
     
    MRAB, Feb 25, 2013
    #1
    1. Advertising

  2. MRAB

    Guest

    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?
     
    , Feb 25, 2013
    #2
    1. Advertising

  3. MRAB

    Guest

    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?
     
    , Feb 25, 2013
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Newbie
    Replies:
    6
    Views:
    504
    The Artist Formerly Known as Kap'n Salty
    Feb 2, 2005
  2. Carcarius
    Replies:
    0
    Views:
    331
    Carcarius
    Dec 6, 2007
  3. Replies:
    5
    Views:
    512
    Roy Smith
    Feb 26, 2013
  4. Replies:
    0
    Views:
    131
  5. Chris Annin
    Replies:
    0
    Views:
    155
    Chris Annin
    Feb 25, 2013
Loading...

Share This Page