Serial Console Server on Raspberry Pi

Short one: How to make a serial console server (or terminal server) with a Raspberry Pi and USB-serial adapter.

  1. Have a Raspberry Pi with Raspbian installed (I’m having the original Raspberry Pi Model B Rev 2, use “cat /sys/firmware/devicetree/base/model;echo” command to identify your Raspberry Pi)
  2. Connect the USB-serial adapter to a USB port on Pi
  3. Install ser2net (sudo apt install ser2net)
  4. Configure /etc/ser2net.conf with for example:
    • 2000:telnet:1800:/dev/ttyUSB0:9600 8DATABITS NONE 1STOPBIT banner
    • 3000:telnet:1800:/dev/ttyUSB0:19200 8DATABITS NONE 1STOPBIT banner
    • 4000:telnet:1800:/dev/ttyUSB0:115200 8DATABITS NONE 1STOPBIT banner
  5. Ensure that ser2net is started automatically (sudo systemctl enable ser2net)

Connect the serial port to whatever device you want to use for testing, and use any telnet-compatible client (like PuTTY) to connect to your Pi’s IP address and the configured port (2000, 3000 or 4000 in this example).

See the man page of ser2net for information about the configuration options.

The telnet connection is unsecure but you can use SSH tunneling to encrypt the communication between your client host and the Raspberry Pi.

1 Comment

Add a Comment
  1. Great post Markku!

    I did something similar, a custom solution for remote console with a Raspi

    https://www.ifconfig.it/hugo/2017/09/airpiconsole-part-two/

    Enjoy!

Leave a Reply to BGPGPCancel reply