User Tools

Site Tools


rocnet:rocnetnode-hwsetup-en

Differences

This shows you the differences between two versions of the page.


rocnet:rocnetnode-hwsetup-en [2022/11/20 17:19] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +====== RocNetNode Setup ======
 +[[:english#command_stations|{{  :interface.png}}]][[:english|{{  :rocrail-logo-35.png}}]][[:rocnet:rocnetnode-en|{{ :rocnet:rocnet-hw.png}}]]
 +[[:english|Content]] -> [[:english#command_stations|Command Stations]] ->  **[[rocnet:rocnet-prot-en|RocNet]]** 
 +  * [[rocnet:rocnet-prot-en|RocNet Protocol]] | [[:rocnet:rocnetnode-en|RocNetNode]]
 +    * **[[:rocnet:rocnetnode-hwsetup-en|RocNetNode Setup]]** | [[:rocnet:rocnetnode-setup-en|RocNetNode Configuration]] | [[:rocnet:rocnetnode-img-en|Installer package]]
 +    * [[:gca1-pi01-en|GCA-Pi01]] | [[:rocnet:pi01can-en|Pi01CAN]] | [[:gca_pi02-en|GCA-Pi02]] | [[:gca-pi03-en|GCA-PI03]] | [[:gca-pi04-en|GCA-PI04]] | [[:gca-pi05-en|GCA-Pi05]] | [[:gca-pi06-en|GCA-Pi06]] | [[:GCA-PI07-en|GCA-PI07]] | [[:gca107-en|GCA107 Relay board]] | [[:rocnet:rocdisplay-en|RocDisplay]] | [[:rocnet:fastclock-en|Fast Clock]]
 +  * [[:wiki:user:minou65:rocnetnode-epseak-de|Setup ESpeak (DE)]] | [[:wiki:user:minou65:soundrocnode|Setup Sound (DE)]]
  
 + \\
 +=====Overview=====
 +{{:gca:rocnet_concept.png?800}}\\
 +  * Libre Office document of this graphic: {{:gca:rocnet_concept.odg}}
 +
 +====Optional====
 +  * [[:rfid12-en|RFID12]]: RFID reader.
 +  * [[:dcc232-en|DCC232]]: DCC Generator.
 +  * [[:ord3-cs-en|ORD3]]: 3A Booster.
 +
 +
 + \\
 +
 +=====Rocrail Setup=====
 +{{:rocnet:rocnet-en.png}}\\
 +\\
 +\\
 +Setup a __**[[:rocrailini-controller-en|Command Station]]**__ with __**[[:rocnet:rocnet-prot-en#udp_8_bit|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: __**[[:rocnet:rocnetnode-setup-en#acknowledge_sensor_event|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 __**[[:loc-int-en|Loco Interface Tab]]**__.\\
 +Only of use if one of the RocNetNodes is setup as __**[[:rocnet:rocnetnode-setup-en#dcc_type|Command Station]]**__.\\ 
 +
 +=====MQTT=====
 +{{ :rocnet:rocnet-mqtt-en.png?240}}
 +The MQTT Sub Library will connect to a  Broker, Mosquitto, and will subscribe to all __**[[:rocnet:rocnet-prot-en#groups|Groups]]**__.\\ 
 +ESP8266 based rocnet node implemnetions are listed here [[:rocnet-mqtt-client-en]].\\
 +This library uses QoS 1. Clients may publish with QoS 0.\\
 +  * http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html
 +The standard MQTT port is **[[https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.txt|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'':
 +<code xml>
 +<exception text="abend"/>
 +</code>
 +
 +
 +
 + \\
 +
 +=====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 __**[[http://www.raspberrypi.org/downloads|Raspberry Pi Download]]**__ site.\\
 +Also a HowTo is available: __**[[http://elinux.org/RPi_Easy_SD_Card_Setup|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: __**[[:rocnet:rocnetnode-img-en#download_install|Installer package]]**__\\
 +
 +
 + \\
 +
 +=====I2C I/O=====
 +====The boards====
 +{{ :gca:gca_pi02_pict03.jpg?200}}
 +The __**[[:gca1-pi01-en|GCA-Pi01]]**__ is connected on Rasberry Pi P1 header.\\
 +The __**[[:gca_pi02-en|GCA-Pi02]]**__ can be connected with CAT5(Ethernet) or Xpressnet(RJ12) cable to the Pi01 board.\\
 +__**[[:rocnet:rocnetnode-en#boards|Look at this section for an overview of all available boards.]]**__\\
 + \\
 +
 +=====RFID Setup=====
 +One **[[:rfid12-en|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=====
 +Ready to use and mountable case: \\
 +| {{http://ecx.images-amazon.com/images/I/61V98pi6sXL._SL1417_.jpg?0x200}} | {{http://ecx.images-amazon.com/images/I/61CUVIKvorL._SL1500_.jpg?0x200}} |
 +|  [[http://www.amazon.de/gp/product/B008VVXMK0|Model B]]  |  [[http://www.amazon.de/gp/product/B00MQWQT0A/ref=oh_aui_detailpage_o00_s00|Model B+]]  |
 +
 + \\
 +
 +=====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:
 +<code>
 +sudo raspi-config
 +</code>
 +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 **[[http://en.wikipedia.org/wiki/Local_area_network|Local Area Network]]**.\\
 +Just simple **[[http://en.wikipedia.org/wiki/Lan_switch|switches]]** will do:\\
 +{{:roco:eth-switch.jpg?200}}{{:rocnet:cat5-cable.jpg?100}}\\
 +
 +====IPv4 Address====
 +{{ http://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:
 +  - Configure every device with a static IP-Address.
 +  - Add a **[[http://en.wikipedia.org/wiki/Dhcp|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====
 +Disable all Network Devices except the one in which RocNet should be active.\\
 +{{:rocnet:win-network-adapters-en.png?700}}\\
 +
 +====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:
 +  * [[http://windows.microsoft.com/en-us/windows/open-port-windows-firewall#1TC=windows-7|Open a port in Windows Firewall]] (EN)
 +  * [[http://www.dma.ufg.ac.at/app/link/Allgemein%3AModule/module/24097?step=4|Step by step guide.]] (DE)
 +\\
 +====Operation without LAN====
 +{{  :rocnet:rj45-loop.png}}
 +{{  :rocnet:rj45-loop-connector.png}}
 +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:
 +<code>
 +sudo nano /etc/network/interfaces
 +
 +iface eth0 inet dhcp
 +</code>
 +e.g. change to:
 +<code>
 +iface eth0 inet static
 +address 192.168.178.28 
 +netmask 255.255.255.0
 +gateway 192.168.178.1
 +</code>
 +
 +
 +This section has evolved from a **[[http://forum.rocrail.net/viewtopic.php?p=85719#p85719|german forum topic]]**.\\
 + \\
 +
 + \\
 +=====Check the Raspberry Pi=====
 +[[http://raspberrypi.org|“Raspberry Pi" is a trademark of the Raspberry Pi Foundation.]]\\
 +====CPU====
 +The hardware revision can be checked with the following command:
 +<code>
 +cat /proc/cpuinfo
 +</code>
 +Example:
 +<code>
 +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
 +</code>
 +====Raspbian====
 +<code>
 +cat /etc/os-release
 +</code>
 +
 +Example of Raspbian Stretch, 9:
 +<code>
 +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"
 +</code>
 + \\
 +
 +=====Module example=====
 +[[:userpages:rjversluis:plan-f:mod2-en|Plan-F Module 2]]\\
 +{{:users:rjversluis:plan-f:plan-f-mod2-rocnet.jpg?800}}
 +  * 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 127.0.0.1