From owner-freebsd-questions@freebsd.org Sun Oct 1 09:36:56 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 13C7EE3D8B6 for ; Sun, 1 Oct 2017 09:36:56 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from lb1-smtp-cloud8.xs4all.net (lb1-smtp-cloud8.xs4all.net [194.109.24.21]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.xs4all.net", Issuer "RapidSSL SHA256 CA - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACAC67F2C5 for ; Sun, 1 Oct 2017 09:36:54 +0000 (UTC) (envelope-from rsmith@xs4all.nl) Received: from slackbox.erewhon.home ([83.162.243.5]) by smtp-cloud8.xs4all.net with ESMTPA id yaezdjMfeg5cRyaf1dvqp8; Sun, 01 Oct 2017 11:35:45 +0200 Received: from rsmith (uid 1001) (envelope-from rsmith@xs4all.nl) id 1241f by slackbox.erewhon.home (DragonFly Mail Agent v0.11+); Sun, 01 Oct 2017 11:35:41 +0200 Date: Sun, 1 Oct 2017 11:35:41 +0200 From: Roland Smith To: freebsd-questions@freebsd.org Subject: one character lag with pyboard over usb serial Message-ID: <20171001093541.GA81952@slackbox.erewhon.home> Mail-Followup-To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! User-Agent: Mutt/1.9.1 (2017-09-22) X-CMAE-Envelope: MS4wfPWhf1NBqbvsU51UaECwbDZlk2idNXArFOK+emEO1gPVeVT4MXsG0fiTx/Zu+93Zap9pUJz/gBe2pziXeFu5TEYd4+e0gVmMW+6L6sO6IqJIS+xhAJcC ogGqjZh3p2mW/+WQrgtaAGOQGKmnQrvV23nPJmIpmOSG3QoAHUbXLiiA5RyWXOoveLTf9ca6G1ew6g== X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Oct 2017 09:36:56 -0000 Since last week I've been playing with my new pyboard [https://store.micropython.org/#/products/PYBv1_1] It is basically a microcontroller board running python 3 as its operating system. When you plug this in to a computer using USB, it presents itself as both a mass storage device and a modem. Output from dmesg for this device: ugen2.2: at usbus2 umass0 on uhub2 umass0: on usbus2 umass0: SCSI over Bulk-Only; quirks = 0x0100 umass0:3:0: Attached to scbus3 umodem0 on uhub2 umodem0: on usbus2 umodem0: data interface 2, has no CM over data, has no break Using a program like picocom, you can connect to the modem which presents a Python Read Eval Print Loop (“REPL”). The REPL works but has one very annoying problem. It seems to have a one-character lag. The first character I type on a line is not directly shown but creates a new line. Only after I type the second character does the first character becomes visible. Also, any return text from the board longer than a couple of lines seems to stop halfway, and I have to type return for it to continue. I'm using FreeBSD 11.1-STABLE r321626 amd64 with a GENERIC kernel. This is what I see hen I connect to the board with picocom: > ./picocom -b 115200 /dev/cuaU0 picocom v2.2 port is : /dev/cuaU0 flowcontrol : none baudrate is : 115200 parity is : none databits are : 8 stopbits are : 1 escape is : C-a local echo is : no noinit is : no noreset is : no nolock is : no send_cmd is : sz -vv receive_cmd is : rz -vv -E imap is : omap is : emap is : crcrlf,delbs, Type [C-a] [C-h] to see available commands Terminal ready .2 on 2017-08-23; PYBv1.1 with STM32F405RG Type "help()" for more information. After this, I have to tap the key to get the familiar Python prompt (“>>>”) to appear. However, when I e.g. type “help()”, this happens: >>> >>> help( The first key creates a new line. The second key makes the “h” visible. And so on. After typing <)>, typing makes the last “)” visible and produces output. I also tried using “screen”, but that produced the same results as picocom. The stty output for the port is: # stty -af /dev/cuaU0 speed 115200 baud; 0 rows; 0 columns; lflags: -icanon -isig -iexten -echo -echoe -echok echoke -echonl echoctl -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo -extproc iflags: -istrip -icrnl -inlcr -igncr -ixon -ixoff -ixany -imaxbel ignbrk -brkint -inpck -ignpar -parmrk oflags: -opost onlcr -ocrnl tab0 -onocr -onlret cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow -dtrflow -mdmbuf cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = ; eol2 = ; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U; lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q; status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W; I've asked around on the pyboard forum, but nobody there (using Linux or OSX) has seen this problem. It has been suggested that this is a FreeBSD driver problem. Can anyone suggest a fix for this issue? Roland -- R.F.Smith http://rsmith.home.xs4all.nl/ [plain text email much appreciated]