Table of Contents
RocNetNode Setup
Content → Command Stations → RocNet
-
- GCA-Pi01 | Pi01CAN | GCA-Pi02 | GCA-PI03 | GCA-PI04 | GCA-Pi05 | GCA-Pi06 | GCA-PI07 | GCA107 Relay board | RocDisplay | Fast Clock
Overview
- Libre Office document of this graphic: rocnet_concept.odg
Optional
Rocrail Setup
Setup a Command Station with RocNet over UDP using the default settings:
RocNet ID | 1 |
Sub-Library | UDP |
Address | 224.0.0.1 |
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.
Options
CRC
Not relevant for RocNetNode, leave it unselected.
Watchdog
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.
Loco
Bus
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.
MQTT
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.
Ping
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
I2C I/O
The boards
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…
USB
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.
Cases
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.
LAN
RocNetNodes must be connected to the the Local Area Network.
Just simple switches will do:
IPv4 Address
Every device in the LAN needs an IP-Address, and there are two ways to set this up:
- Configure every device with a static IP-Address.
- 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. |
WiFi
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
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.
- click Start
- click Run
- type cmd
- type Firewall.cpl
- click "Off"
- select Exceptions, uncheck all
- select Advanced, uncheck all.
- 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:
- Step by step guide. (DE)
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 224.0.0.1.
This communication is not done internally, as with the localhost IP address 127.0.0.1 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 address 192.168.178.28 netmask 255.255.255.0 gateway 192.168.178.1
This section has evolved from a german forum topic.
Check the Raspberry Pi
CPU
The hardware revision can be checked with the following command:
cat /proc/cpuinfo
Example:
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
Raspbian
cat /etc/os-release
Example of Raspbian Stretch, 9:
PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" NAME="Raspbian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" ID=raspbian ID_LIKE=debian HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
Module example
- Command Station: RocNetNode + DCC232 + ORD3/4
- The Ethernet Switch is powered by a GCA08 9V.