USR-IOT Serial-to-Ethernet Converters with Linux

I’m posting this mainly because Google didn’t turn up any help when I queried about using the USR-IOT serial port to ethernet converters (also known as terminal servers) with Linux. They make several low-cost devices that are really handy if you need to talk to serial devices that are far from the host computer. In particular, the USR-TCP232-410S single port converter and USR-N540 four port device are quite inexpensive. Their website has nary a mention of Linux compatibility, and I didn’t find any Google hits indicating that they work with anything other than Windows and maybe Mac.

It turns out that they work just fine under Linux, using standard protocols. You can even change speed as if the port were physically connected to the computer. Leaving the server set at its default settings, all you need to do on the Linux end is install the socat “multipurpose relay” tool (it’s available as a package in Debian-based distributions) and write a simple shell script.

Here’s what I’m using:

# open virtual serial port
socat pty,link=$HOME/vmodem0,waitslave tcp: &
# run the program
# kill socat afterwards
killall socat

Customize the socat command line with the name of the port device (here $HOME/vmodem0, but you can name it and place it wherever you want), and the IP address and port of the serial server.

This worked on the first try, suspiciously easily.

It appears that socat destroys the vmodem0 device when the called program finishes running, but does not kill its process. That’s why I stuck the killall command on the last line. There is probably a way to make the device persistent so you would only need to run the socat command once at bootup, but I haven’t dug around for it yet.

2 thoughts on “USR-IOT Serial-to-Ethernet Converters with Linux

  1. Hi there

    Very interesting reading. I’ve searched for this information for quite some time
    How do you configure the USR-TCP232 unit when it comes to TCP/UDP/Servermode etc?

    1. Hi Steen —

      I don’t have the system in front of me right now, but I think I was able to use pretty much the default settings on the USR-TCP232.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.


PowerPole Color Conventions

A lot of us use Anderson PowerPole connectors for DC power distribution. There's a nearly universal standard to use red…

GPS Frequency Stability

I couldn't find a nice graph showing the timing performance of a single-frequency, sawtooth-corrected, pulse-per-second output from a GPS. So…

Mini-Circuits Power Amp

Each year at the Dayton Hamvention, the folks at Mini-Circuits have a bunch of odds and ends they sell very…

Oscillator Aging Trends

It's well known that just about all oscillators drift, or "age", in frequency with time. In crystal oscillators, the most…