Solved how to conigure my usb serial port ?

Dear all :
i have a USB serial port console and want to use it connecting switch . but how to configure my serial port console arguments ?
i want to configure it as below requirements. thanks. i have used cu command , but i don't know where is to configure it. command : cu -s 9600 -l /dev/cuaU0 .........thanks.
can you show cu command to configure below arguments ? thanks.

Default attribute settings of a console port.
Baud rate​
9600 bit/s​
Flow Control​
No flow control​
Parity​
No parity check​
Stop bits​
1​
Data bits​
8​
 
i trust someone will use freebsd notepad with serial port to connecting switch console port . any one know that ?thanks.
 
Do you mean using a serial connection from one computer to a COM port on another computer e.g. to access BIOS?

What happens when you try the command you typed?
 
Do you mean using a serial connection from one computer to a COM port on another computer e.g. to access BIOS?

What happens when you try the command you typed?
thanks first , i have computer with com port , i used a com console cable to connect this computer and cisco switch .... and then use cu command to configure the cisco switch. thanks. do you know how to configure cu tools as below requirements ?
Default attribute settings of a console port.
Baud rate9600 bit/s
Flow ControlNo flow control
ParityNo parity check
Stop bits1
Data bits8
 
No, sorry, I don't.

But man cu shows that your sample command should set the speed correctly, so what happens if you try it?

The cu man page also says you can use -e/-o for even/odd parity but doesn't mention what you need to do for no parity.

There are also things like kermit in ports - might give you more control if you need it.

EDIT: or something like putty
 
If "/dev/cuaU0" does not show up, you may need to sudo kldload uslcom (and to load it at startup, do sudo sysrc kld_list+=uslcom. If the device still does not exist, show the output of sudo usbconfig list as far as the serial device is concerned.

If the device exists but you can't connect to it, add yourself to the "dialer" group using "vipw". If both conditions are satisfied and you still can't connect, tell us the *exact* error message you see.

Note that you can also use kermit or minicom or picocom from ports instead of cu!
 
Usually you only need to set the baudrate, which is mostly 115200 for switches that were build within the last ~15 years. The other settings are defaults, so nothing to change/set here.
I use sysutils/screen to connect to serial consoles, but cu should work as well.

But the device you are using is wrong. call-out ports are usually used for modems, not for serial consoles. You want to connect to the tty that is created by the USB serial adapter, which is ttyU0 (or higher number if you already have another usb tty present).

There's also one small pitfall that might prevent you from seeing the serial console:
Do you use a USB(C) -> RJ45 cable or a universal USB->DB9 serial adapter with the 'classic' DB9->RJ45 rollover cable? The latter variant usually fails for me with USB3.x ports and the console stays completely blank. Sometimes I get a console output, but it doesn't recognize any input.
Switching to an USB2.0 port always solves this, but they have become scarce or especially on laptops aren't even available anymore, so you might have to get yourself a USB(-C) type rollover cable.
 
But the device you are using is wrong. call-out ports are usually used for modems, not for serial consoles. You want to connect to the tty that is created by the USB serial adapter, which is ttyU0 (or higher number if you already have another usb tty present).
In my experience, both (cuaU0 and ttyU0 for example) work equally well for usb serial ports, given that permission on the device are correct.
 
If "/dev/cuaU0" does not show up, you may need to sudo kldload uslcom (and to load it at startup, do sudo sysrc kld_list+=uslcom. If the device still does not exist, show the output of sudo usbconfig list as far as the serial device is concerned.
This is the first thing we need to figure out. There's also uftdi(4). I have a couple of those USB to DB9 serial cables. Some work on FreeBSD, some don't. They're certainly not standardized and can use a bunch of different chipsets for the USB to serial conversion.

If the USB serial cable isn't recognized then no amount of fiddling with cu(1) is going to make it work.

Open a terminal and run tail -F /var/log/messages, then plug the USB serial cable in. Watch the messages closely, it will tell you what it is and if it's recognized. Post those messages here.
 
This whole thread is horribly unclear to me. But if this is indeed about using some USB/serial converter for accessing some serial console, there's no need to configure anything indeed. Just run cu(1) with the correct speed given for -s.

which is mostly 115200 for switches that were build within the last ~15 years.
My switch (bought in 2015) came with 38400 ... and it also doesn't even have a physical RS/232 port, instead the USB converter is integrated and you just hook it up with a plain USB cable 😉
 
My switch (bought in 2015) came with 38400 ... and it also doesn't even have a physical RS/232 port, instead the USB converter is integrated and you just hook it up with a plain USB cable 😉
The cisco gear (IOS & NX-OS) I usually deal with mostly has 115200baud set; IIRC they went straight from 9600 to the maximum as default setting. But yes - some vendors use very weird (and even non-standard!) baudrates as default, but thankfully many switches nowadays come with built in usb/serial adapters, so there are usually less pitfalls when dealing with serial consoles.
Having said that, I also have seen switches that use very 'exotic' usb/serial converter chipsets - i.e. the practically non-funcional type, except if used with that *one* version of a windows driver that will only work up to windows 8.1... So I'm always cautious if a switch from a "budget vendor" only offers a USB port for console access.
 
If "/dev/cuaU0" does not show up, you may need to sudo kldload uslcom (and to load it at startup, do sudo sysrc kld_list+=uslcom. If the device still does not exist, show the output of sudo usbconfig list as far as the serial device is concerned.

If the device exists but you can't connect to it, add yourself to the "dialer" group using "vipw". If both conditions are satisfied and you still can't connect, tell us the *exact* error message you see.

Note that you can also use kermit or minicom or picocom from ports instead of cu!
thanks. i can use "cu -l /dev/cuaU0" command to login switch device . just want to configure cu parameter with below information. thanks.
Baud rate 9600 bit/s
Flow Control No flow control
Parity No parity check
Stop bits 1
Data bits 8
 
Usually you only need to set the baudrate, which is mostly 115200 for switches that were build within the last ~15 years. The other settings are defaults, so nothing to change/set here.
I use sysutils/screen to connect to serial consoles, but cu should work as well.

But the device you are using is wrong. call-out ports are usually used for modems, not for serial consoles. You want to connect to the tty that is created by the USB serial adapter, which is ttyU0 (or higher number if you already have another usb tty present).

There's also one small pitfall that might prevent you from seeing the serial console:
Do you use a USB(C) -> RJ45 cable or a universal USB->DB9 serial adapter with the 'classic' DB9->RJ45 rollover cable? The latter variant usually fails for me with USB3.x ports and the console stays completely blank. Sometimes I get a console output, but it doesn't recognize any input.
Switching to an USB2.0 port always solves this, but they have become scarce or especially on laptops aren't even available anymore, so you might have to get yourself a USB(-C) type rollover cable.
dear , sko :
below is the device info . the ttyU0 is get inside port . cuaU0 is get outside port (manual books). some one want to remote access use your machine with ttyU0 com port . if you want to login outside device with your cuaU0 com port .
$ ll /dev/ttyU0
crw------- 1 root wheel - 0x1a7 Mar 28 08:26 /dev/ttyU0
$ ll /dev/cuaU0
crw-rw---- 1 uucp dialer - 0x1aa Mar 28 08:26 /dev/cuaU0

my notepad has a serial com port . now i can use "cu -l /dev/cuaU0" command to login switch device . just one question how to configure cu parameter with below information. thanks.
Baud rate 9600 bit/s
Flow Control No flow control
Parity No parity check
Stop bits 1
Data bits 8
 
Does it work if you try the command you originally suggested? It might just work. If not, and you need to control all those parameters, there might be better tools.

You aren't answering the questions so it's difficult to help.
 
If "/dev/cuaU0" does not show up, you may need to sudo kldload uslcom (and to load it at startup, do sudo sysrc kld_list+=uslcom. If the device still does not exist, show the output of sudo usbconfig list as far as the serial device is concerned.

If the device exists but you can't connect to it, add yourself to the "dialer" group using "vipw". If both conditions are satisfied and you still can't connect, tell us the *exact* error message you see.

Note that you can also use kermit or minicom or picocom from ports instead of cu!
thanks bakul:

i can use "cu -l /dev/cuaU0" command to login switch device . just one question how to configure cu parameter with below information. thanks.
Baud rate 9600 bit/s
Flow Control No flow control
Parity No parity check
Stop bits 1
Data bits 8
 
thanks bakul:

i can use "cu -l /dev/cuaU0" command to login switch device . just one question how to configure cu parameter with below information. thanks.
Baud rate 9600 bit/s
Flow Control No flow control
Parity No parity check
Stop bits 1
Data bits 8
Not sure why you worry about this if you can login fine. I think the defaults should just work for you. Set baud rate with -s 9600. But if you want, from within cu you can set variables with ~s and view them with ~v. "man cu" for what variables can be set. Alternately use kermit (pkg install it) as it will give you a lot of options + you specify them in a ~/.kermrc
file as follows:
set line /dev/cuaU0
set sp 115200
set carrier-watch off
 
Back
Top