Bafo bf-810
From FBSD_tips
DRAFT INCOMPLETE DRAFT INCOMPLETE
Contents |
[edit] Rationale
Although serial interface technology has been relegated to a niche technology for many years now, it is still an important niche. it is cheap and versatile, ideally suited to command line interfaces and remote command and control as well as automation and circumstances that might be hostile to other higher bandwith signaling. Here I will investigate a common USB-serial (rs232) device and some of it's possible applications.
[edit] Setup
Here is what the unit looks like :
This unit can be commonly found on the net in the range of $20 - $25.
[edit] loader.conf
Add this to /boot/loader.conf to include support for USB serial devices.
ucom_load="YES" uplcom_load="YES"
[edit] device files
When you plug the device in you should see some new device files appear.
crw-rw---- 1 uucp dialer 0, 200 Apr 15 15:40 /dev/cuaU0 crw-rw---- 1 uucp dialer 0, 201 Apr 15 15:40 /dev/cuaU0.init crw-rw---- 1 uucp dialer 0, 202 Apr 15 15:40 /dev/cuaU0.lock
The .init file will set the line disapline of the serial device upon open, the .local file will do the same and additionally disallow subsequent changes. Stty can be used to get and set the parameters.
> stty -a -f /dev/cuaU0
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 -oxtabs -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;
> stty -g -f /dev/cuaU0 gfmt1:cflag=4b00:iflag=2b02:lflag=580:oflag=3:discard=f:dsusp=19:eof=4: eol=ff:eol2=ff:erase=7f:erase2=8:intr=3:kill=15:lnext=16:min=1:quit=1c: reprint=12:start=11:status=14:stop=13:susp=1a:time=0:werase=17:ispeed=9600:ospeed=9600
The -a option will retrieve all parameters and preint in a human readable fashion while the -g option with print in a format ready to be read back in to stty to set them. This could be used to store the settings in a file for later reconfiguration.
[edit] tip / cu
Tip is the nominal util to access an outgoing serial line and it's configuration file is /etc/remote. A very plain entry adding the device to it should be sufficient for most purposes.
cuaU0|ucom1:dv=/dev/cuaU0:br#9600:pa=none:
This gives it 2 names to connect to it with : cuaU0 or ucom1, sets the device node (dv=), baud rate (br#) and parity (pa=).
[edit] Use
To connecting to a Cisco 2930 switch, connect to the serial DB-9 fro the cisco and run tip.
> tip ucom1 connected Switch>~ [EOT]
The escape sequence from tip is tilde-period (~.).
[edit] Discussion
I have had 2 of these units running on a machine, I am not aware of what the upper limit may be. Depending on what that upper limit is, you could build a serial console server for your computer room or colo facility to ssh in to. Having looked at the cost of dedicated console server equipment it is obvious that this method could represent a significant cost savings. It could also be made to be quite durable if one used solid state and / or optical boot media.
This unit is also quite a useful to your laptop bag for when you are working on machines with serial consoles in the field.


