Path: csiph.com!usenet.pasdenom.info!news.franciliens.net!fdn.fr!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.xs4all.nl!newsfeed1a.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'source,': 0.04; 'output': 0.05; 'string': 0.09; 'append': 0.09; 'cursor': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'typed': 0.09; 'runs': 0.10; 'question.': 0.14; 'thread': 0.14; '(char': 0.16; "(it's": 0.16; 'byte,': 0.16; 'comm': 0.16; 'eat': 0.16; 'effect,': 0.16; 'handler,': 0.16; 'internally': 0.16; 'looping': 0.16; 'losing': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'switches': 0.16; 'command': 0.22; 'saying': 0.22; 'separate': 0.22; 'byte': 0.24; 'char': 0.24; 'keyboard': 0.24; 'stopping': 0.24; 'text.': 0.24; 'url:home': 0.24; 'possibly': 0.26; 'header:X -Complaints-To:1': 0.27; 'characters': 0.30; 'moved': 0.30; 'returned': 0.30; 'along': 0.30; 'quite': 0.32; 'running': 0.33; 'fri,': 0.33; 'reader': 0.33; 'device': 0.34; 'could': 0.34; 'display': 0.35; 'but': 0.35; 'sequence': 0.36; 'doing': 0.36; 'next': 0.36; "didn't": 0.36; 'charset:us-ascii': 0.36; 'should': 0.36; 'too': 0.37; 'being': 0.38; 'remote': 0.38; 'to:addr:python- list': 0.38; 'that,': 0.38; 'does': 0.39; 'flow': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'read': 0.60; 'full': 0.61; 'new': 0.61; 'first': 0.61; 'back': 0.62; "you've": 0.63; 'response.': 0.68; 'default': 0.69; 'serial': 0.72; 'ending': 0.78; '(is': 0.84; 'console,': 0.84; 'interrupt': 0.84; 'device,': 0.91; 'device.': 0.93; 'received:108': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: pySerial works in miniterm but not in my app Date: Fri, 31 Oct 2014 14:00:03 -0400 Organization: IISS Elusive Unicorn References: <5cb7e219-cc34-4a4f-ae93-3a2bbfa9121a@googlegroups.com> <9f933554-ae04-4a3f-8317-0ed4f1e6d5b4@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-108-79-221-33.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: , Newsgroups: comp.lang.python Message-ID: Lines: 46 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1414778411 news.xs4all.nl 2861 [2001:888:2000:d::a6]:60940 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80045 On Fri, 31 Oct 2014 01:21:48 -0700 (PDT), Dario declaimed the following: > >This is the response from the device, saying that my command was ok, and it also does what it should (it's an hdmi 4-4 matrix, it switches the first output to the next input). Didn't quite answer my question. If the comm line is using remote echo, it could eat the transmitted line ending and append its response on the same line. If it is running no echo, your line ending should have moved the cursor back to the left and possibly down a line -- meaning the device sent back your command string along with its response as a full line of text. Come to that, in the terminal window, after the OK, did it go to a new line (is the device sending a line ending) or just stopping on that line. I don't know how much system buffering takes place, but if it is using remote echo, you've got 19 characters coming back, where a 16550-class serial port internally buffers up to 16 -- with no flow control and if the OS is not buffering via an interrupt handler, you could be losing part of the response. Based on the miniterm source, keyboard echo is turned off -- that means any characters you see are being returned by the remote device. The default is to send . Miniterm runs the serial reader as a separate thread looping over a serial read of 1 byte, the writer is also a thread doing a getkey on the console, so it too is doing 1 byte at a time. So in effect, your line typed in miniterm is doing the sequence wait/read 1 char wait/read 1 key (key rcvd) send key to remote (char rcvd) wait/read 1 key display char wait/read 1 char (key rcvd) send key to remote (char rcvd) ... -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/