User Tools

Site Tools


rocrailini-service-en

Differences

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


Previous revision
rocrailini-service-en [2024/04/01 16:05] (current) – [Location] rjversluis
Line 1: Line 1:
 +====== Services ======
 +[[:english#rocrail|{{  :server.png}}]][[:english|{{  :rocrail-logo-35.png}}]]
 +[[english | Content ]] -> [[english#rocrail|Rocrail Server]] -> [[rocrailini-en | Configuration]] 
 +  * [[rocrailini-gen-en|General]] | [[rocrailini-trace-en|Trace]] | **Service**  | [[rocrailini-automode-en|Automatic]] | [[rocrailini-controller-en|Controller]] | [[:networking-en|R2Rnet]] | [[:rocrailini-rocweb-en|RocWeb]] | [[:finder:finder-en|Finder]] | [[:rocrailini-cmdmapping-en|Command Mapping]]
 +    * [[clockservice-en|Clock Service]] 
 +// \\ // \\
 +
 +===== Rocrail Service tab. =====
 +
 +{{rocrailini-service-en.png?800}}\\
 + \\
 +
 +===== HTTP Service =====
 +[[servermonitor-en|See for details this chapter.]]
 + \\
 +
 +====Port====  
 +:!: The port must differ from the client service port to avoid conflicts.\\
 + \\
 +
 +===== Clock Service =====
 +Use this service if a faster clock is wanted and/or all clients must be synchronized. 
 +====Divider====
 +The time divider is used to setup the clock speed: 1...100. (Example: A divider of 10 will run the model time 10 times faster than real time.)\\
 +The next field is the Client update frequency in model minutes: 1...60. Default is every model minute.\\
 +====Hour/Minute====
 +This is the start time for the clock service.\\
 +The computer time is used if the values are set to 24:60.\\
 +
 +====Semi real time====
 +With this option all fast clock options are available if the divider is set to one. (Otherwise clock commands are rejected.)\\
 +__Note:__ //The clock will no longer be in sync with the hardware computer clock.//\\
 +====Stop clock at power off====
 +Stop the fast clock in case of a power off event. (Short cut)\\
 + \\
 +
 +===== Client Service =====
 +This is the port at which Rocview clients must connect to become all data and events needed to function.
 +
 +==== Client Port ====
 +The official assigned port by IANA is **[[iana-rcs|8051]]**. \\
 +
 +
 +==== Only first can control ====
 +Prevent secondary clients controlling the Rocrail server; only the first one connected has control.\\
 +A better solution is the use of Control or Slave Code.
 +==== Control code ====
 +The client must provide this control code to get write access if set.\\
 +  * This overrules the "Only first can control" option.
 +  * Leave blank for normal use.
 +  * Supported Mobile Clients:
 +    * Rocweb
 +    * andRoc
 +
 + \\
 +=====WIO Watchdog=====
 +Enables monitoring of WIO reachability. The timeout ist defined in units of 10 ms.\\
 +Default: 700 x 10 ms = 7 seconds.\\
 +WIOs are sending every 4 seconds an alive message.\\
 +====Exclude====
 +Excluding none relevant WIOs can be done as CSV list with IDs.\\
 +Ranges are also allowed like: ''45-55''\\
 +
 + \\
 +===== Slave code =====
 +If the slave code is set, and a connected client **cannot** provide this code, the following selected features will be rejected:
 +  * System (Includes automatic and power commands.)
 +  * Shutdown Server
 +  * Switches
 +  * Signals
 +  * Outputs
 +  * Routes
 +  * Locomotives
 +
 +
 + \\
 +
 +===== SRCP Service =====
 +{{ :srcp-clients.png?300}}
 +Optional service for **[[http://srcpd.sourceforge.net/|SRCP]]** Clients like **[[http://sourceforge.net/projects/j-man/|J-Man]]** or **[[http://spdrs60.sourceforge.net/|spdrs60]]**.\\
 +The objects addressed by those clients must be defined in the Rocrail track plan.\\
 +  * http://www.der-moba.de/index.php/Digitalprojekt#SRCP-Clients
 +  * [[:srcp-scripting-en|SRCP scripting]]
 +====Device====
 +Optional serial device to service SRCP.\\
 +Line settings are fixed:
 +  * 115200 bps
 +  * 8N1
 + \\
 +
 +===== SNMP Service =====
 +Activates the **[[http://en.wikipedia.org/wiki/Simple_Network_Management_Protocol|SNMP]]** v1/2c Agent in the Rocrail server.\\
 +:!: By default port 161 is used for the SNMP service which requires extra user privilege: \\
 +<code>
 +OSNMP    0658 SNMP bind
 +OSocket  0513 bind() failed [13] [Permission denied]
 +</code>
 + \\
 +
 +==== Config ====
 +<code xml>
 +  <SnmpService port="161" trapport="162" traphost="192.168.100.77"/>
 +</code>
 +
 +==== GetRequest example ====
 +Direct ObjectID:
 +<code>
 +$ snmpget -v 2c -c public localhost 1.3.6.1.2.1.1.1.0
 +iso.3.6.1.2.1.1.1.0 = STRING: "Rocrail 2.0.2508 Sunrise"
 +</code>
 +Symbolic OjectID:
 +<code>
 +$ snmpget -v2c -c public localhost SNMPv2-MIB::sysDescr.0
 +SNMPv2-MIB::sysDescr.0 = STRING: Rocrail 2.0.2508 Sunrise
 +$ snmpget -v2c -c public localhost SNMPv2-MIB::sysUpTime.0
 +SNMPv2-MIB::sysUpTime.0 = Timeticks: (3443) 0:00:34.43
 +</code>
 +
 + \\
 +
 +====Supported commands ====
 +  * GetRequest
 +  * GetNextRequest
 +  * SetRequest
 +  * BulkRequest
 +  * Trap
 +
 + \\
 +
 +==== IANA ====
 +{{ :rr-service:iana-pen-rocrail-37707.png?200}}
 +  * Rocrail PEN **[[http://www.iana.org/assignments/enterprise-numbers|37707]]**
 +
 + \\
 +
 +==== MIB ====
 +//Management Information Base//\\
 +{{ :rr-service:mib-browser.png?400}}
 +  *  {{:snmp:rocrail.mib.zip}}
 +=== Free MIB Browser ===
 +  * http://www.ireasoning.com/downloadmibbrowserfree.php
 + \\
 +
 +==== Traps ====
 +  * Cold boot
 +  * Link up: new client connection
 +  * Link down: client disconnected
 +  * User:
 +    * Shutdown
 +    * Exception
 +
 + \\
 +=====@Box=====
 +The location of the __**[[:abox:archivebox-en|@Box]]**__.\\
 +
 + \\
 +=====MQTT Service=====
 +Clients can use the __**[[http://mosquitto.org|MQTT Broker]]**__ to communicate with the Rocrail Server.\\
 +^ MQTT Topic ^ Description ^
 +| ''rocrail/service/info'' | All server broadcasts are published with this topic name. |
 +| ''rocrail/service/client'' | Clients can publish commands with this topic. \\ :!: //A valid support key is necessary; Without key only 5 demo minutes. // |
 +| ''rocrail/service/field'' | Clients can publish hardware events with this topic. |
 +| ''rocrail/service/command'' | Command station commands for __**[[:digint:user-en|User Libraries]]**__. |
 +\\
 +The payload of the MQTT messages are in __**[[:rocrail-server-scripting-en|RCP Format]]**__.\\
 +The Rocrail Server uses the __**[[http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html|MQTT V3.1 Protocol]]**__.\\
 +====Hostname====
 +The DNS name or TCPIP address of the MQTT Broker.\\
 +====Port====
 +The service port number of the MQTT Broker.\\
 +The default port number used by [[https://mosquitto.org|Mosquitto]] is 1883.\\
 +
 +====Group====
 +//Topic grouping//\\
 +Use the Item Names in the Broadcast Topic.\\
 +
 +====User CS Libraries====
 +With both topics, //field// and //command//, it is possible to implement a user defined CS library without Rocrail Source dependencies.\\ 
 +
 +====Clients====
 +Only __**[[http://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#qos-flows|Quality of Service 1]]**__ is supported.\\
 +Clients may use QoS 0, but we strongly recommend QoS 1.\\
 +The only known Client for this service is the command line utility of Mosquitto:\\
 +<code bash>
 +mosquitto_pub -p 60123 -t rocrail/service/client -m "<sys cmd=\"stop\"/>" -q 1
 +</code>
 +Broker response:
 +<code bash>
 +1467710159: New connection from 127.0.0.1.
 +1467710159: New client connected from 127.0.0.1 as mosq_pub_2323_rob-Virt.
 +1467710159: Sending CONNACK to mosq_pub_2323_rob-Virt (0)
 +1467710159: Received PUBLISH from mosq_pub_2323_rob-Virt (d0, q1, r0, m1, 'rocrail/service/client', ... (17 bytes))
 +1467710159: Sending PUBACK to mosq_pub_2323_rob-Virt (Mid: 1)
 +1467710159: Sending PUBLISH to RocrailService (d0, q1, r0, m1, 'rocrail/service/client', ... (17 bytes))
 +1467710159: Received DISCONNECT from mosq_pub_2323_rob-Virt
 +1467710159: Received PUBACK from RocrailService (Mid: 1)
 +1467710159: Received PUBLISH from RocrailService (d0, q1, r0, m3, 'rocrail/service/info', ... (51 bytes))
 +1467710159: Sending PUBACK to RocrailService (Mid: 3)
 +1467710159: Received PUBLISH from RocrailService (d0, q1, r0, m4, 'rocrail/service/info', ... (175 bytes))
 +1467710159: Sending PUBACK to RocrailService (Mid: 4)
 +1467710160: Received PUBLISH from RocrailService (d0, q1, r0, m5, 'rocrail/service/info', ... (60 bytes))
 +1467710160: Sending PUBACK to RocrailService (Mid: 5)
 +</code>
 +
 + \\
 +====Discovery====
 +An UDP Multicast discovery service is also available for other devices which wants to use the same broker.\\
 +| Host | 224.0.0.1 |
 +| Port | 8051 |
 +
 +The device must send a message withe the following content:
 +| **BROKER-GET** |
 +It will get the following reply:
 +| **BROKER-HOST:<hostname>** \\ **BROKER-PORT:<port#>**|
 +Both lines ends with a linefeed: ''\n''\\
 +
 + \\
 +====Last Will====
 +If the Rocrail MQTT-Broker connection get lost, the //Last Will// can be observed in topic ''rocrail/service/info'':
 +<code xml>
 +<exception text="abend"/>
 +</code>
 +
 + \\
 +=====Location=====
 +Location information for calculating sunrise and sunset.\\
 +====Example====
 +Speyer(D):
 +|< >|
 +| latitude | 49.32083 |
 +| longitude | 8.43111 |
 +
 +  * https://latitudelongitude.org
 +
 +
 +
 +
 +