Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #39908

Re: telnet to Cognex In-Sight 4001 camera

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 <chris.annin@gmail.com>
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 <mailman.2517.1361820275.2939.python-list@python.org>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=199.181.155.130; posting-account=NWckLgoAAAA_ESRKeclDK3J-ZCP6LE-U
References <mailman.2517.1361820275.2939.python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Message-ID <mailman.2518.1361821869.2939.python-list@python.org> (permalink)
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

Show key headers only | View raw


yes, ive connected successfully using hyperterminal after I login it asks for user and I type admin press enter then it ask for password and type password press enter and it all works fine. using python ive tried ending both with "\n" and "\r\n" im thoroughly confused   




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' telnet session to see what  a successful conversation looks like? Might give you some useful pointers for your debug session.
> 
> 
> Steve
> 
> 
> 
> Sent from a Galaxy far, far away....  
> 
> 
> -------- Original message --------
> From: chris...@gmail.com 
> Date:  
> To: pytho...@python.org 
> Subject: telnet to Cognex In-Sight 4001 camera 
>  
> 
> Hello,  ive been struggling with this for a couple weeks now and was hoping someone might be able to help.  I have an older Cognex camera that I need to communicate with via telnet.  I can get a response from the camera when I initiate a telnet session but I dont seem to get any response when I write the user name to the camera -  I havnt been able to get any response writing anything. Im using python 2.7 and windows xp.  here is the code:
> [code]
> >>>import sys
> >>>import telnetlib
> >>>HOST = "10.31.18.21"
> >>>USER = "admin"
> >>>tn = 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):
>   File "<stdin>", line 1, in <module>
>   File "C:\Python27\lib\telnetlib.py", line 319,
>     return self.read_very_lazy()
>   File "C:\Python27\lib\telnetlib.py", line 395,
>     raise EOFError, 'telnet connection closed'
> EOFError: telnet connection closed
> >>>
> [\code]
> 
> if i do a read_all instead of read_until for user I just get "..." returned.  Im assuming tn.write command isnt working?  any help would be greatly appreciated.
> 
> thank you
> 
> Chris
> -- 
> http://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: telnet to Cognex In-Sight 4001 camera "square.steve" <square.steve@gmail.com> - 2013-02-25 20:24 +0100
  Re: telnet to Cognex In-Sight 4001 camera chris.annin@gmail.com - 2013-02-25 11:42 -0800
  Re: telnet to Cognex In-Sight 4001 camera chris.annin@gmail.com - 2013-02-25 11:42 -0800

csiph-web