BiDiB® stands for BiDirectional Bus for the digital control of a model train. The term BiDiB® itself refers to the protocol technology, which can be implemented on various physical connections, such as Ethernet, USB or the BiDiBus, which is particularly optimized for the needs of model railroaders and system wiring.
BiDiB is not a commercial product and not connected to any particularly hardware. It is a protocol definition which can be implemented by anyone including commercial manufacturers.
BiDiB started in 2010 and was developed by Wolfgang Kufer (opendcc.de). For more information BiDiB see bidib.org.
BiDiB features:
BiDiB for JMRI is currently beta stage - some functionality may be missing and there are surely a lot of bugs.
Currently JMRI has support for connection over USB, BiDiB over TCP and there is a BiDiB-Simulator which is configured by a XML file.
Open the Connections tab, select "BiDiB" from the System Manufacturer selection box and choose from the following setups. The system letter for BiDiB connections is "B".To create a new connection either the port name (e.g. ttyUSB0 on linux or COM1 on Windows) can be selected or the root node UID can be typed in directly. Since UIDs are worldwide unique and do never change for a given hardware, the appropriate port can be found automatically by scanning all usable ports. On Windows all ports COMx are scanned, on Linux and macOS a name filter may be used (default is "ttyUSB*"). When the connection is created by selecting a port from the list of available ports, the UID read from the device is displayed and stored - if the device is a BiDiB node. A checkbox (Autoscan) can be activated so that when JMRI starts again, the port can be found by scanning the available ports. Thus, if more than one BiDiB connection is used, the port naming of the USB device does not matter.
In this case the hardware is not directly connected to JMRI, but JMRI connects to a TCP server which in turn connects to the hardware. This may be usefull if another program is used as the main control program and JMRI is only used as a CV programmer (decoder pro). The parameters are the IP-Address and the port number of the server to which to connect to. The default port number is 62875.
A BiDiB simulator is provided. This connection type has a field for a XML file with the simulated configuration. The location for this file is the profile directory.
JMRI System Names generally consist of a system connection prefix Xn where X is the system connection letter and n is either empty or a number for multi-connections, followed by the type letter ("T" for turnout, "L" for lights, "S" for sensors and "R" for reporters (loco address feedback) and the system address.
For BiDiB the system connection letter is "B", the system address is a string with the BiDiB address.
The BiDiB address generally has the form:
node:address
A node on the BiDiBus is identified either by its worldwide unique identifier (UID) which is a 40 bit hexadecimal number or by a user name configured into the node (using BiDiBWizard). The hexadecimal UID must start with an "X", usernames must start with a letter (better not to start with "X") and must contain only other letters, numbers, underlines ("_") or dashes ("-"). This is a restriction of JMRI for BiDiB not for BiDiB itself. The node specification is case independent.
The node part of the address may be omitted (including the colon), in this case the interface (root node, i.e. the BiDiB node directly connected to JMRI) is used automatically.
The address on the node may be prefixed by a single letter address type and - for port addresses only - a single letter port type may follow. The number is required and the two letters are optional. If omitted, suitable defaults will be selected depending of the capabilities of the node: only a command station has DCC addresses, Turnouts are preferable accessories and Lights are preferable ports (digital pins of the device). So the general form of an address on a node is:
xny
where x is an optional address type, n the numeric address and y is the optional BiDiB port type.
The term "turnouts" in JMRI does not necessarily refer to actual turnouts, but rather to a general hardware I/O port that can have two states, on and off. In BiDiB, switches should not be controlled directly via the ports, but addressed as accessories. This selection is made using the address type letter.
List of address types:
Letter | Description | Default Type for |
---|---|---|
t | DCC accessory address ("track") | turnouts and sensors if node is a command station (CS). Illegal on non-CS nodes |
a | (non-DCC) accessory address | turnouts if node is not a command station and the node supports BiDiB accessories |
f | Feedback number | sensors if the node has BiDiB feedbacks. Reporters are only valid for nodes which support feedbacks, so always default |
p | port number | lights. For sensors if the node does not support feedbacks |
List of BiDiB port types:
Letter | Designation | Description |
---|---|---|
S | SWITCHPORT | Simple digital output. Either ON or OFF. |
L | LIGHTPORT | Control of a digital output with various functions like dimming, blinking, etc. Controlled by a state value (similar then aspects for signals) |
V | SERVOPORT | Control of a connected servo. Start- and end position are configured in the node as well as transition time. |
U | SOUNDPORT | not supported in JMRI for now |
M | MOTORPORT | not supported in JMRI for now |
A | ANALOGPORT | not supported in JMRI for now |
B | BACKLIGHTPORT | not supported in JMRI for now |
P | SWITCHPAIRPORT | not supported in JMRI for now |
I | INPUTPORT | Default for sensors. Invalid for others. |
Examples (the root node is assumed to be the command station and to have the UID 0d68001234 and "MyNode" is the user name):
System Name | Type | Address Part | resulting Node UID | resulting Address | Notes |
---|---|---|---|---|---|
BSX0d68001234:20 | Sensor | X0d68001234:20 | 0d68001234 | f20 - feedback 20 | BiDiB feedback 20 of (interface) node 0d68001234 |
BSMyNode:42 | Sensor | MyNode:42 | 0d68001234 | f42 - feedback 42 | BiDiB feedback 42 of (interface) node 0d68001234 named "MyNode" |
BT5 | Turnout | 5 | 0d68001234 | t5 - DCC address 5 | turnout at DCC address 5 of CS node (interface node) 0d68001234 |
BTN201:22 | Turnout | N201:22 | 0d68006789 | a22 - accessory address 22 | turnout at BiDiB accessory address 22 of non-CS node 0d68006789 named "N201" |
B1LLC6:8L | Light | LC6:8 | 0d68004321 | p8L - Port 8 | Light at output port 8 (type based address model) of node 0d68004321 named "LC6" on second BiDiB connection (B1) |
BLN201:15 | Light | N201:15 | 0d68006789 | p15L - port 15 | Light at output port 15 (flat address model) of node 0d68006789 named "N201", port has to be configured as LIGHT |
BSX0d68006789:3 | Sensor | 0d68006789:3 | 0d68006789 | p3I - port 3 | Sensor at input port 3 (flat address model) of node 0d68006789 (without feedbacks), port has to be configured as INPUT |
BR42 | Reporter | 42 | 0d68001234 | f42 - feedback 42 | Railcom-feedback on feedback number 42 of (interface) node 0d68001234 |
BiDiB accessories are the equivalent of turnouts. Both signal lamps and actual turnout (track switches) may refer to JMRI turnouts. However, signals should be operated by "signal masts" (see below)
BiDiB ports support either a flat addressing model or a type based addressing model. The address model is determined by the firmware of the node. In the flat addressing model all available ports are simply numbered from 0 to the number of ports minus 1. Each port must be configured in the node (e.g. by using the BiDiBWizard) as one of the port types mentioned above which is supported by the hardware itself. In this case the port type letter in the JMRI system address is not neccessary since the type is read from the node.
If the node uses the type based addressing model, port types are hardcoded into the firmware and cannot be changed. Each port type has its own address range starting from 0 up to the number of ports for this type minus 1. In this case the port type is part of the port address and the port type letter is required in the BiDiB address. See the examples above.
When JMRI is connected to a layout via this system, an BiDiB menu is shown:
The BiDiBWizard is an external tool - also written in Java and uses the same underlying BiDiB-library (jbidibc - written by Andreas Kuhtz).
This tool is used to configure all node parameters, e.g. node user name, the port configurations and many other parameters. Therefore no other configuration tool is integrated into JMRI. The BiDiBWizard can be connected to the BiDiB over TCP server mentioned above.
BiDiB home page: english or german
BiDiBWizard: unfortunately currently in german only.
The developers of BiDiB sell modules in the Fichtelbahn shop (german only).
There are some other manufacturers - see www.bidib.org/vendors_e.html