From nobody Sun Apr 21 12:32:37 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 4VMnpL2ddGz5J7mg for ; Sun, 21 Apr 2024 12:32:42 +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 4VMnpJ4tyYz58nC; Sun, 21 Apr 2024 12:32:40 +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=ffR0DK4u; 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 6E9FF1261C7; Sun, 21 Apr 2024 14:32:39 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ymmv.dk; s=ymmv-mail-dkim; t=1713702759; bh=CdMa7EM5191MSmF5C9QEFYfm4EfnrcgjJE0dsE+RCsI=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=ffR0DK4uRuc7xMjtmYpsN7CB3qzm79ZVvSTzW1CO6jFw7KEud5JTKaA42i+6l+A1w X29IXSOm+iUl0SfmdtqRB0+abVCqa9e6tjzXURN8QULalmlwlgGJq4WGIBzVWGClCh 7N7fQ3jGhLV21Zb+inN4Cp/lQLp06XWy9VieTlKySKt13qiwJkRwGMsGXzPL13hZtv 7S+CSPx3AZPBE4CrMeuHUK3Qwafjl1WPu/zwtI+ODfMQ7G7rtdXsjOiRp9b7ylz6y0 v7w05iZH6JefIv7wO6j7xvgWVlNN5lAPQal6HmIKDIncx0LRP7KSKrWXBvaqvWi4QE bXQB2TPbzVn1w== Date: Sun, 21 Apr 2024 14:32:37 +0200 From: Jon Clausen To: Dag-Erling =?utf-8?B?U23DuHJncmF2?= Cc: freebsd-questions@freebsd.org Subject: Re: serial, basic stuff Message-ID: <2e4dm4ow35zarex722okmj2wfcsck3pretodmuza63ccpywqov@qhbguzffdkxc> References: <86le57ajwa.fsf@ltc.des.dev> <86cyqj9i3z.fsf@ltc.des.dev> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.54 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.94)[-0.937]; MID_RHS_NOT_FQDN(0.50)[]; R_DKIM_ALLOW(-0.20)[ymmv.dk:s=ymmv-mail-dkim]; MIME_GOOD(-0.10)[text/plain]; ONCE_RECEIVED(0.10)[]; RCVD_NO_TLS_LAST(0.10)[]; TO_DN_SOME(0.00)[]; ARC_NA(0.00)[]; ASN(0.00)[asn:42541, ipnet:193.106.164.0/22, country:DK]; RCVD_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_NA(0.00)[no SPF record]; DMARC_NA(0.00)[ymmv.dk]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; DKIM_TRACE(0.00)[ymmv.dk:+] X-Rspamd-Queue-Id: 4VMnpJ4tyYz58nC On 2024-04-21 12:06:39 (+0200), Jon Clausen wrote: > On 2024-04-21 11:32:00 (+0200), Dag-Erling Smørgrav wrote: > > disable the serial console on either or both (add `console="vidconsole"` > > to /etc/loader.conf, make sure you don't have `-D`, `-P`, or `-h` in > > /boot.config or /boot/config) and make sure getty is running on port 1 > > instead (change `onifconsole` to `on` on the ttyu1 line in /etc/ttys). > I think I'd rather leave the port0 setup as is, and just use port1 (on both > systems) for now. > > This means I'll need to get getty set up on one side, and make the > connection from the other side. Once I have a working setup like that, I can > then start working towards the port1(client) to port0(server) setup Right. Once I had the wires connected correctly, changed 'onifconsole' to 'on' in /etc/ttys, and issued `kill -HUP 1`, things started working. So after I had a successful connection jh05:cuau1 <-> jh06:ttyu1 using the default settings, I then went on to increase the speed from 9600 to 115200. This worked as well, so I now have a working "high speed" setup. So at this point, I should be ready to move on to attempting the setup that I actually want: jh05:cuau1 <-> jh06:ttyu0 This does not work out of the box. Assuming that the RS232/TTL adapter works, and that I have made the connections correct this time, I suppose the difference in settings between the devices might need aligning. This is what I have currently: root@jh05:~ # stty -a -f /dev/cuau1.init 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 rtsdtr 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; root@jh05:~ # root@jh06:~ # stty -a -f /dev/ttyu0.init 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 rtsdtr 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; root@jh06:~ # And this is where I could use some (more) guidance. I'd like to keep ttyu0 more or less as-is, so that I can connect to them as usual (with a USB-to-serial adapter) when I'm physically near the machines. But I guess the cuau1 settings, which - except for the speed - are unmodified since OS install, sort of reflect the fact that these ports do not have the full "RS232" set of wires. So just copy/pasting the settings from ttyu0 onto cuau1 might not be the proper thing to do. There are a lot of permutations here... :P Any recommendations? br /jon -- YMMV