From nobody Sat Apr 20 09:41:49 2024 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VM63q1JmWz5HQjx for ; Sat, 20 Apr 2024 09:41:59 +0000 (UTC) (envelope-from freebsd-questions@ymmv.dk) Received: from mail01.ymmv.dk (193-106-164-141.ip4.fiberby.net [193.106.164.141]) by mx1.freebsd.org (Postfix) with ESMTP id 4VM63p1dWKz4K9s for ; Sat, 20 Apr 2024 09:41:57 +0000 (UTC) (envelope-from freebsd-questions@ymmv.dk) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ymmv.dk header.s=ymmv-mail-dkim header.b="JYIxMF/N"; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd-questions@ymmv.dk has no SPF policy when checking 193.106.164.141) smtp.mailfrom=freebsd-questions@ymmv.dk Received: from c02qx0.local (193-106-164-140.ip4.fiberby.net [193.106.164.140]) by mail01.ymmv.dk (Postfix) with ESMTPSA id 5E3B9126F00 for ; Sat, 20 Apr 2024 11:41:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ymmv.dk; s=ymmv-mail-dkim; t=1713606110; bh=qD2fcbD9nGnBKcOBZkYsJQRbLFmJCSbo+LpzgthpUzU=; h=Date:From:To:Subject; b=JYIxMF/NavyX6dW/WlTvbee1mEmBOetvmJUchwp0kOo4LEFnJlim+LFE00ti+YOdc OHit5FdlaANHHM/tZR6IuURWMc/t/FMKLr4xmMwUUDTdO4/zyIBhjUfXigd9lxeEKo mM3s8L5FOVt0LolcN7DOZEyePO60s5bOLaImLRlr5steTqoC4Hc9M8PyHXRxLQSldN f5xfar89rXruBn3C+Cqxh7faQK4sd5QKqDHMAnR/F0wKLAFz/Jx2c4nLh6d6w/Dx/n tMQwpKWazusD+O3uAFbSy6mfRqP2zPUCvT/McBo8pcBwV7NlUqD8ZOnP/Swd9u74WK KZxREDR1ri7gA== Date: Sat, 20 Apr 2024 11:41:49 +0200 From: Jon Clausen To: freebsd-questions@freebsd.org Subject: serial, basic stuff Message-ID: List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.60 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[ymmv.dk:s=ymmv-mail-dkim]; ONCE_RECEIVED(0.10)[]; RCVD_NO_TLS_LAST(0.10)[]; MIME_GOOD(-0.10)[text/plain]; ASN(0.00)[asn:42541, ipnet:193.106.164.0/22, country:DK]; RCPT_COUNT_ONE(0.00)[1]; R_SPF_NA(0.00)[no SPF record]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; DMARC_NA(0.00)[ymmv.dk]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_TRACE(0.00)[ymmv.dk:+] X-Rspamd-Queue-Id: 4VM63p1dWKz4K9s Hi I need some help getting this figured out, apparently :/ I have two PCengines APU boards ("jh05" and "jh06") - small form factor, headless, with two serial ports each: 0: front mounted DB9 (regular "RS232") 1: header on the board (TTL) Ultimately, I would like to "cross connect" the machines, so: jh05:port0 <-> jh06:port1 jh05:port1 <-> jh06:port0 This way I will have "console" access to either machine, from the other one, which would allow me to make "network interrupting" changes to either system by using the other one for access. Both systems are "identical", and both currently run 13.2-RELEASE Now, I've been using linux for ~25 years, FreeBSD for ~10 - sprinkled with various other unix-like systems on the side during that time - so I'm not a complete newbie. But I have never actually had to work with serial communications very much. Particularly, I have never needed to connect two FreeBSD systems using *actual* serial devices before. Since the ports are different levels (one is TTL, the other is "5V") I thought I'd start out just connecting the DB9 front connectors using a regular null-modem cable. This should minimise the number of things that can go wrong, and once I have this setup working, I can move on to using the RS232<->TTL adapters I have. So, initially, the setup is: jh05:port0<->jh06:port0 I'm using `screen` for the connections, mostly because the keystrokes to kill a `screen` session are not the same as what kills the ssh-connection into the boards. First of all, I'd like some clarification about the tty* devices, versus the cua* devices. Does one use the "cua" device on the "connecting" system? So to connect to jh06, should I expect this to work: jh05:~ # screen /dev/cuau0 Since I have had little success using the serial connections directly, I have used one of my USB<->serial converters. And with this, things seem to be fine. But it does not appear to matter much, whether I use ttyU0 or cuaU0. Both work. If I make a connection like this: jh05:~ # screen /dev/cuaU0 I get the login prompt of jh06. I can then login, break the connection and make a new connection using: jh05:~ # screen /dev/ttyU0 -which then lands me back at the same session on jh06. In practical terms, for my use case, as described above, should I be using the tty* or the cua* device to initiate the connection? Once that's out the way, I'll probably need some guidance for the various flags/settings on each of the devices too - but that's for later br /jon -- YMMV