Table of Contents
Zero Rocrail Server
Introduction
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/ wget https://wiki.rocrail.net/rocrail-snapshot/Rocrail-ARMHF.zip unzip Rocrail-ARMHF.zip
Create a Workspace and Startup script
cd mkdir RocrailZero nano startrocrail.sh
Content of startrocrail.sh:
#!/bin/sh cd /home/pi/RocrailZero /home/pi/Rocrail/bin/rocrail -l /home/pi/Rocrail/bin if [ $? -eq 70 ] then sudo halt -p fi
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 startrocrail.sh executable
chmod +x startrocrail.sh
Add a line in CronTab
crontab -e @reboot /home/pi/startrocrail.sh
Update the Server
cd ~/Rocrail/ wget https://wiki.rocrail.net/rocrail-snapshot/Rocrail-ARMHF.zip unzip Rocrail-ARMHF.zip
GO
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.
WIOpi
Parallel a WIOpi can be active on the same Zero.
It will automatically connect to the Rocrail Server.