Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Apr 2023 12:11:33 -0700
From:      Gary Aitken <freebsd@dreamchaser.org>
To:        Souji Thenria <mail@souji-thenria.net>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Cc:        markmoellering@psyberation.com
Subject:   Re: serial from usb port, cu using /dev/cuau0
Message-ID:  <675fd143-24b1-c1d6-a871-5ae54ab238f4@dreamchaser.org>
In-Reply-To: <b287450d-187d-0ab6-b4e8-94af8270dba5@souji-thenria.net>
References:  <2a149c85-7aa3-c92c-0518-219d52971453@dreamchaser.org> <b287450d-187d-0ab6-b4e8-94af8270dba5@souji-thenria.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 4/18/23 07:05, Souji Thenria wrote:
> On 4/18/23 14:32, Gary Aitken wrote:
>> Assuming that actually happened, how does the system know which usb
>> / serial port to use?
>> 
> 
> Not sure if I understand your question correctly. But you specify the
> serial device in your command in this part, '-l /dev/cuau0', and the
> device ('/dev/cuau0) is created when you connect the USB-serial
> converter. So, you are telling 'cu' what device to use for your
> serial connection.

A more careful inspection shows that cuau0 always exists for the fixed
serial port on the mobo:

# ls -lt /dev/cua*
crw-rw----  1 uucp  dialer  0x45 Apr 18 08:19 /dev/cuau0
crw-rw----  1 uucp  dialer  0x46 Mar 25 08:27 /dev/cuau0.init
crw-rw----  1 uucp  dialer  0x47 Mar 25 08:27 /dev/cuau0.lock

And the generated one uses a capital 'U' instead of lowercase 'u':

# ls -lt /dev/cua*
crwxrwx---  1 uucp  operator  0xd7 Apr 18 12:55 /dev/cuaU0.lock
crwxrwx---  1 uucp  operator  0xd6 Apr 18 12:55 /dev/cuaU0.init
crwxrwx---  1 uucp  operator  0xd5 Apr 18 12:55 /dev/cuaU0
crw-rw----  1 uucp  dialer    0x45 Apr 18 08:19 /dev/cuau0
crw-rw----  1 uucp  dialer    0x46 Mar 25 08:27 /dev/cuau0.init
crw-rw----  1 uucp  dialer    0x47 Mar 25 08:27 /dev/cuau0.lock

At least *some* of the time I was doing the cu command before plugging
in the cable; since cuau0 was the only one visible at that time, that's
the only one I could use and what I tried to connect to.  So I got a
connection, but not to the cuaU0 created after plugging the cable in.

On 4/18/23 08:41, Mark Moellering wrote:

> I connect via serial to a firewall, and I discovered that it usually
> comes up with a blank screen.
> 
> The command I use is:  cu -l cuaU0 -s 115200
> 
> If I hit enter, then the login prompt appears but otherwise, I , like
> you, often see "connected", with an otherwise black screen and no
> prompt.  hope this helps.

Thanks.
If nothing is plugged in to the USB port and I use cuaU0, I get:

# cu -h -t -s 9600 -l /dev/cuaU0
/dev/cuaU0: No such file or directory
link down

You sure you're not using cuau0 when that happens and have an on-board
serial as well?

Gary



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?675fd143-24b1-c1d6-a871-5ae54ab238f4>