User Tools

Site Tools


Zero Rocrail Server


The Rasberry Zero has two USB connectors:

Code Usage
PWR 5V power supply
USB Normal USB port

The USB connector can be used to connect a CommandStation with Serial port.
This will be available in Rocrail as device /dev/ttyUSB0.

Setup Zero

Provide the Zero with a PiOS Lite SD-Card and activate ssh and WiFi.
How to setup a Raspberry Pi is found on many places in Internet, so it won't be part of this Wiki.
Some hints and tips can be found here: Headless CAM

Setup Rocrail

Open an ssh session with the zero.

Install the Server

sudo apt install zip
mkdir Rocrail
cd Rocrail/

Create a Workspace and Startup script

mkdir RocrailZero

Content of

cd /home/pi/RocrailZero
/home/pi/Rocrail/bin/rocrail -l /home/pi/Rocrail/bin 
if [ $? -eq 70 ]
  sudo halt -p

The last 4 lines will shut down the Zero properly in case of a normal end, but is of course optional.
A normal Server end is signalled by the return value of 70.
Booting the Zero 2 W is very fast, so the Rocrail server is available after 10…20 seconds.

Make executable

chmod +x

Add a line in CronTab

crontab -e
@reboot /home/pi/

Update the Server

cd ~/Rocrail/


After a reboot the Rocrail server will be started automatically, and every Rocrail Client can connect to it by the Network name as assigned at the Zero setup.
Note: The default network name is Raspberry. (Rename it)

Command Stations

Every Command Station featuring a serial USB, LAN or WLAN connection can be connected.


Parallel a WIOpi can be active on the same Zero.
It will automatically connect to the Rocrail Server.

wiopi/zero-server-en.txt · Last modified: 2021/11/29 08:16 by rjversluis