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


Groups > comp.lang.python > #80045

Re: pySerial works in miniterm but not in my app

From Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject Re: pySerial works in miniterm but not in my app
Date 2014-10-31 14:00 -0400
Organization IISS Elusive Unicorn
References <5cb7e219-cc34-4a4f-ae93-3a2bbfa9121a@googlegroups.com> <mailman.15335.1414709835.18130.python-list@python.org> <9f933554-ae04-4a3f-8317-0ed4f1e6d5b4@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.15366.1414778411.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, 31 Oct 2014 01:21:48 -0700 (PDT), Dario <d.corti@gmail.com>
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 <CR><LF>. 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

<reader>						<writer>
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/

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


Thread

pySerial works in miniterm but not in my app Dario <d.corti@gmail.com> - 2014-10-30 12:42 -0700
  Re: pySerial works in miniterm but not in my app Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-30 18:57 -0400
    Re: pySerial works in miniterm but not in my app Dario <d.corti@gmail.com> - 2014-10-31 01:21 -0700
      Re: pySerial works in miniterm but not in my app Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-10-31 14:00 -0400
        Re: pySerial works in miniterm but not in my app Dario <d.corti@gmail.com> - 2014-11-01 08:03 -0700
          Re: pySerial works in miniterm but not in my app Dario <d.corti@gmail.com> - 2014-11-01 08:30 -0700
            Re: pySerial works in miniterm but not in my app Dario <d.corti@gmail.com> - 2014-11-01 08:57 -0700

csiph-web