# Default baud rate



## balanga (Aug 3, 2018)

Presumably there is a default baud rate for every com port defined on a system. How can you tell what it is and how do you change it?

I know that `cu -l /devcuaU0 -s 115200` sets the speed to 115200, but once `cu` stops, doesn't it go back to the default?


----------



## ShelLuser (Aug 3, 2018)

There is no default.

Speed isn't a specific hardware setting but mostly the software which sets everything up. Back in the days I had an external 2400 baud modem and eventually replaced it with a cool 14.k4 modem. All I did was replace the modem, I used the exact same serial cables. That would be impossible if there was a hardware defined speed or limitation.

Today it's mostly the OS which defines a standard for the serial ports but that doesn't make it 'the' standard. There really is none. I am aware that many pick 9600 baud as a solid middle ground.

In the end it depends on what settings you use.


----------



## balanga (Aug 3, 2018)

Just found this interesting tidbit....


```
# stty -f /dev/ttyu5.lock 57600
```

How do I see what it is currently set to? I presumed that that the ttyu5.init file would have some initialisation settings but have no idea how to read the files in the /dev directory.


----------



## trev (Aug 4, 2018)

balanga said:


> Just found this interesting tidbit....
> 
> 
> ```
> ...



The link to your interesting tidbit in the Handbook tells you that too


----------



## balanga (Aug 4, 2018)

trev said:


> The link to your interesting tidbit in the Handbook tells you that too


After further reading, I'm not sure that what it says is correct...

`stty -a -f /dev/cuaU0` show the current settings for /dev/cuaU0. ie:-

```
speed 9600 baud; 0 rows; 0 columns;
lflags: icanon isig iexten echo echoe -echok echoke -echonl echoctl
    -echoprt -altwerase -noflsh -tostop -flusho -pendin -nokerninfo
    -extproc
iflags: -istrip icrnl -inlcr -igncr ixon -ixoff ixany imaxbel -ignbrk
    brkint -inpck -ignpar -parmrk
oflags: opost onlcr -ocrnl tab0 -onocr -onlret
cflags: cread cs8 -parenb -parodd hupcl clocal -cstopb -crtscts -dsrflow
    -dtrflow -mdmbuf
cchars: discard = ^O; dsusp = ^Y; eof = ^D; eol = <undef>;
    eol2 = <undef>; erase = ^?; erase2 = ^H; intr = ^C; kill = ^U;
    lnext = ^V; min = 1; quit = ^\; reprint = ^R; start = ^Q;
    status = ^T; stop = ^S; susp = ^Z; time = 0; werase = ^W;
```
However, running `stty -f /dev/cuaU0.lock 57600` does not seem to change the speed since running the  previous command shows the speed remains the same as it was.


----------



## balanga (Aug 10, 2018)

balanga said:


> Presumably there is a default baud rate for every com port defined on a system.



See https://forums.freebsd.org/threads/dev-cuau0-init.67104/


----------

