I recently started experimenting with #gensio, which can do some really cool things with #serial ports, TCP ports, etc. It can make a serial line a framed, reliable communications medium. It can act like netcat, socat, and so forth. You can use it to run #ssh or #NNCP over a serial line, or provide an encryption layer itself. I wrote up some ideas here: https://www.complete.org/using-gensio-and-ser2net/
Using gensio and ser2net

gensio and the related ser2net are generic tools for communication. With gensio, you can set up a sort of pipeline of communication, using sockets, files, stdin/stdout, serial lines, external programs, and so forth. It is akin to a more powerful version of socat, netcat, redir, or stunnel. Generally, with gensio and ser2net, you can: Provide services that are started from inetd, init, or systemd Convert an unpacketized link (such as a serial port) into a packetized interface Convert an unreliable packetized link (such as UDP or a gensio-packetized serial interface) into a reliable link Add encryption and authentication to any link A communication pipeline is called a “gensio stack” and is given in a string format, separated by commas.

www.complete.org