# USB-to-Serial adapter; comconsole



## gentoobob (Mar 30, 2019)

I've been following the handbook and forums post and I'm not getting any serial console output.  Think I'm getting confused. I'm using a USB-to-Serial adapter for this and I have a null modem cable (Micro Connectors, model M02-233).   I am using a Debian laptop on the other end with comms/minicom, serial is set to 9600 8N1 as well.  Below are my configs.  Any help greatly appreciated.

/boot/loader.conf

```
$ cat /boot/loader.conf
autoboot_delay="3"
console="comconsole,vidconsole"
boot_multicons="YES"
boot_serial="YES"
umodem_load="YES"
hw.usb.template=3
```


```
$ dmesg | grep uart

uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
uart0: console (9600,n,8,1)
```


```
$ grep ttyu0 /etc/ttys
ttyU0    "/usr/libexec/getty 3wire"    vt100    onifconsole secure
```

device.hints

```
hint.uart.0.at="isa"
hint.uart.0.port="0x3F8"
hint.uart.0.flags="0x10"
hint.uart.0.irq="4"
```

/etc/devd.conf

```
notify 100 {
    match "system"        "DEVFS";
    match "subsystem"    "CDEV";
    match "type"        "CREATE";
    match "cdev"        "ttyU[0-9]+";
    action "/sbin/init q";
};
```


----------



## balanga (Mar 30, 2019)

gentoobob said:


> I've been following the handbook and forums post and I'm not getting any serial console output.  Think I'm getting confused. I'm using a USB-to-Serial adapter for this and I have a null modem cable (Micro Connectors, model M02-233).   I am using a Debian laptop on the other end with minicom, serial is set to 9600 8N1 as well.



I'm trying to figure out what you are doing... Are you trying to login from FreeBSD into a Debian  system via a serial connection?


----------



## gentoobob (Mar 30, 2019)

balanga said:


> I'm trying to figure out what you are doing... Are you trying to login from FreeBSD into a Debian  system via a serial connection?



Sorry, no.  I am trying to console in on the FreeBSD server from the Debian laptop.  I want to be able to use the serial port as a console on the FreeBSD server.


----------



## gentoobob (Mar 31, 2019)

Solved.  I had to change the line in the /etc/ttys to 


```
ttyU0    "/usr/libexec/getty std.9600"    vt100    on  secure
```


----------



## Phishfry (Mar 31, 2019)

Alternatively you could have included speed in your /boot/loader.conf commands

```
boot_multicons="YES"
boot_serial="YES"
comconsole_speed="115200"
console="comconsole,vidconsole"
```









						Chapter 28. Serial Communications
					

This chapter covers some of the ways serial communications can be used on FreeBSD




					www.freebsd.org
				



No /etc/ttys editing required.
Then set your Linux minicom to use 115200


----------



## gentoobob (Mar 31, 2019)

Thanks for the heads up.  I saw that some place in the forum too.  I will tell you that vidconsole under the console setting doesn't work.  During boot you'll get a message that vidconsole does not exist.  You only have efi, nullconsole, comconsole, and spinconsole.


----------



## Phishfry (Mar 31, 2019)

Yes that is correct. For EFI the handbook needs updating.
*console="comconsole,efi"*


----------



## fwabi9 (Jul 2, 2019)

I actually had to edit /etc/tty to add `ttyU0`. Note the uppercase 'U'. As the original file contains `ttyu0`.


----------



## laundryboy (Aug 21, 2019)

gentoobob said:


> I've been following the handbook and forums post and I'm not getting any serial console output.  Think I'm getting confused. I'm using a USB-to-Serial adapter for this and I have a null modem cable (Micro Connectors, model M02-233).   I am using a Debian laptop on the other end with minicom, serial is set to 9600 8N1 as well.  Below are my configs.  Any help greatly appreciated.
> 
> /boot/loader.conf
> 
> ...



Replying to this set up I have a similar situation... I have a question why should I have the umodem and template enabled on the boot.loader file... I thought that was only when you are trying to use a USB port on the destination machine as the serial port. On my destination FreeBSD machine I am trying to console in via the serial port.


----------



## SirDice (Aug 21, 2019)

laundryboy said:


> I have a question why should I have the umodem


The umodem(4) is a driver the OP needs for his USB->Serial converter to work. Other USB->Serial cables may need uftdi(4). It depends on the chipset that's used. 



laundryboy said:


> On my destination FreeBSD machine I am trying to console in via the serial port.


The traditional, old school, DB9 variant computers used to have? Then you don't need anything, that one should be detected by uart(4).


----------



## laundryboy (Aug 23, 2019)

Thanks to everyone here I finally got the console cable working, to a point. 

I have the same settings as the OP but am not using the umodem setting as I do have the old school DB9 pin serial port on the destination PC. There are two things that are peculiar for me. 

1. When I console in I am only able to do so for root, this is merely a symptom of the main problem. For my user accounts I use ZSH as installed by the ports system, if I either try to login to a user account it just hangs, this also happens when I try to switch to zsh as root so I know its the shell and not anything else. Does anyone have any idea why this happens? I can use bash(also installed as a port) and that works fine. If I set up a user account with a built in shell or bash that also logs in fine. 

2. My second issue is that I can only see the console output when Freebsd fully boots up and I am presented the login prompt. I am unable to see any of the boot up messages nor see the Freebsd Boot screen to choose options such as booting into single user mode. Any suggestions for this?


----------

