Skip to content

Commit 26dd7f8

Browse files
authored
Merge pull request #1231 from flash62au/sphinx
copy some useful pages from the new site to the old
2 parents 451f8ff + 100a126 commit 26dd7f8

4 files changed

Lines changed: 460 additions & 3 deletions

File tree

docs/reference/glossary.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ Glossary
6363
- A proprietary protocol developed by Brett Hoffman
6464
* - WiThrottle Server
6565
- A piece of software that listens and acts on WiThrottle commands |BR| |EX-CS| contains a WiThrottle Server, as does |JMRI|
66-
* - roster
67-
-
66+
* - Roster
67+
- A roster is a list of locomotives that are known in advance by the command station so that DCC addresses, name, and functions can be used by throttles to configure buttons etc.
6868
* - VPIN
6969
- A VPIN is an Arduino pin number that has been extended to include pins on external devices or expanders. Once the mapping of VPIN numbers to devices has been done, the commands that set or test pins do not have to care how the electronics works.
7070

7171
.. [1] Term primariarly used in North American railroading.
72-
.. [2] Term used in most of the rest of the English speaking world. (British origin)
72+
.. [2] Term used in most of the English speaking world other than North America. (British/United Kingdom origin)
Lines changed: 269 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,269 @@
1+
.. include:: /include/include.rst
2+
.. include:: /include/include-l2.rst
3+
.. include:: /include/include-reference.rst
4+
|EX-REF-LOGO|
5+
6+
***************************
7+
Advanced config.h settings
8+
***************************
9+
10+
|SUITABLE| |tinkerer| |engineer| |support-button|
11+
12+
.. sidebar::
13+
:class: sidebar-on-this-page
14+
15+
.. contents:: On this page
16+
:depth: 3
17+
:local:
18+
19+
**Advanced config.h settings for Command Station builds**
20+
21+
The basic Motor Shield, WiFi and Ethernet settings are covered in detail in :doc:`/reference/software/basic-config-h`
22+
23+
The following additional settings are for special cases and are not normally created automatically by the EX-Installer.
24+
25+
These options should be coded in the file `config.h` which will be automatically included in the compilation process.
26+
27+
Non-standard Motor Shields
28+
--------------------------
29+
30+
See also: :ref:`Motor Shield basic config.h <basic-config-h-motor-shield>`
31+
32+
Further pre-defined shield names can be found in the code file MotorDrivers.h although their presence there does not necessarily mean that we can provide support for issues.
33+
34+
In extreme cases, it is possible to craft your own definition
35+
for example:
36+
37+
.. code-block:: cpp
38+
39+
#define MY_SHIELD F("MINE"), \
40+
new MotorDriver( 3, 12, UNUSED_PIN, 9, A0, 5.08, 3000, A4), \
41+
new MotorDriver(11, 13, UNUSED_PIN, 8, A1, 5.08, 1500, A5)
42+
#define MOTOR_SHIELD_TYPE MY_SHIELD
43+
44+
45+
refer to MotorDrivers.h for details of parameter meanings. Do NOT attempt to alter MotorDrivers.h or you will face versioning difficulties.
46+
47+
NOTE: Before connecting these boards and selecting one in this software check the quick install guides! Some of these boards require a voltage generating resistor on the current sense pin of the device. Failure to select the correct resistor could damage the sense pin on your Arduino or destroy the device.
48+
49+
Motor shield max current
50+
^^^^^^^^^^^^^^^^^^^^^^^^^
51+
52+
If you want to restrict the maximum current LOWER than what your motor shield can provide, you can do that here. For example if you have a motor shield that can provide 5A and your power supply can only provide 2.5A then you should restrict the maximum current to 2.25A (90% of 2.5A) so that DCC-EX shuts off the track before your PS does shut DCC-EX. MAX_CURRENT is in mA so for this example it would be 2250, adjust the number according to your PS. If your PS has a higher rating than your motor shield you do not need this. You can use this as well if you are cautious and your trains do not need full current.
53+
54+
55+
.. code-block:: cpp
56+
57+
#define MAX_CURRENT 2250
58+
59+
TCP/IP Advanced settings
60+
-------------------------
61+
62+
- Control of IP port (default 2560). We cant think of any reason why this would ever need to be changed.
63+
64+
65+
.. code-block:: cpp
66+
67+
#define IP_PORT 2560
68+
69+
- DONT_TOUCH_WIFI_CONF means WIFI config will be done with the `<+>` commands and this sketch will not change anything over AT commands and the other WIFI_* defines do not have any effect.
70+
71+
72+
.. code-block:: cpp
73+
74+
#define ENABLE_WIFI true
75+
#define DONT_TOUCH_WIFI_CONF
76+
77+
- WIFI_HOSTNAME: The default is "dccex" but you can change this if you have more than one CS on you home router to make them show up with different names on the network. Host names starting with "dccex" are more readily found by WiFi throttles.
78+
79+
80+
.. code-block:: cpp
81+
82+
#define WIFI_HOSTNAME "dccex-csb1"
83+
84+
- Ethernet IP_ADDRESS can be set but it is preferable to omit this and have the router assign an address using DHCP.
85+
86+
87+
.. code-block:: cpp
88+
89+
#define IP_ADDRESS { 192, 168, 1, 200 }
90+
91+
- MAX_NUM_TCP_CLIENTS: If you on STM32 Ethernet (and only there) want more than 9 [1]_ TCP clients, change this number to for example 20 here **AND** in STM32lwiopts.h and follow the instructions in STM32lwiopts.h
92+
93+
.. [1] It would be 10 if there was not be a bug in LwIP by STM32duino.
94+
95+
96+
.. code-block:: cpp
97+
98+
#define MAX_NUM_TCP_CLIENTS 20
99+
100+
LCD/OLED support
101+
-----------------
102+
103+
See also: :ref:`LCD/OLED basic config.h <basic-config-h-lcd-oled-support>`
104+
105+
In order to avoid wasting memory the current scroll buffer is limited to 8 lines. Some users wishing to display additional information such as TrackManager power states have requested additional rows aware of the warning that this will take extra RAM. if you wish to include additional rows
106+
107+
108+
.. code-block:: cpp
109+
110+
#define MAX_CHARACTER_ROWS 12
111+
112+
Disable EEPROM
113+
----------------
114+
115+
The EEPROM feature is only there for backward support of deprecated methods of turnout, sensor and output creation inherited from DCC++. You are advised to turn this off to save memory.
116+
117+
118+
.. code-block:: cpp
119+
120+
#define DISABLE_EEPROM
121+
122+
Disable PROG
123+
----------------
124+
125+
If you do not need programming capability, you can disable all program track related commands. You might want to do that if you are building a command station that drives multiple tracks and you do not have a spare track output for programming.
126+
127+
128+
.. code-block:: cpp
129+
130+
#define DISABLE_PROG
131+
132+
Redefine DCC boundary between SHORT and LONG loco addresses
133+
------------------------------------------------------------
134+
135+
According to NMRA the last short address is 127 and the first long address is 128. There are manufacturers which have another view. Lenz CS, for example, have considered addresses long from 100. If you want to change to that mode, do:
136+
137+
138+
.. code-block:: cpp
139+
140+
#define HIGHEST_SHORT_ADDR 99
141+
142+
If you want to run all your locos addressed long format, you could even do
143+
144+
.. code-block:: cpp
145+
146+
#define HIGHEST_SHORT_ADDR 0
147+
148+
DCC-EX does not support using the same address, for example 100(long) and 100(short) at the same time, therefore there must be a border.
149+
150+
Redefine locomotive state table size
151+
-------------------------------------
152+
153+
This is the maximum number of locos that can be controlled at the same time. This defaults to 50 (8 on a UNO/NANO). If you have enough free memory you can increase this to a maximum of 255. If you are short of memory (typically a Mega with WiFi and lots of accessories) you can decrease it to a minimum of 2.
154+
155+
156+
.. code-block:: cpp
157+
158+
#define MAX_LOCOS 100
159+
160+
Define TURNOUTS and ACCESSORIES to follow norm RCN-213
161+
-------------------------------------------------------
162+
163+
According to norm RCN-213 a DCC packet with a 1 is closed-straight and one with a 0 is thrown-diverging. In DCC++ Classic, and in previous versions of DCC++EX, a turnout throw command was implemented in the packet as '1' and a close command as '0'. The #define below makes the states match with the norm. But we don't want to cause havoc on existent layouts, so we define this only for new installations. If you don't want this, don't add it to your config.h.
164+
165+
.. code-block:: cpp
166+
167+
#define DCC_TURNOUTS_RCN_213
168+
169+
By default, the driver which defines a DCC accessory decoder does send out the same state change on the DCC packet as it receives. This means a VPIN state=1 sends D=1 (close turnout or signal green) in the DCC packet. This can be reversed if necessary.
170+
171+
.. code-block:: cpp
172+
173+
#define HAL_ACCESSORY_COMMAND_REVERSE
174+
175+
If you have issues with that the direction of the accessory commands is reversed (for example when converting from another CS to DCC-EX) then you can use this to reverse the sense of all accessory commands sent over DCC-EX. This #define likewise inverts the behaviour of the `<a>` command for triggering DCC Accessory Decoders, so that `<a addr subaddr 0>` generates a DCC packet with D=1 (close turnout) and `<a addr subaddr 1>` generates D=0 (throw turnout).
176+
177+
.. code-block:: cpp
178+
179+
#define DCC_ACCESSORY_COMMAND_REVERSE
180+
181+
Handling multiple serial throttles
182+
-----------------------------------
183+
184+
The command station always operates with the default Serial port. Diagnostics are only emitted on the default serial port and not broadcast. Other serial throttles may be added to the Serial1...Serial6 ports which may or may not exist on your CPU (Mega has 3, CSB1 has 1, and STM32 have up to 6.). To monitor a throttle on one or more serial ports, supply a #define for each serial port required.
185+
186+
**NOTE: DO NOT define here the WiFi shield serial port or your Wifi will not work.**
187+
188+
.. code-block:: cpp
189+
190+
// SERIAL1 in use by Wifi
191+
#define SERIAL2_COMMANDS
192+
#define SERIAL3_COMMANDS
193+
#define SERIAL4_COMMANDS
194+
#define SERIAL5_COMMANDS
195+
#define SERIAL6_COMMANDS
196+
197+
Bluetooth serial ON ESP32
198+
-------------------------
199+
200+
On ESP32 you have the possibility to use the builtin BT serial to connect to the CS.
201+
202+
The CS shows up as a pairable BT Classic device. Name is "DCCEX-hexnumber". BT is as an additional serial port, debug messages are still sent over USB, not BT serial.
203+
204+
If you enable this there are some implications:
205+
206+
1. WiFi will sleep more (as WiFi and BT share the radio). So WiFi performance may suffer
207+
2. The app will be bigger that 1.2MB, so the default partition scheme will not work any more. You need to choose a partition scheme with 2MB (or bigger). For example "NO OTA (2MB APP, 2MB SPIFFS)" in the Arduino IDE.
208+
3. There is no securuity (PIN) implemented. Everyone in radio range can pair with your CS.
209+
210+
.. code-block:: cpp
211+
212+
#define SERIAL_BT_COMMANDS
213+
214+
Booster input pin on ESP32 CS
215+
-----------------------------
216+
217+
On ESP32 you have the possibility to define a pin as booster input
218+
219+
Arduino pin D2 is GPIO 26 is Booster Input on ESPDuino-32
220+
221+
.. code-block:: cpp
222+
223+
#define BOOSTER_INPUT 26
224+
225+
GPIO 32 is Booster Input on EX-CSB1
226+
227+
.. code-block:: cpp
228+
229+
#define BOOSTER_INPUT 32
230+
231+
## ESP32 LED Wifi Indicator
232+
233+
GPIO 2 on ESPDuino-32
234+
235+
.. code-block:: cpp
236+
237+
#define WIFI_LED 2
238+
239+
GPIO 33 on EX-CSB1
240+
241+
.. code-block:: cpp
242+
243+
#define WIFI_LED 33
244+
245+
SABERTOOTH
246+
----------
247+
248+
This is a very special option and only useful if you happen to have a Sabertooth motor controller from Dimension Engineering configured to take commands from and ESP32 via serial at 9600 baud from GPIO17 (TX) and GPIO16 (RX, currently unused).
249+
250+
The number defined is the DCC address for which speed controls are sent to the sabertooth controller _as_well_. Default: Undefined.
251+
252+
253+
.. code-block:: cpp
254+
255+
#define SABERTOOTH 1
256+
257+
Tuning for deprecated UNO/NANO
258+
------------------------------
259+
260+
By default VDPY and DIAGs are disabled on a Uno/Nano to reduce PROGMEM and RAM requirements.
261+
262+
They can be re-enabled if you have space by the commands below.
263+
It is also possible to save RAM using the MAX_LOCOS setting less than the default 8.
264+
265+
.. code-block:: cpp
266+
267+
#define ENABLE_VDPY
268+
#define ENABLE_DIAG
269+
#define MAX_LOCOS 4

0 commit comments

Comments
 (0)