User Tools

Site Tools


RocNetNode Setup



Rocrail Setup

Setup a Command Station with RocNet over UDP using the default settings:

RocNet ID 1
Sub-Library UDP
Port 4321

Local IP

Only required if the PC has more than one network interfaces installed; In all other cases: Leave empty!
IP address of the PC's network interface which is used for communication with the RocNetNodes to make sure the traffic runs on the right one.



Not relevant for RocNetNode, leave it unselected.


Accessory and Mobile commands are watched if they are acknowledged by RocNetNodes.
After a timeout the command is send again.

Acknowledge sensor events

Send an acknowledge to a RocNetNode on receiving a sensor event.
The RocNetNode will resend the event in case a timeout on the acknowledge occurs.
See: Acknowledge sensor events

Shutdown all

Send a shutdown request to all RocNetNodes at Rocrail server shutdown.

Watch nodes

Rocrail and Rocnetnode must be at revision 8241+.
This option will ping all registered nodes if the track power is on.
If a node does not respond within two seconds the power will be shut off and all locos become a stop command.



Default loco bus in case this is left to zero on the Loco Interface Tab.
Only of use if one of the RocNetNodes is setup as Command Station.


The MQTT Sub Library will connect to a Broker, Mosquitto, and will subscribe to all Groups.
ESP8266 based rocnet node implemnetions are listed here rocnet-mqtt-client-en.
This library uses QoS 1. Clients may publish with QoS 0.

The standard MQTT port is 1883.


The Keep Alive time in seconds.

Last Will

If the Rocrail MQTT-Broker connection get lost, the Last Will can be observed in topic rocnet/ht:

<exception text="abend"/>

Raspberry Pi Setup

SD-Card and Raspbian Image

A 8GB SD-Card is sufficient for the operating system Raspbian and the RocNetNode.
The Raspbian image can be downloaded from the Raspberry Pi Download site.
Also a HowTo is available: SD-Card Setup
In the Raspbian-Options "GPIO" and "I2C" must be activated.

RocNetNode Package

How to get and install the RocNetNode software is explained on this page: Installer package


The boards

gca_pi02_pict03.jpg The GCA-Pi01 is connected on Rasberry Pi P1 header.
The GCA-Pi02 can be connected with CAT5(Ethernet) or Xpressnet(RJ12) cable to the Pi01 board.
Look at this section for an overview of all available boards.

RFID Setup

One RFID-12/20 can be directly connected to the GCA-Pi01.
The concentrator for max. 8 RFID readers has not jet been tested…


Some USB-RS232 converters will drain too much power at plug-in when the Raspberry Pi runs. This will lead to a spontaneous reset.
It is advisable to plug-in the USB stick before the Raspberry Pi is powered on or to use a USB hub. If a powered USB hub is used, the Raspberry Pi can be powered from the hub thus saving the expense of a power supply.


Ready to use and mountable case:

Multiple Installations

The RocNet ID is no problem with multiple Raspberry Pi's in a network, but they will by default have all the same hostname: "raspberrypi".
If the hostnames are left to its default you cannot use it anymore for making a connection for a secure shell or secure copy. In that case the assigned IP address must be used as hostname.

Change the hostname

The easiest way to change the hostname is to use the configuration utility:

sudo raspi-config

It can also be done by editing two files:

  • /etc/hostname
  • /etc/hosts

A reboot is necessary to activate the new hostname.


RocNetNodes must be connected to the the Local Area Network.
Just simple switches will do:

IPv4 Address

drh1.img.digitalriver.com_drhm_storefront_company_ciscoeu_images_product_detail_wrt54gl-1_175x125.jpg Every device in the LAN needs an IP-Address, and there are two ways to set this up:

  1. Configure every device with a static IP-Address.
  2. Add a DHCP capable switch in the LAN. This service will supply automatically IP-Adresses to all the devices in the LAN.

The Raspberry Pi its default configuration is setup for DHCP. If the LAN is also connected to Internet there is for sure already a DHCP service active. (FritzBox)
A separate DHCP service is needed in case the RocNet LAN should be stand alone.

Only IPv4 is supported.


Its also possible to add an USB WiFi(WLAN) Stick to get rid of the Ethernet wiring, but it is not recommended for serious setups.
Some routers are not so concerned about dropping UDP packets…

Windows Network Devices

Disable all Network Devices except the one in which RocNet should be active.

Windows Firewall

To turn off firewall on XP SP3

Independent of the fact that the firewall is shut off, the firewall settings must be modified to accept all packet types to be able to receive multicast UDP.

  1. click Start
  2. click Run
  3. type cmd
  4. type Firewall.cpl
  5. click "Off"
  6. select Exceptions, uncheck all
  7. select Advanced, uncheck all.
  8. click OK.

Add exception rules

If you do not want to disable the Windows Firewall you must add two new rules:

  • An outbound rule to allow UDP port 4321.
  • An inbound rule to allow UDP port 4321.

See for more information:

Operation without LAN

After the initial installation and future upgrades RocNetNode can also be operated independently without LAN connection (standalone).

For communication between the RocNet-CS and the RocNetNode both use the broadcast IP address
This communication is not done internally, as with the localhost IP address but via the LAN interface.
Without switch / router, a "loop connector" can provide the otherwise missing link "LAN output → LAN input".
For this a RJ45 plug need to connect its pin 1 with pin 3 and pin 2 with pin 6. See picture right.
This plug is inserted for the duration of the stand-alone operation into the LAN jack of the RocNetNode.

On the Raspberry a static IP address must be configured:

sudo nano /etc/network/interfaces

iface eth0 inet dhcp

e.g. change to:

iface eth0 inet static

This section has evolved from a german forum topic.

Check the Raspberry Pi


The hardware revision can be checked with the following command:

cat /proc/cpuinfo


processor	: 0
model name	: ARMv7 Processor rev 4 (v7l)
BogoMIPS	: 38.40
Features	: half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xd03
CPU revision	: 4
Hardware	: BCM2835
Revision	: a02082
Serial		: 00000000fc9eaf9b


cat /etc/os-release

Example of Raspbian Stretch, 9:

PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)"
NAME="Raspbian GNU/Linux"
VERSION="9 (stretch)"

Module example

Plan-F Module 2

  • Command Station: RocNetNode + DCC232 + ORD3/4
  • The Ethernet Switch is powered by a GCA08 9V.
rocnet/rocnetnode-hwsetup-en.txt · Last modified: 2022/11/20 17:19 by rjversluis