cu: unknown host
I’ll be honestly amazed if anyone reads this post – the number of people wanting to access a serial port from a FreeBSD system must be incredibly small. However, there’s only a few references to this problem out there so I thought it worth writing about.
When running cu to connect to a serial port I was receiving the error “cu: unknown host”, followed by the hostname of my machine. cu consults /etc/remote for port names, and an entry for my machine’s hostname wasn’t present (and I hadn’t passed an alternative hostname to cu ). The easy way to fix this was to set the host to an existing friendly name for the port, which in my case is uart0. The command to connect to the serial port then becomes;
cu -l cuau0 uart0
And presto! A connection to the serial port is established, no need to edit /etc/remote either. The default settings use a baud rate of 9600, which can be overridden using the -s parameter.
I agree on the number of people :) but thanks for the post! it worked for me!
You might be surprised–serial ports continue to be handy. The required juju is different on OpenBSD and FreeBSD. Thanks, this saved me an hour of debugging!