Requirement
Hardware or software required:
- Raspberry Pi
- SD Card (for RPi)
- Raspberry Pi Imager
- USB to Serial converter
Preparing RPi
Installing OS
We can use this article to prepare the OS for RPi
Install ser2net
Run the following command. We can connect USB to serial at this point of time
# Update existing installed package
sudo apt update && sudo apt upgrade -y
# Install ser2net package
sudo apt install ser2net -y
# Get serial converter address
dmesg -T | grep tty
We should have return from the above code as sample below
[ 0.000000] Kernel command line: …
[ 0.001127] printk: …
[ 1.410816] fe201000.serial: …
[ 5.671105] usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
Configure ser2net
Next, we’ll edit configuration file for ser2net. This configuration has been updated from .cfg to .yaml format
# Edit ser2net configuration file
sudo nano /etc/ser2net.yaml
# Add the following yaml
%YAML 1.1
---
define: &banner01 Connected to port \N(\d)\r\n
default:
name: local
value: true
class: serialdev
default:
name: mdns
value: true
default:
name: mdns-sysattrs
value: true
### Accepter specifications:
# connection: &<alias>
# accepter: <tcp/udp>,<port>
# connector: <serialdev/telnet/ipmisol>
## Optional fields
# timeout: <seconds, default 0: no timeout>
connection: &con01
accepter: tcp,10001
timeout: 600
connector: serialdev,/dev/ttyUSB0,9600n81
options:
banner: *banner01
kickolduser: true
For more information,
- ser2net(8): Serial to network proxy – Linux man page (die.net)
- Ubuntu Manpage: /etc/ser2net/ser2net.yaml – Serial to network proxy configuration file
- Configuring Your Raspberry Pi As A Console Server – Packet6
Auto Start
Run the following command
sudo systemctl enable ser2net
# Add sleep before starting service
sudo sed -i '/^\[Service\].*/a ExecStartPre=/bin/sleep 30' /etc/systemd/system/multi-user.target.wants/ser2net.service
# Run the following after saving
sudo systemctl daemon-reload
sudo systemctl start ser2net
Preparing Windows Client
Install TruePort
TruePort can be found at TruePort Downloads – Serial to Ethernet Drivers and Manuals-Perle
Configure TruePort
After installation, change the name to your liking and point IP address to ser2net server above
Change TCP port number at the Perle configuration, and change connection mode to Lite Mode.
Change the port number to configured port number (e.g. 3000)
For more information,
Troubleshooting
Service not running
- Open
services.mscwith elevated right - Find
Perle TruePort Serviceand run