srcpd.conf (5) - Linux Manuals
srcpd.conf: The configuration file for the srcpd deamon
NAME
srcpd.conf - The configuration file for the srcpd deamon
DESCRIPTION
The file /etc/srcpd.conf is used by the srcpd (8). This file contains the runtime configuration for the deamon and it's connection(s) to model railroad system. See srcpdDEFAULT 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>nobody</username> <groupname>nogroup</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 there are errors during configuration file reading the daemon will send appropriate notifications to the syslog daemon. These messages can be watched using with 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 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 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 nobody.
- groupname
- srcpd runs under this group. Default is nogroup.
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/DC-Car_PC_Sender.htm
- mode
- This option specifies whether DC-Car or Infracar decoders are controled. 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:
In order to increase the realtime priority for this user the system
file
/etc/security/limits.conf
must be edited to add following line:
According to these measures the configuration file must be adapted as
follows:
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
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.
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.
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.
Inside of the configuration the common values should be arranged before
the bus specific values.
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.
Bus driver for i2c-dev interface of the Linux kernel, can be used to
access hardware found on http://www.matronix.de/.
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.
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 an other
speed. Possible values are 9600 baud, 19200 baud, 38400 baud,
57600 baud and 115200 baud, depending on your interface.
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.
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/).
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.
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.
Selectrix CC-2000 and Rautenhaus SLX852.
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.
$
$
...
<username>srcpd</username>
<groupname>srcpd</groupname>
...
<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>
<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
dmesg | grep parport
<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
<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
intellibox
<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
loconet
<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
<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
<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
zimo
FILES
/etc/srcpd.conf
AUTHORS
This man page was written by
Matthias Trute (mtrute [at] users.sourceforge.net),
Frank Schimschke (schmischi [at] users.sourceforge.net) and
Guido Scholz (gscholz [at] users.sourceforge.net).