System design


The router creates a closed WiFi network. Rocrail and Mosquitto are installed on a Raspi. Rocrail is the model rail road controlling software. It communicates wireless via the “MQTT”(Message Queue Telemetry Transport) protocol with the Eltraco decoders. Mosquitto is the “MQTT – post office”.

Each decoder has its dedicated software package. After the initial installation, updates can be performed “OTA” (Over The Air). After installation of a servo underneath the baseboard of the layout it needs adjustment of two angles, one for the straight position and one for the thrown position. This adjustment is done with the wireless servo tool.

Each turnout decoder controls two turnouts. Each sensor decoder accommodates eight digital and one analogue sensor. With each LED decoder eight individual LEDs can be switched on and off wireless by Rocrail.

WiFi network

Within the WiFi network the participants need to establish a communication link. This can be done with the “UDP”(User Datagram Protocol) protocol or the “TCP/IP”(Transport Control Protocol / Internet Protocol). The most important difference between UDP and TCP/IP is that UDP is a “fire and forget” protocol where TCP/IP safeguards the delivery of data packets. At the other hand UDP allows for broadcasting. Eltraco uses TCP/IP because of the certainty of delivery of data packets. If necessary broadcasting is done by proper use of the subscription method of Mosquitto.

An IP-address consists of four triplets of numbers. Within the network for Eltraco for the time being only the rightmost triplet is used. This provides an address space for 256 participants. When required this can be broadened by using an extra triplet.

The following IP-addresses are allocated semi permanently: IP-address: Rocrail (explained further on)

	Servo tool
	Command Station

To put it simple 250 addresses are available for Eltraco decoders.

Rocnet protocol

Within Rocrail the “Rocnet protocol” is defined and can be used freely. Eltraco uses the Rocnet protocol. Rocrail exchanges messages with the Eltraco decoders. The exact content of these messages, the use of data packets, is extensively explained in the Rocrail Wiki. Part of those messages is the addressing mechanism used to deliver the Rocnet messages. Each participant in a Rocnet network is allocated a unique node-number. Node-number 1 is reserved for Rocrail.


MQTT is an “IOT” (Internet of Things) protocol to transfer messages between network participants. It requires very little overhead and is rather easy to use. Messages from the sender are transferred to a “post office”, being Mosquitto. Those message are put into mailboxes with a certain user defined “topic”. Recipients subscribe to topics which they are interested in. The main reason to apply this message protocol within Eltraco is the disconnection between sending and receiving it provides. It is not necessary to program any “handshaking” or whatsoever.


In different words, Rocrail creates messages to be sent to decoders. Those messages are put into envelopes and transferred to Mosquitto. When a decoder is ready to receive a message it is transferred from the post office to the decoder. The decoder takes the message out of the envelope and reacts on the content of the message. This happens the other way around in the same fashion.

Rocnet messages

Rocnet uses node-numbers for each element in the network. A node-number consists of two bytes, a MSB (Most Significant Byte) and a LSB (Least Significant Byte). For Eltraco the LSB is used. A byte has a maximum value of 256, the same as the rightmost triplet of an IP-address. In the configuration windows of Rocrail this node-number has to be inserted into the field “Bus”. So the node-number is the bus-number. Furthermore a Rocnet participant can have multiple “ports”. In the configuration windows of Rocrail this port-number has to be inserted into the field “Address”. It accepts a number ranging from 1 to 256.


With this in mind the following message addressing scheme is used within Eltraco: For all turnout decoders the bus-number is the same, being “9”. Each turnout has its own unique number out of the range “2 .. 250”. “9” Is to be skipped. The number of the first turnout of the two of a turnout decoder is also used as the right triplet of the IP-address of the decoder. (e.g. a decoder controls turnout 17 and 53. The bus-number is “9”, the addresses are 17 and 53, the IP-address of the decoder is Bus-number 1 is allocated to the server. Because of the relation in Eltraco between Rocnet node-number and IP-address, the IP-address “” can not be allocated to any Eltraco decoder.

The sensors of the turnout decoder report at bus-number “9” with the same address as the turnout they belong to. (e.g. decoder controls turnout 32 and 93. One sensor reports at bus 9 address 32 and the other at bus 9 address 93)

For all other decoders the node-number is the same as the right triplet of the IP-address of the decoder. Each port of a decoder is addressed with its port-number starting with “1”. (e.g. sensor decoder with IP-address has bus-number 123. The sensors have each an address out of the range from 1 .. 9. LED switch decoder with IP-address 83 has bus-number 83 with each output having an address out of the range 1 ..8.)

In total 250 decoders can be used.

Personal Tools