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 ====== | ||
| + | [[: | ||
| + | [[: | ||
| + | * [[rocnet: | ||
| + | * **[[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | \\ | ||
| + | =====Overview===== | ||
| + | {{: | ||
| + | * Libre Office document of this graphic: {{: | ||
| + | |||
| + | ====Optional==== | ||
| + | * [[: | ||
| + | * [[: | ||
| + | * [[: | ||
| + | |||
| + | |||
| + | \\ | ||
| + | |||
| + | =====Rocrail Setup===== | ||
| + | {{: | ||
| + | \\ | ||
| + | \\ | ||
| + | Setup a __**[[: | ||
| + | \\ | ||
| + | \\ | ||
| + | | RocNet ID | ||
| + | | Sub-Library | **UDP** | ||
| + | | Address | ||
| + | | 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: __**[[: | ||
| + | |||
| + | ===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 __**[[: | ||
| + | Only of use if one of the RocNetNodes is setup as __**[[: | ||
| + | |||
| + | =====MQTT===== | ||
| + | {{ : | ||
| + | The MQTT Sub Library will connect to a Broker, Mosquitto, and will subscribe to all __**[[: | ||
| + | ESP8266 based rocnet node implemnetions are listed here [[: | ||
| + | This library uses QoS 1. Clients may publish with QoS 0.\\ | ||
| + | * http:// | ||
| + | The standard MQTT port is **[[https:// | ||
| + | ====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 '' | ||
| + | <code xml> | ||
| + | < | ||
| + | </ | ||
| + | |||
| + | |||
| + | |||
| + | \\ | ||
| + | |||
| + | =====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:// | ||
| + | Also a HowTo is available: __**[[http:// | ||
| + | In the Raspbian-Options " | ||
| + | |||
| + | ====RocNetNode Package==== | ||
| + | How to get and install the RocNetNode software is explained on this page: __**[[: | ||
| + | |||
| + | |||
| + | \\ | ||
| + | |||
| + | =====I2C I/O===== | ||
| + | ====The boards==== | ||
| + | {{ : | ||
| + | The __**[[: | ||
| + | The __**[[: | ||
| + | __**[[: | ||
| + | \\ | ||
| + | |||
| + | =====RFID Setup===== | ||
| + | One **[[: | ||
| + | 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:// | ||
| + | | [[http:// | ||
| + | |||
| + | \\ | ||
| + | |||
| + | =====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: " | ||
| + | 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/hosts | ||
| + | A reboot is necessary to activate the new hostname.\\ | ||
| + | \\ | ||
| + | |||
| + | =====LAN===== | ||
| + | RocNetNodes must be connected to the the **[[http:// | ||
| + | Just simple **[[http:// | ||
| + | {{: | ||
| + | |||
| + | ====IPv4 Address==== | ||
| + | {{ http:// | ||
| + | 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:// | ||
| + | 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.\\ | ||
| + | {{: | ||
| + | |||
| + | ====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 " | ||
| + | - 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:// | ||
| + | * [[http:// | ||
| + | \\ | ||
| + | ====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" | ||
| + | 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 / | ||
| + | |||
| + | 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 **[[http:// | ||
| + | \\ | ||
| + | |||
| + | \\ | ||
| + | =====Check the Raspberry Pi===== | ||
| + | [[http:// | ||
| + | ====CPU==== | ||
| + | The hardware revision can be checked with the following command: | ||
| + | < | ||
| + | cat / | ||
| + | </ | ||
| + | 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 : | ||
| + | CPU architecture: | ||
| + | CPU variant : 0x0 | ||
| + | CPU part : 0xd03 | ||
| + | CPU revision : 4 | ||
| + | ... | ||
| + | Hardware : BCM2835 | ||
| + | Revision : a02082 | ||
| + | Serial : 00000000fc9eaf9b | ||
| + | </ | ||
| + | ====Raspbian==== | ||
| + | < | ||
| + | cat / | ||
| + | </ | ||
| + | |||
| + | Example of Raspbian Stretch, 9: | ||
| + | < | ||
| + | PRETTY_NAME=" | ||
| + | NAME=" | ||
| + | VERSION_ID=" | ||
| + | VERSION=" | ||
| + | ID=raspbian | ||
| + | ID_LIKE=debian | ||
| + | HOME_URL=" | ||
| + | SUPPORT_URL=" | ||
| + | BUG_REPORT_URL=" | ||
| + | </ | ||
| + | \\ | ||
| + | |||
| + | =====Module example===== | ||
| + | [[: | ||
| + | {{: | ||
| + | * Command Station: RocNetNode + DCC232 + ORD3/4 | ||
| + | * The Ethernet Switch is powered by a GCA08 9V. | ||