serial communication over rs232

I'm messing around with serial and I've gotten the serial console on freebsd working fine and I'm able to talk to my freebsd machine over the serial from a linux terminal (running cu). Yay! What I'd really like though, is to hook up the cables and run kermit by itself on both ends without having the serial console enabled in /boot/loader.conf (console="comconsole"). Is this possible? That is, can I just hook up the cables as I did for the serial console, fire up kermit on freebsd in server mode and on linux in client mode and have it be able to do whatever kermit is capable of doing (send / receive files). I'm probably naive here, but I'm trying to figure out how things worked before cu/ssh/etc. and supposedly, all you need is two machines with oses and each capable of running kermit to do this...

-will
 
This will entirely depend on what this "kermit" tool can do, RS-232 is just a static connection between two ports and using the same settings on both ends, you can transfer whatever you like.

You don't need the serial console for that, to the contrary, a serial port is an exclusive resource and the console would own it. I mean, it's really just wires, no additional protocols, multiplexing, whatever.
 
when i dialed with norton term90.exe in my former highschool box i could transfer files with sz and rz (unix end) and file upload/download zmodem on the DOS end
so you could transfer files over your interactive session
this was before internet was available commercially here
 
Thanks. I read these as ”yep”! I’ll let y’all know how it progresses.

As for BBSing. I did a lot of that back in the day. It requires modems (or a network/internet). The deal with modems in the modern era is that they, in turn, require an active phone line to power the transmission (you can’t just have two machines w/modems and a passive phone wire between).
 
Thanks. I read these as ”yep”! I’ll let y’all know how it progresses.

As for BBSing. I did a lot of that back in the day. It requires modems (or a network/internet). The deal with modems in the modern era is that they, in turn, require an active phone line to power the transmission (you can’t just have two machines w/modems and a passive phone wire between).
Yes you can. The modem needs appropriate configuration to skip the dialing procedure.
In the old days you could rent a continuous wire from the telco, which was simply a two-wire passive connection. That would work within a city or so, already much farther than a serial link. Problem comes over long distances due to signal loss.

If the wire is short enough (<1-2km) you can also put certain DSL modems on it. This was done to connect shops to the Internet long before DSL was publicly available.
 
i had a leased line and us robotics courier modem. looked cool
1727454285241.png
 
What speed?
I just ditched my last digital one, can't remember if it was 14k4 or faster.
Before that (days gone bye) I had an all analog one (no acoustic coupling and separate phone to dial in): two speeds, 110 or 300 baud. It had a steel case about the volume of a shoe box and you could park an elephant on it.
 
33.6k. never had anything lower than 2400 or without hayes AT commands
the 2400 ones without error correction were crappy enough though
 
Progress. I've gotten kermit to talk to the freebsd serial console. However, when I disable the serial console and try to run kermit on the freebsd side, it complains:

Code:
(~/) C-Kermit>set line /dev/ttyu0
Sorry, write access to UUCP lockfile directory denied.

So, I add the user to dialer -
Code:
sudo pw groupmod dialer -m wsenn

and try again after logging out and in again, but then it complains:
Code:
(~/) C-Kermit>set line /dev/ttyu0
/dev/ttyu0: Permission denied
Sorry, access to device denied: /dev/ttyu0

So I do the following to devd:

Code:
sudo mkdir -p /usr/local/etc/devd
sudo vi /usr/local/etc/devd/usbserial.conf
notify 100 {
    match "system"        "DEVFS";
    match "subsystem"    "CDEV";
    match "type"        "CREATE";
    match "cdev"        "ttyU[0-9]+";
    action "chmod g+rw /dev/$cdev";
};

service devd restart

Same error:
Code:
(~/) C-Kermit>set line /dev/ttyu0

/dev/ttyu0: Permission denied

Sorry, access to device denied: /dev/ttyu0

My user is a member of:
Code:
groups=1000(wsenn),0(wheel),5(operator),44(video),68(dialer)

Here's what ls shows:

Code:
$ ls -l /dev/tty*
crw-------  1 root wheel 0x40 Sep 27 14:33 /dev/ttyu0
crw-------  1 root wheel 0x41 Sep 27 14:33 /dev/ttyu0.init
crw-------  1 root wheel 0x42 Sep 27 14:33 /dev/ttyu0.lock

If I run kermit as root, on freebsd, it works dandy, so at this point, I'm only trying to get it so my regular user works.

Help :)
 
OK. That worked. Off to revert changes and see what's actually required. But, how come cuau0 instead of ttyu0?

In the handbook, ch 29, it says:

In FreeBSD, each serial port is accessed through an entry in /dev.There are two different kinds of entries:
  • Call-in ports are named /dev/ttyuN where N is the port number, starting from zero. If a terminal is connected to the first serial port (COM1), use /dev/ttyu0 to refer to the terminal. If the terminal is on the second serial port (COM2), use /dev/ttyu1, and so forth. Generally, the call-in port is used for terminals. Call-in ports require that the serial line assert the "Data Carrier Detect" signal to work correctly.
  • Call-out ports are named /dev/cuauN on FreeBSD versions 8.X and higher and /dev/cuadN on FreeBSD versions 7.X and lower. Call-out ports are usually not used for terminals, but are used for modems. The call-out port can be used if the serial cable or the terminal does not support the "Data Carrier Detect" signal.

So, I was thinking I needed /dev/ttyu0 since I wasn't using a modem (or does my null-modem cable count)...
 
Closing the loop on this...

Given a laptop running linux, a desktop running freebsd, a usb to serial cable and null modem cable to connect between the laptop usb port and the freebsd serial port, you can use kermit (or pretty much anything over the connection). To use kermit:

install kermit on laptop (linux) and desktop (freebsd)
Code:
sudo apt install ckermit
sudo pkg install kermit

add user to dialout (linux)/ dialer(freebsd)
Code:
sudo adduser wsenn dialout
sudo pw groupmod dialer -m wsenn

on freebsd, the device for dialer is /dev/cua*
Code:
ls -l /dev/cua*
crw-rw----  1 uucp dialer 0x43 Sep 27 15:47 /dev/cuau0
crw-rw----  1 uucp dialer 0x44 Sep 27 14:33 /dev/cuau0.init
crw-rw----  1 uucp dialer 0x45 Sep 27 14:33 /dev/cuau0.lock

on linux, the device for dialout is /dev/ttyUSB*
Code:
ls -l /dev/ttyU*
crw-rw---- 1 root dialout 188, 0 Sep 27 16:04 /dev/ttyUSB0

start kermit in local mode on both sides

local mode is when you set line, speed, and carrier-watch

on linux and on freebsd
Code:
$ kermit
> set line /dev/ttyUSB0
> set speed 115200
> set carrier-watch off
> connect

type stuff on both sides, since echo is off, you will only see the results on the other side

^\ is the escape character, so ^\c will escape back to the kermit prompt

To transfer files, both sides should be at the kermit prompt.

On one side, send file, on the other receive file.

set file binary to send binary files.
 
Back
Top