Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #39909
| Path | csiph.com!usenet.pasdenom.info!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <square.steve@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; 'mrab': 0.05; 'sys': 0.05; 'ok.': 0.07; 'returned.': 0.07; '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; 'email addr:gmail.com>': 0.20; 'skip:" 30': 0.20; '"",': 0.22; '>>>': 0.22; 'assuming': 0.22; 'help.': 0.22; '>': 0.23; 'monday,': 0.23; 'to:2**1': 0.23; 'raise': 0.24; 'connected': 0.24; 'command': 0.24; 'tried': 0.25; 'cc:addr:python.org': 0.25; '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; 'skip:& 10': 0.29; 'connection': 0.30; 'skip:& 30': 0.30; 'url:python': 0.32; 'file': 0.32; 'to:no real name:2**1': 0.32; 'url:listinfo': 0.32; 'traceback': 0.33; 'code:': 0.33; 'weeks': 0.33; 'skip:& 20': 0.33; 'received:google.com': 0.34; 'subject:': 0.36; 'but': 0.36; 'url:org': 0.36; 'email addr:python.org': 0.36; 'useful': 0.36; 'should': 0.36; 'thank': 0.36; 'communicate': 0.37; 'far': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'some': 0.38; 'login': 0.38; 'gives': 0.39; 'instead': 0.39; 'received:192': 0.39; 'hello,': 0.39; 'skip:" 10': 0.40; 'received:192.168': 0.40; 'subject:-': 0.40; 'help': 0.40; 'url:mail': 0.40; 'your': 0.60; 'email addr:gmail.com': 0.63; 'dont': 0.64; 'here': 0.65; 'camera': 0.65; 'risk': 0.66; 'skip:c 50': 0.66; 'header:Reply-To:1': 0.68; 'press': 0.71; 'hoping': 0.72; 'reply-to:addr:gmail.com': 0.79; '-\xc2\xa0': 0.84; '2013': 0.84; 'thoroughly': 0.84; 'cc:no real name:2**2': 0.91; 'conversation': 0.91; 'obvious,': 0.91; 'email addr:googlegroups.com': 0.95; 'you...': 0.96 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:date:subject:message-id:importance:from:to:cc:reply-to :mime-version:content-type; bh=tUXyh8giO1FKyqUU22N2KJPVOhqS4I4rM/sdbkNSVDc=; b=tyAbEDDqg6JhVK9K5gMWFsN4utspuX9QQcE6ScB1WgJLqEknbZuTbkBKHgXnqYFmn8 A5M+2Pfh+DWnoJfeAji+O3WTyMT+6tgQ+nyEtzAIOOasHxrV/epqnT0F3T6X5FLEjmOC Hi9CHMWPxH4JarQegALBPnNs35NINNUVvG5KIDDpe/q4rSbmXdzu+vOaeZeNiLaUHsC4 P3VYd7Vto6Jo8hv1XG235o2p4M5MAqtEbdHCTGstQimHrAyodtdaMDL3fnD9+sc//9Xp EFY6If5gZeFeNuUShT4aKmNn5IIgUeDu1atk0io7ELGP20atjgtCy4I2MnnAhjnpgb6T YeBQ== |
| X-Received | by 10.180.87.170 with SMTP id az10mr14896229wib.3.1361822024859; Mon, 25 Feb 2013 11:53:44 -0800 (PST) |
| Date | Mon, 25 Feb 2013 20:53:33 +0100 |
| Subject | Re: telnet to Cognex In-Sight 4001 camera |
| Importance | normal |
| From | "square.steve" <square.steve@gmail.com> |
| To | chris.annin@gmail.com, comp.lang.python@googlegroups.com |
| MIME-Version | 1.0 |
| Content-Type | multipart/alternative; boundary="--_com.android.email_47329839864400" |
| Cc | python-list@python.org, chris.annin@gmail.com |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| Reply-To | "square.steve" <square.steve@gmail.com> |
| 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> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.2519.1361822026.2939.python-list@python.org> (permalink) |
| Lines | 115 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1361822026 news.xs4all.nl 6968 [2001:888:2000:d::a6]:46623 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:39909 |
Show key headers only | View raw
[Multipart message — attachments visible in raw view] - view raw
Ok. So it looks like MRAB is on the right track and you should be looking for 'User:' in line 6 instead of 'Login:'. Let's see what that gives you...
Sent from a Galaxy far, far away....
-------- Original message --------
From: chris.annin@gmail.com
Date:
To: comp.lang.python@googlegroups.com
Cc: chris.annin@gmail.com,python-list@python.org,"square.steve" <square.steve@gmail.com>
Subject: Re: telnet to Cognex In-Sight 4001 camera
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 | Next | Find similar | Unroll thread
Re: telnet to Cognex In-Sight 4001 camera "square.steve" <square.steve@gmail.com> - 2013-02-25 20:53 +0100
csiph-web