# Unable to type command in serial console



## mko_io (Jan 15, 2019)

Hi community,

I'm trying to connect serial console to pine64 running Freebsd12-Release, I type `cu -l /dev/cu.usbserial-001IKOQ -s 115200` and every works fine I can see the boot procedure, and when I type in login info information, each character I type the console throw me an error:`aJan  1 00:06:04 generic getty[828]: tcsetattr /dev/ttyu0: Invalid argument`





And here's the my related config file

/boot/loader.conf

```
# Configure USB OTG; see usb_template(4).
hw.usb.template=3
umodem_load="YES"
# Multiple console (serial+efi gop) enabled.
boot_multicons="YES"
boot_serial="YES"
# DTB OVERLAYS
fdt_overlays="sun50i-a64-sid,sun50i-a64-ths,sun50i-a64-timer"
# Disable the beastie menu and color
beastie_disable="YES"
loader_color="NO"
```

/etc/ttys

```
console none                            unknown off secure
#
ttyv0   "/usr/libexec/getty Pc"         xterm   onifexists secure
# Virtual terminals
ttyv1   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv2   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv3   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv4   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv5   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv6   "/usr/libexec/getty Pc"         xterm   onifexists secure
ttyv7   "/usr/libexec/getty Pc"         xterm   onifexists secure
#ttyv8  "/usr/local/bin/xdm -nodaemon"  xterm   onifexists secure
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
ttyu0   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure
ttyu1   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure
ttyu2   "/usr/libexec/getty 3wire"      vt100   onifconsole  secure
```

I try to change the console line from off to on, but the after reboot it stuck at CMD]  type "?"

Any ideas?

Lin


----------



## Phishfry (Jan 15, 2019)

I think you are using the wrong device node.
Can you post the result of this command:
`ls /dev/cu*`


----------



## T-Daemon (Jan 15, 2019)

Have you configured /etc/devd.conf ?

25.2.1. Configuring USB Device Mode Serial Ports


----------



## mko_io (Jan 16, 2019)

Phishfry said:


> I think you are using the wrong device node.
> Can you post the result of this command:
> `ls /dev/cu*`


Here it is

```
$ ls /dev/cu*
/dev/cu.Bluetooth-Incoming-Port    /dev/cu.usbserial-001IKOQ
```
BTW the host machine is Mac (High Sierra)


----------



## mko_io (Jan 16, 2019)

T-Daemon said:


> Have you configured /etc/devd.conf ?
> 
> 25.2.1. Configuring USB Device Mode Serial Ports


I'm using the FT232R Usb UART to connect pine64, I think it's the real serial port not the virtual one, do I still need to configure the /etc/devd.conf


----------



## T-Daemon (Jan 17, 2019)

mko_io said:


> I'm using the FT232R Usb UART to connect pine64...


Important hint. You need to load the uftdi(4) driver for the FT232R chip.


mko_io said:


> I think it's the real serial port not the virtual one


Right.


mko_io said:


> ... do I still need to configure the /etc/devd.conf


No.


----------



## justinnoor (Jan 17, 2019)

I’m not familiar with Mac OS, and this may not be the root problem, but you did not add the usb_template module to loader.conf.

Should be:`usb_template_load=“YES”`.

Also, since you are not establishing a conventional serial port connection, i.e. DB-9 to DB-9 null modem, wouldn’t this be a “virtual” serial port connection?


----------



## Phishfry (Jan 18, 2019)

Both of the above tips are for the HOST machine (Mac) to worry about. Both the driver and settings.
Your Pine64 should not need any special settings to receive serial communications. It is all set in /etc/ttys


mko_io said:


> I try to change the console line from off to on, but the after reboot it stuck at CMD] type "?"


There should be no need to change anything in this file.

Have you tested your USB to Serial adapter on another computer just to get your console process worked out?


----------

