srcpd.conf(5)

NAME
srcpd.conf - The configuration file for the srcpd daemon

DESCRIPTION
The file /etc/srcpd.conf is used by the srcpd (8). This file contains the runtime configuration for the daemon and it's connection(s) to model railroad system. See srcpd (8) for instruction how to use the daemon.

DEFAULT CONFIGURATION FILE

The default file is shipped as with the srcpd and contains both default settings and an example bus configuration.
    <?xml version="1.0"?>
    <srcpd version="2.0">
      <bus>
        <server>
          <tcp-port>4303</tcp-port>
          <pid-file>/var/run/srcpd.pid</pid-file>
          <username>_srcpd</username>
          <groupname>_srcpd</groupname>
        </server>
        <verbosity>5</verbosity>
      </bus>
      <bus>
        <loopback>
          <number_fb>3</number_fb>
        </loopback>
        <use_watchdog>no</use_watchdog>
        <verbosity>5</verbosity>
        <auto_power_on>yes</auto_power_on>
      </bus>
    </srcpd>

FILE FORMAT

The configuration file for srcpd is stored in XML format. As XML files are plain text, experienced users can manipulate such files with the help of a text editor. Less experienced users should select an external configuration tool to ensure a syntactically correct format.

If errors occur while reading the configuration file, the daemon will send appropriate notifications to the syslog daemon. These messages can be watched using the syslog facility user.info. This facility is usually sent to the file /var/log/messages (or /var/log/syslog). On some systems the /etc/syslog.conf may need to be edited to access the user.info facility:

    user.info     /var/adm/user-info.log

Currently there is no document type definition (DTD) available, to validate the format of a user created configuration file.

Each configuration file must provide the following base structure:

    <?xml version="1.0"?>
    <srcpd>
    ...
    </srcpd>

Within this structure (...) the necessary buses are configured, each using a separate substructure:

    <bus>
    ...
    </bus>
    <bus>
    ...
    </bus>

  General hints

The first configured bus should always be the server-bus. Sequence and number of the following buses are any desired. Numbering of each single bus is done according to the sequence in this configuration file. The server bus itself gets number 0, all following buses are numbered continuously starting with 1 up to a maximum limit of 20.

Only buses that are actually used with the daemon should be filed. Not used buses can be commented out:

    <!--
    <bus>
    ...
    </bus>
    -->

Please bear in mind in this case the numbering of the following buses will be changed accordingly.

  Universal options

The following options are usable for all used bus sections. Universal options must be specified after bus specific options.

verbosity
    Depending on this number (valid range: 0..5) the bus will tell you less or more about what is happening. The 0 value gives a minimum output. This option is mainly used for debugging reasons. You can watch these messages using the syslog daemon file /var/log/messages (or /var/log/messages); see srcpd(8) for more information. The default value is 4.

use_watchdog
    Some buses provide a watchdog feature to cancel a blocked bus thread. Valid input values are yes or no. The default value is no.

restore_device_settings
    Some buses provide a feature to restore serial device settings. Valid input values are yes or no. The default value is no.

device
    This is the name of the connected device (like /dev/ttyS0). If bus is server or loopback no assignment is necessary. The default value is /dev/null.

auto_power_on
    This option enables/disables automatical power on for a bus on server daemon start. This option is not necessary for server and loopback buses. The default value is no.

speed
    Buses using serial devices with a not fixed transfer speed allow one to adjust this parameter. Possible values are 2400, 4800, 9600, 19200, 38400, 57600 and 115200 baud. For buses with variable interface speed the default value is 2400.

  server

This bus is needed every time. The following options can be used for individual setup.

tcp-port
    This is the TCP/IP port for communication between srcpd and his clients. Default is 4303 (this port number is assigned to SRCP by IANA).

pid-file
    File, where srcpd is storing it's process-id. According to FHS the default is /var/run/srcpd.pid.

username
    srcpd runs under this user. Default is _srcpd.

groupname
    srcpd runs under this group. Default is _srcpd.

  dccar

This driver supports DC-Car Infrared Remote Control. This mode supports remote control of cars (e.g. Faller Car-System) with a DC-Car decoder or Infracar decoder. A sender must be connected to your PC's seriall port. Some USB/Serial Adapter also work, e.g. Prolifi PL 2303 based adapter. A description of the sender is available at http://www.dc-car.de/pc-sender.html

mode
    This option specifies whether DC-Car or Infracar decoders are controlled. Currently it is not possible to combine both modes. Possile values are dccar and infracar.

number_gl
    This value specifies the address range of the used vehicles (GL). Up to 1024 DC-Cars or 4096 Infracars can be controlled. Default values are 1024 (dccar) and 4096 (infracar).

pause_between_commands
    This value specifies the time between two commands The default value is 10 ms.

Example
    <bus>
    	<dccar>
    		<mode>dccar</mode>
    		<number_gl>1024</number_gl>
    		<pause_between_commands>10</pause_between_commands>
    	</dccar>
    	<auto_power_on>yes</auto_power_on>
    	<verbosity>4</verbosity>
    	<device>/dev/ttyUSB0</device>
    </bus>

  ddl

Digital Direct for Linux (DDL) via serial line (RS232). With this module the PC is enabled to generate a digital control voltage for Maerklin/Motorola (MM) and/or NMRA/DCC using the serial interface (RS232) hardware. Output lines TxD and GND are used by this feature and must be connected to booster inputs properly.

This module exposes optimal signal performance if special user rights for the srcpd are applied. It is recommended especially for Maerklin/Motorola users to configure a system user srcpd and a group srcpd with these command lines:
   $ addgroup --system srcpd
   $ adduser --system --no-create-home --ingroup srcpd srcpd In order to increase the realtime priority for this user the system file /etc/security/limits.conf must be edited to add following line:
    srcpd - rtprio 99 Additionally check if the pam_limits parameters in configuration file
    /etc/pam.d/su are activated, so user limits set in /etc/security/limits.conf are effective. According to these measures the configuration file must be adapted as follows:
    <server>
      ...
      <username>srcpd</username>
      <groupname>srcpd</groupname>
      ...
    </server>

number_ga
    Maximum usable decoder address number for generic accessory devices (GA). The default value is 324. please note that there is an offset of 4 between the DDL addresses and the addresses according to the documentation from maerklin. The equation ddl-address = maerklin docu address + 4 is used. This is due to some interpretation differences what the trits mean. Details can be found at http://vogt-it.com/OpenSource/DDL/Addrestable.html

number_gl
    Maximum usable decoder address number for generic locomotive devices (GL). The default value is 81.

enable_ringindicator_checking
    The ring indicator (RI) is a line of the serial interface RS232. This line can be used to switch off digital signal power, e.g. by pushing a connected emergency stop button. Signal power is switched off if RI line input voltage changes from -12V (-5V) to +12V (+5V). If this feature is used, the parameter must be set to yes, if not used, it must be set to no. The default value is no.

enable_checkshort_checking
    The DSR line of the serial interface RS232 can be used to switch off digital power as response to shortcut detection. The connected booster must provide support for this kind of feature and must be wired to this line accordingly. If used the parameter must be set to yes, if not used, it must be set to no. The default value is no.

inverse_dsr_handling
    Some boosters provide inverted output voltage for shortcut detection. If such a booster is used this parameter must be set to yes. The default value is no.

enable_maerklin
    This parameter must be set to yes, if decoders for the old (not mfx) Maerklin/Motorola (MM) format are used. If not used, it should be set to no. The default value is yes.

enable_nmradcc
    This parameter must be set to yes, if decoders for NMRA/DCC format are used. If not used, it should be set to no. The default value is yes.

It is also possible to enable both digital protocol formats, to drive decoders of both digital systems attached to the same power line. In order to minimize CPU load, the not used protocol should always be disabled.

improve_nmradcc_timing
    The default baudrate of DDL is 19200 baud, which is slightly higher than allowed by NMRA DCC standard. With a UART 16550A you can change the baudrate to 16457 baud, which is within the specification. This is only needed if you have timing problems with the default. Valid input values are yes or no. The default value is no, which corresponds to 19200 baud.

nmra_ga_offset
    This parameter is for backward compatibility to erddcd and alternate usage of different central units, due to the fact there are two ways to handle NMRA/DCC decoder addresses. This parameter allows one to add an offset to all used address values. E.g., if all GA decoder addresses are shifted by 4 (i.e. you want to change switch 1, and you have to change switch 5 to do this), then this parameter should be set to 1. Valid values are 0 and 1. Default value is 0.

shortcut_failure_delay
    Number of micro seconds srcpd waits to switch off digital power, after a shortcut is detected. The default value is 0.

nmradcc_translation_routine
    There are 3 implementations for converting the logical command bits into serial line commands, considering the start and stop bits of the serial line. Valid values are 1, 2 and 3. Default value is 3.

enable_usleep_patch
    Due to certain issues of the MM protocol its usage results in a significant amount of CPU load for srcpd, caused by busy waiting. This parameter gives the possibility to improve this situation by introducing a process wait state for a certain amount of time. Normally this does not result in any trouble controlling the attached decoders, so the parameter should be set to yes. Valid values are yes and no. The default value is yes.

usleep_usec
    Number of micro seconds the signal generating process pauses. This value should be as small as possible; a bigger value can result in improper digital signal generation. There have been good results using values between 100 and 250 usecs. This parameter is only used, if enable_usleep_patch is set to yes. The default value is 100.

program_track
    This parameter allows you to suppress commands which are issued for a program track. This parameter should only be used on your main. Valid input values are yes or no. The default value is yes, i.e. all program track commands will be executed by default.

Example Maerklin/Motorola
    <bus>
        <ddl>
           <number_ga>200</number_ga>
           <number_gl>81</number_gl>
           <enable_maerklin>yes</enable_maerklin>
           <enable_nmradcc>no</enable_nmradcc>
           <enable_usleep_patch>yes</enable_usleep_patch>
           <usleep_usec>200</usleep_usec>
        </ddl>
        <auto_power_on>no</auto_power_on>
        <verbosity>4</verbosity>
        <device>/dev/ttyS0</device>
    </bus>

Example NMRA/DCC
    <bus>
        <ddl>
           <number_ga>160</number_ga>
           <number_gl>60</number_gl>
           <enable_maerklin>no</enable_maerklin>
           <enable_nmradcc>yes</enable_nmradcc>
           <nmradcc_translation_routine>3</nmradcc_translation_routine>
        </ddl>
        <auto_power_on>no</auto_power_on>
        <verbosity>4</verbosity>
        <device>/dev/ttyS0</device>
    </bus>

  ddl-s88

Digital Direct for Linux S88 via parport (IEEE 1284). This bus provides up to four S88 data links attached to the parallel port to connect S88-feedback modules. Usage of one S88 line is possible by simply wiring modules to the parallel port connectors; for advanced applications involving more than one line the wiring scheme is equivalent to the one from the DDL daemon erddcd (http://www.vogt-it.com/OpenSource/DDL) as shown in the circuit of Martin Wolf. The four S88 data links are managed as separate buses. The maximum count of modules (with 16 contacts) which can be connected to a data link is 31; so maximal 496 contacts are supported per link. When using modules with 8 contacts two modules count as one. For each data link a separate bus is initialized where the sequence of the feedback contacts of the modules is increasing as the modules are connected to the data link. If there are no modules connected to a data link the respective value of number_fb_x must be set to 0. Nevertheless this bus is initialized, that means also if only one bus is used, all four buses are initialized.

ioport
    Input/output address of the printer port. The default value is 0x0378. The value for ioport must be given in hexadecimal format (starting with 0x). Valid values for a typical Linux system are 0x0378, 0x0278 and 0x03BC. The right value can easily be detected searching through the kernel start-up messages:
        dmesg | grep parport

clockscale
    Parameter to adjust the clock rate for reading the modules. In the case of the default value 35 the original S88 clock rate of approximately 8 KHz would be achieved. Smaller values increasing the clock rate but not each module can work with this. In maximum there is approximately 125 KHz possible.

refresh
    Delay time in milliseconds after witch the feedback modules are read again. In case of the default value 100 the data is refreshed each 100 ms. The higher this value the less often the attached modules are read and the less is the resulting system load. Useful values are between 100 and 250.

fb_delay_time_0
    This value in milliseconds determines how long the signal on a feedback contact must be on zero level before it is accepted as valid and will be forwarded to all clients. With this parameter it is in a limited range possible to debounce bad feedback contacts (bouncing contacts). The default value is 0.

number_fb_1
    This statement defines the count of feedback modules connected to the data link number 1.

number_fb_2
    This statement defines the count of to data link number 2 connected feedback modules.

number_fb_3
    This statement defines the count of to data link number 3 connected feedback modules.

number_fb_4
    This statement defines the count of to the data link number 4 connected feedback modules.

Inside of the configuration the common values should be arranged before the bus specific values.

Example
    <bus>
        <auto_power_on>yes</auto_power_on>
        <verbosity>5</verbosity>
        <ddl-s88>
            <ioport>0x378</ioport>
            <number_fb_1>9</number_fb_1>
            <number_fb_2>0</number_fb_2>
            <number_fb_3>0</number_fb_3>
            <number_fb_4>0</number_fb_4>
        </ddl-s88>
    </bus>

  hsi-88

This driver supports the HSI-88 device from Littfinski connected via serial line. An USB2Serial converter should work fine. The serial line speed setting is fixed to 9600 baud and cannot be changed. The HSI-88 device provides three lines for feedback modules. To each line a maximum of 31 modules (each with 16 inputs) can be attached. If modules with 8 inputs are used, two modules count as one.

number_fb_left
    This value is the number of feedback-modules (with 16 inputs) connected to the line called left.

number_fb_center
    This value is number of feedback-modules (with 16 inputs) connected to the line called center.

number_fb_right
    This value is number of feedback-modules (with 16 inputs) connected to the line called right.

fb_delay_time_0
    This is the time in milliseconds a feedback input must be zero, before zero is delivered to the attaches SRCP clients. With this feature it is possible to compensate bad feedback bounces in a certain range. The default value is 0.

refresh
    The time in microseconds (us) after srcpd will read feedback again from HSI-88. The default value is 10000 us. The lower this value the higher the resulting CPU load.

Example
    <bus>
        <hsi-88>
            <number_fb_left>8</number_fb_left>
            <number_fb_center>5</number_fb_center>
            <number_fb_right>0</number_fb_right>
            <refresh>10000</refresh>
        </hsi-88>
        <auto_power_on>yes</auto_power_on>
        <verbosity>4</verbosity>
        <device>/dev/ttyS0</device>
    </bus>

  i2c-dev

Bus driver for i2c-dev interface of the Linux kernel, can be used to access hardware found on http://www.matronix.de/.

multiplex_buses
    TODO

ga_hardware_inverters
    TODO

ga_reset_device
    TODO

  intellibox

This driver supports the Intellibox device from Uhlenbrock (IB) connected via the serial port. Only extended mode commands are used (P50X binary protocol); this should be taken into account if protocol compatible devices (e.g. OpenDCC, DiCoStation, EasyControl) are used. Programming decoders is currently implemented for DCC only. Possible values for speed of serial port are depending from device and interface type 2400 baud, 4800 baud, 9600 baud, 19200 baud, 38400 bau and 57600 baud.

fb_delay_time_0
    This is the time in milliseconds a feedback input must be zero, before this value is delivered to clients. With this feature you can compensate bad feedback in a specific range. The default value is 0 ms.

pause_between_commands
    This is the time in milliseconds between two commands the driver must wait. The exact value should be hand tuned. If the system does not respond or drops commands try to increase this value. Default is 250 ms.

number_ga
    This is the maximal address number of Generic Accessory decoders (GA). Supported range is 0..1024. A value of 0 means no GA available. Default is 256.

number_gl
    Like the number of GA this number limits the maximum address of the Generic Locomotive decoders (GL). Supported range is 0..10239. A value of 0 means no GL available. Default is 80.

number_fb
    This is the number of S88 modules attached to the Intellibox device. The maximum valid number is 31. The default is 0 (no modules are attached). Please note that Loconet is currently not supported.

auto_speed_detection
    This option activates an automatical baudrate detection of the connected Intellibox (BABI, Break and Automatic Baud-rate Identification). This procedure takes several seconds but if enabled it is not necessary to specify a value for the speed parameter. If disabled the connection initialization is much faster but the given speed value must comply to the actual Intellibox setting. Valid values are yes and no. The default value is yes.

Example
    <bus>
        <intellibox>
            <number_ga>250</number_ga>
            <number_gl>100</number_gl>
            <number_fb>4</number_fb>
            <fb_delay_time_0>0</fb_delay_time_0>
            <pause_between_commands>0</pause_between_commands>
        </intellibox>
        <speed>19200</speed>
        <auto_speed_detection>no</auto_speed_detection>
        <auto_power_on>no</auto_power_on>
        <verbosity>4</verbosity>
        <device>/dev/ttyUSB0</device>
    </bus>

  li100, li100usb

This driver connects with the LI100, LI100F, LI101F or LI-USB devices from Lenz connected via the serial port/USB-interface. An USB2Serial converter should not be used. The serial line settings are depending on type of interface. For LI-USB it's fixed to 57600 baud with no chance to change. Autodetection of serial port interface speed is currently under construction. If connection fails, try restart of srcpd with another speed. Possible values are 9600 baud, 19200 baud, 38400 baud, 57600 baud and 115200 baud, depending on your interface.

fb_delay_time_0
    This is the time in milliseconds an feedback input must be zero, before this value is delivered to clients. With this feature you can compensate bad feedback in a specific range. The default value is 0 ms.

number_ga
    This is the number of GA. Supported range is 0..1024. A value of 0 means no GA available. Default is 99 (LI-USB 9999).

number_gl
    Like the number of GA this number gives the maximum address. Supported range is 0..9999. A value of 0 means no GL available. Default is 99 (LI-USB 9999).

number_fb
    This is the number of RS modules attached to the Lenz device. It can be as large as 512. It's assumed, that one module has 8 inputs. A value of 0 means no FB available. Default is 256 (LI-USB 512).

For Lenz USB interfaces It is very important to have the kernel module ftdi_sio available. Due to the Lenz concept, the interface unit returns different values after start.

0   everything is OK

-1  Central Unit not found. Unable to read version of central unit.

-2  Central Unit not found. Unable to read version of central unit.

-3  Interface not found. Unable to read version of interface. This can also happen, if no central unit is connected to interface.

-4  device not found

  loconet

This bus provides a driver for the Loconet system by Digitrax. The device settings may be either serial connections (e.g. MS100, LocoBuffer) or TCP/IP network links (e.g. LbServer, http://loconetovertcp.sourceforge.net/).

sync-time-from-loconet
    Decode time messages from the loconet and set the SRCP TIME device. Valid values are yes or no. Default is no.

loconet-id
    Default is 0x50.

ms100
    Support for the MS100/RS232 device of Digitrax. Valid values are yes and no. Default is no.

Example
    <bus>
        <loconet>
            <loconet-id>80</loconet-id>
            <sync-time-from-loconet>no</sync-time-from-loconet>
            <ms100>no</ms100>
        </loconet>
        <device type="network" port="1234">127.0.0.1</device>
        <!--
        <device type="file">/dev/ttyS0</device>
        -->
    </bus>

  loopback

This bus does not connect to real hardware. It is used primarily for development tasks but may be useful for real installations too. Every command on this bus does only have an echo effect on the INFO sessions. This device may be used as virtual device for communication tasks.

number_ga
    This is the maximal address number of Generic Accessory (GA) devices. Default is 256.

number_gl
    This number gives the maximum valid address number of the Generic Locomotive (GL) devices. Default is 80

number_fb
    Different to other buses this parameter takes the number of feedback contacts, not modules. Simulation of two feedback modules, each providing 16 contacts, accordingly needs a parameter value of 32. Default is 0 (no contact).

Example
    <bus>
        <loopback>
            <number_ga>120</number_fb>
            <number_gl>100</number_fb>
            <number_fb>64</number_fb>
        </loopback>
        <verbosity>2</verbosity>
        <auto_power_on>no</auto_power_on>
    </bus>

  m605x

This supports communication with the 6051 or 6050 devices from Maerklin connected via the serial port. An USB2Serial converter should work fine. The serial line settings are fixed to 2400 baud 8N2 and cannot be changed.

m6020mode
    In this mode the srcpd does not sent the 4 functions. This is a feature of the 6021 only. Valid values are yes and no. Default value is no.

fb_delay_time_0
    This is the time the driver code waits until it recognized the input change in milliseconds. This feature may support a debounce found in the hardware. The default value is 0 ms.

ga_min_activetime
    The time in milliseconds a GA device needs to be in active state. The absolute minimum is 75 ms and is needed for stable communication with the 6051. The default value is 75 ms.

pause_between_commands
    This is the time between two commands the drivers must wait. The exact values should be hand tuned. If the system does not respond or drops commands try to increase this value. Default is 200 ms.

pause_between_bytes
    This is the time the driver waits between 2 bytes in multi-byte commands. The hardware handshake does not work with all devices so this parameter was introduced to support it. The default is 2 ms.

number_ga
    This is the number of GA. This parameter does not have a real effect since the interface supports the addresses 1..256 only. Keep the default value 256 untouched.

number_gl
    Like the number of GA this number gives the maximum GL address. Since this number is limited to 80, keep the default value 80 untouched.

number_fb
    This is the number of 6088 modules attached to the 6051/6050 device. The valid range is from 0..31. The default value is 0 (no modules are attached). Please note that 6088 modules attached to other devices (memory) cannot be accessed.

Example
    <bus>
        <m605x>
            <number_ga>120</number_fb>
            <number_gl>60</number_fb>
            <number_fb>8</number_fb>
            <ga_min_activetime>150</ga_min_activetime>
            <pause_between_bytes>2</pause_between_bytes>
            <pause_between_commands>50</pause_between_commands>
        </m605x>
        <auto_power_on>no</auto_power_on>
        <verbosity>4</verbosity>
        <device>/dev/ttyS0</device>
    </bus>

  selectrix

Selectrix CC-2000 and Rautenhaus SLX852.

number_ga
    TODO

number_gl
    TODO

number_fb
    TODO

controller
    TODO

  zimo

This bus provides support for the old ASCII based Zimo MX1 interface protocol. The baud rate can not be changed and has an internal preset of 9600 Baud.

number_ga
    This value sets the maximum number for the GA address range. For protocol M (Maerklin/Motorola) the upper limit is 63, for protocol N (NMRA/DCC) the upper limit is 2044 (according to Lenz-DCC address scheme). The Z (Zimo) protocol is not supported yet. The default value is 256.

number_gl
    This value sets the maximum number for the GL address range. The default value is 80.

number_fb
    Not supported. The default value is 0.

fb_delay_time_0
    Not supported.

FILES
/etc/srcpd.conf

SEE ALSO
srcpd (8)

AUTHORS
This man page was written by Matthias Trute (mtrute@users.sourceforge.net), Frank Schmischke (schmischi@users.sourceforge.net) and Guido Scholz (gscholz@users.sourceforge.net).