Contents

Goal

This setup shows how to use the LEAF tarball distribution for the raspberry PI, to access the serial communication port of a distant PC Engines APU2C2 using a simple SSH session. To access the serial port, we SSH to the Raspberry PI and run a communication program like minicom or picocom. There is of course a USB to RS-232C cable, that connects the raspberry PI to the serial port of the device.

This setup can be generalized to make any "device serial communication port" accessible through an SSH network session. Knowing that RS-232C communication distances are short, why not use a wired network instead that can reach a lot farther.

All of this was initially done with the standard Raspberry PI Raspbian distribution, but using the LEAF distribution OS on the Raspberry PI instead, really transforms it into a very stable and dependable production platform, since everything will then run in rams. No writing to the SD card will occur once in operation... It is a well known fact that, it is only a matter of time for the Raspberry PI to corrupt it's SD card, thus making it fail to boot or run. This is mainly caused by random power fails occurring at the same time the PI is writing to the SD card (further readings: https://hackaday.com/2016/08/03/single-board-revolution-preventing-flash-memory-corruption/).

You will need

- one raspberry pi 1 and power supply, (or PI2 or PI3 but it will be overkill...)

Using the gateway

- now connect the RS-232C to USB cable with the null modem between your PI and your device serial port

- open an ssh session to the PI

- start picocom: picocom -b115200 /dev/ttyUSB0

- hit return:... you should have the prompt to login in your router or whatever !

- exit picocom with Cntl-a Cntl-x, help is Cntl-a Cntl-h

Final thoughts

It would be a good idea to configure eth0 with a static IP address in /etc/network/interface. This would allow a network communication between your workstation and the PI Serial gateway even if your firewall and consequently DHCP server are down.

You can also remove or comment out DB_OPTIONS=" -B " in /etc/default/dropbear, to bring the security level back.

"picocom.lrp" is not part of the tarball yet, use "minicom.lrp" instead... or ask Kapeka !

Using the PI as a full blown firewall has not been tested here, the feeling is that it would be too slow... volunteers are welcome ...