Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'debug': 0.05; 'sys': 0.05; 'session.': 0.07; 'python': 0.09; 'pointers': 0.09; 'stating': 0.09; 'to:addr:comp.lang.python': 0.09; 'cc:addr:python-list': 0.10; '2.7': 0.13; 'steve': 0.13; '"..."': 0.16; '"\\r\\n"': 0.16; 'away....': 0.16; 'fine.': 0.16; 'galaxy': 0.16; 'isnt': 0.16; 'skip:> 20': 0.16; 'telnetlib': 0.16; 'wrote:': 0.17; 'admin': 0.18; '>>>': 0.18; 'windows': 0.19; 'skip:" 30': 0.20; '"",': 0.22; 'assuming': 0.22; 'monday,': 0.23; 'raise': 0.24; 'connected': 0.24; 'command': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'looks': 0.26; 'appreciated.': 0.26; '(most': 0.27; 'cc:addr:gmail.com': 0.27; 'older': 0.27; 'cc:2**2': 0.27; 'skip:> 10': 0.27; '--------': 0.28; 'chris': 0.28; 'run': 0.28; 'asks': 0.29; 'far,': 0.29; 'initiate': 0.29; 'date:': 0.29; 'url:mailman': 0.29; 'connection': 0.30; 'url:python': 0.32; 'file': 0.32; 'url:listinfo': 0.32; 'traceback': 0.33; 'code:': 0.33; 'weeks': 0.33; 'received:google.com': 0.34; 'received:209.85': 0.35; 'subject:': 0.36; 'but': 0.36; 'url:org': 0.36; 'cc:no real name:2**1': 0.36; 'email addr:python.org': 0.36; 'useful': 0.36; 'thank': 0.36; 'communicate': 0.37; 'received:209': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'some': 0.38; 'login': 0.38; 'instead': 0.39; 'skip:" 10': 0.40; 'subject:-': 0.40; 'help': 0.40; 'url:mail': 0.40; 'your': 0.60; 'from:no real name:2**0': 0.60; 'email addr:gmail.com': 0.63; 'dont': 0.64; 'here': 0.65; 'camera': 0.65; 'risk': 0.66; 'press': 0.71; 'hoping': 0.72; '2013': 0.84; 'thoroughly': 0.84; 'conversation': 0.91; 'obvious,': 0.91 X-Received: by 10.50.217.225 with SMTP id pb1mr1242287igc.5.1361821336265; Mon, 25 Feb 2013 11:42:16 -0800 (PST) Newsgroups: comp.lang.python Date: Mon, 25 Feb 2013 11:42:15 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=199.181.155.130; posting-account=NWckLgoAAAA_ESRKeclDK3J-ZCP6LE-U References: User-Agent: G2/1.0 X-Google-Web-Client: true X-Google-IP: 199.181.155.130 MIME-Version: 1.0 Subject: Re: telnet to Cognex In-Sight 4001 camera From: chris.annin@gmail.com To: comp.lang.python@googlegroups.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: python-list@python.org, chris.annin@gmail.com X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Message-ID: Lines: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361821869 news.xs4all.nl 6950 [2001:888:2000:d::a6]:43401 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39908 yes, ive connected successfully using hyperterminal after I login it asks f= or user and I type admin press enter then it ask for password and type pass= word press enter and it all works fine. using python ive tried ending both = with "\n" and "\r\n" im thoroughly confused =20 On Monday, February 25, 2013 11:24:22 AM UTC-8, square.steve wrote: > At the risk of stating the blindingly obvious, have you run a 'real' teln= et session to see what =A0a successful conversation looks like? Might give = you some useful pointers for your debug session. >=20 >=20 > Steve >=20 >=20 >=20 > Sent from a Galaxy far, far away.... =20 >=20 >=20 > -------- Original message -------- > From: chris...@gmail.com=20 > Date: =20 > To: pytho...@python.org=20 > Subject: telnet to Cognex In-Sight 4001 camera=20 > =20 >=20 > Hello,=A0 ive been struggling with this for a couple weeks now and was ho= ping someone might be able to help.=A0 I have an older Cognex camera that I= need to communicate with via telnet.=A0 I can get a response from the came= ra when I initiate a telnet session but I dont seem to get any response whe= n I write the user name to the camera -=A0 I havnt been able to get any res= ponse writing anything. Im using python 2.7 and windows xp.=A0 here is the = code: > [code] > >>>import sys > >>>import telnetlib > >>>HOST =3D "10.31.18.21" > >>>USER =3D "admin" > >>>tn =3D telnetlib.Telnet(HOST) > >>>tn.read_until("Login: ") > "Welcome to In-Sight(R) 4001 Session 1\r\nUser:" > >>>tn.write(USER + "\r\n") > >>>tn.read_until("User: ") > Traceback (most recent call last): > =A0 File "", line 1, in > =A0 File "C:\Python27\lib\telnetlib.py", line 319, > =A0=A0=A0 return self.read_very_lazy() > =A0 File "C:\Python27\lib\telnetlib.py", line 395, > =A0=A0=A0 raise EOFError, 'telnet connection closed' > EOFError: telnet connection closed > >>> > [\code] >=20 > if i do a read_all instead of read_until for user I just get "..." return= ed.=A0 Im assuming tn.write command isnt working?=A0 any help would be grea= tly appreciated. >=20 > thank you >=20 > Chris > --=20 > http://mail.python.org/mailman/listinfo/python-list