[PLUG] Serial dot-matrix printer replacement

Russell Senior russell at personaltelco.net
Sat Apr 24 19:33:12 UTC 2021


On Sat, Apr 24, 2021 at 10:53 AM Michael Barnes <barnmichael at gmail.com> wrote:
>
> I have an old piece of equipment that handles monitoring and remote control
> for a site. It has an old serial dot matrix printer that would print out
> alarms situations and status readings. We want to keep the basic unit, but
> the printer has died. I'd like to replace the printer with something like a
> Raspberry Pi that would watch the serial printer line and store the data to
> a file, probably on a daily basis. I'm not great at programming, so I would
> like to find an app that could easily handle this duty.
> Suggestions appreciated.

Why only on a daily basis when you could easily capture to a file continuously?

For most of my serial interaction these days I use GNU screen. So, for
example, you can plug a usb-serial cable into the Pi and your devices
serial console port, and run screen like:

  screen /dev/ttyUSB0 115200 (or whatever baud rate is needed)

>From the screen session, you can type Ctrl-a H, and everything will be
captured to screenlog.0. The nice thing about this, is you can ssh in
at any time to the Pi and reattach to the screen session with:

  screen -draA

and you'll be at your device's serial console where you can interact as needed.

You'd probably want to script all this so that it starts automatically
on Pi reboots. And you probably want to periodically rotate the
screenlog.0 file, and the mechanics of that would need some more
investigating.

-- 
Russell Senior
russell at personaltelco.net



More information about the PLUG mailing list