With CTC Version 5, RGB LEDs (LED Bus, WS2812) are introduced to CTC. Our new CTC-Multi-IO-Board-4 can control up to 250 LEDs individually at one connection and not only on/off but also brightness and color. Suitable signal lights are available simultaneously from Schneider Modellbahnzubehör .
In addition to RGB-LED support, CTC 5 offers a variety of other new features and improvements:
- DCC-Sniffer allows switching of production connected to CTC modules via a digital command station
- Support for ESU CabControl rotary encoders in the CTC-Android app – finally providing a handheld controller with direct CTC support
- Increased stability and robustness with unstable WiFi connections
- Random numbers and arithmetic operations in scripts, among other things to enable lighting effects with the new RGB LEDs
- Complete configuration dialogs for Android and soon also for iOS
- CTC app base technology updated to Java 25 and dependency on Python removed
Migration
With the CTC modules, the file system was changed from SPIFFS to LittleFS. This requires a migration, see Operating Manual Appendix A5 .
In addition, NFC beacons have been aligned with IR beacons: They are now stored in the module config instead of the automation as before. The move happens automatically when uploading the track plan in the track plan editor.
Stability CTC Modules
Especially with unstable WiFi, there were repeated issues with corrupted config files when the WiFi connection dropped during upload. CTC 5.x solves this problem as follows:
- The HTTP server of the CTC module writes a temporary file during upload and only deletes the old file once the new one has been fully received.
- Switching the file system from SPIFFS to LittleFS: LittleFS does not corrupt the file system even if power is lost during writing. LittleFS can also reinitialize the file system itself in case of a defect.
- Switching the HTTP server from ESPAsyncWebServer to esp_http_server. The latter is supposed to be significantly more stable.
- Edit function removed from the HTTP server as it corrupted large files (insufficient RAM).
- Clicking "download" explicitly downloads the corresponding file (no preview)
- CTC module starts even if config files are missing (after file system defect)
Sync Optimization:
- PIRailComm: Message slot increased to 2 ms
- More tuning parameters will be offered with one of the next app versions
- Support for CTC 2.x removed
- UdpConnection starts a new thread for packet processing
- States of NFC beacons are cyclically integrated into the sync block instead of additional packets per sync
- Bug fix sync: msInterval had no tolerance, which could lead to duplicate sends from the CTC modules
- An option to reduce sync to multiple shorter blocks had to be temporarily disabled due to a bug in old firmware (ignores first and last of the block)
Optimization regarding heat development:
- Short (breathing) pause of 2 ms at the end of the main loop
- Test-wise re-removed WiFi.setSleep(false) for locos
NFC Beacons
NFC beacons are now stored in the config (instead of automation) like IR beacons. This prevents issues when changing the state if more than one CTC app is active.
The track plan editor automatically changes NFC beacons from TrackMsg in trackCfg.xml to EnumAction in cfg.xml
In the config dialog, newly read NFC beacons are displayed with "Add product".
Scripts
The capabilities of scripts have been greatly expanded:
- Generation of random numbers
- Random call of a state script of a function (EnumAction)
- Arithmetic operations when setting numeric values
- Adopting the value (number or letter) of a parameter
- Adopting the state (number or letter) of another action
- Adopting the current (last set) value of an OutPin
- "Delay" command removed; instead, a timer can be used
- If command extended with "else if" and "else"
- EnumAction now has default for int value (defInt)
- New data type rgbValue for colors
- R, G, B components of colors can be set individually
- Consistent use of tgt/tgtI at the beginning of setValue and setting cur/curI only on successful execution (script) in setValue
- Bug fix: Self-call of timer did not work
- SetIO can now set a new value relative to the last set value
- Parameter list extended to include rgbValue
The corresponding parts of the "Change config" dialog have been updated accordingly:
- Support for editing scripts with selection lists significantly improved
- UI and usability revised: value, intValue are appropriately hidden; operation as separate selection
- Display of RGB color as background in parameters and value fields
- Color picker dialog
- Live adjustment of the color of RGB LEDs connected to the LED bus
The new Chapter 11 of the operating manual provides detailed instructions on creating scripts.
LED Bus
Up to 250 RGB LEDs (WS2812) can be connected to the LED bus. Suitable signal lights are available from Schneider Modellbahnzubehör .
New functionality (configuration):
- Direct insertion at the end of the LED bus when "Add product"
- Buttons to change the order of connected products (ports) on the LED bus
- Deleting LED config also deletes port in ExtCfg; unconnected ports in ExtCfg "LedBus" can be deleted
- Display of LED color in the parameter (ValueType "rgbVal")
- NEW: Editor for parameters with ValueType "rgbVal" including live adjustment of the LED
- Test button switches on all LEDs of an LED bus port (product)
- The Ports and Pins table shows the number of defined pins under a port (LED bus)
- LEDBus has only one ExtCfg, which is composed of PortCfgs (LED arrays), whose size is the number of OutPins on the connected port
Track Plan
The track plan can have a background image, e.g. a house, to place light switches on windows
Track plan changes:
- Button to select background image and display and upload
- Labels for row/column were swapped
WiFi Connection via Beacon
- NDEF library added and made operational
- Loko_G extended with tempWifi
Firmware Base
- Switching the file system from SPIFFS to LittleFS and the HTTP server from ESPAsyncWebServer to esp_http_server (see Stability section)
- Status display alternatively via RGB LED (color) instead of blink codes
- NEW: Library for IO module DRV89xx
- Initialization now two-stage: First initialize all actions and in a second loop set defaults – the order of actions in the config no longer has an impact on initialization
- SetIO no longer aborts a script if outCfg or pinCfg is not found
- Bug fix: ItemConn.getIntVal ignored "defaultValue"
- doSendMsg extended with parameter msgLen: If it is > 0, the message is only sent if the serial buffer has enough space (ESP32 UART 128 bytes)
UI Improvements
Config dialogs:
- Tree "Pins, Ports and Extensions" is now on the right side, not left
- Complete redesign of script editing – see Scripts section
- The display of the new NFC beacon now shows the PosID of the beacon for the product and the beacon (EnumAction)
- Suffix "-conn" removed when displaying products (ItemConn)
- Display of device heap in EditSwitchBox
Module list:
- Colored display of FW version and status
- NEW in RailDevice: deviceState and stateColor
- Module list shows deviceState with Background stateColor
- RailDevice sets deviceState for config load success/error
- NEW: Retry for TrackCfg on loadError; displayed in deviceState
- UpdateFirmware shows progress and success/error in deviceState
Icons: New icons for SBB-5er signal
Other:
- Status bar shows who is sync master
- Dialog Statistics extended with "dB" column
- NEW: Firmware is highlighted in color if outdated: orange=CTC4, yellow=older than FW in CTC app
- Config backup now saves all files from the CTC module (except netCfg.xml and temp. WiFi)
- New function Restore Config: Loads all files from a config backup folder to a CTC module
- Memory optimization: Significantly less memory is used during processing of state messages
Bug Fixes CTC-App UI
- Tree displays were not always updated on changes
- Multiple crashes when uploading in the track plan editor (endless hourglass)
- MessageBox, InputDialog and PasswordDialog were barely readable in dark mode: Fixed color replaced with appropriate style
Bug Fixes CTC-App
- Exception in WiFiManagerLinux when WiFi was off (empty result)
- StatusBar: ID of the label for wifi_name was broken
- Exception in error message in "Replace IO-Config" if firmware/version is null
- (IO-)Config replace: Internal folders (standard, ...) were not displayed
Product Catalogs
- NEW: Product catalog schneider-signal.xml
- Adjustment of the convention for signals: Stop is at position 0 and Clear at position 1
- Bug fix: For signals, part right/left was swapped
- universell-licht.xml extended with "Haus-RGB-LED-8" and LED strip 60
- Adjustment and extension of signal XMLs from schneider viesmann and universell, all for the LED bus
XML Structures (pi-rail.xsd)
- Adjusted config so that products can also contain an ExtCfg
- Port can now also contain inPin and outPin
- TrackMsg removed from XML schema and backward compatibility code added to CTC-App
- NEW: ValueType "rgbVal"
- Enum "valueType" extended by "rgbVal"
- ifCmd extended by attribute "varID"
- Scripts extended by "else"
- NEW: Pin arrays: outPin extended by size (array), and setIO extended by i (index) for
- NEW: Attribute "BSSID" in WifiCfg
- New inModeType "DCC" and attribute "DCC" on stateScript for DCC-Sniffer
Internationalization
Fixed various translation gaps in the app:
- Adjusted messages (messages.properties)
- Removed texts for Script-Add and Script-Remove (are buttons in Android)
- Corrected umlauts ü, ö, ä after switching to ISO-8859-1 for all language files (properties)
Config Dialogs Android and iOS
Android:
- Config dialogs updated to desktop version
- Portrait layout (phone) made usable
- NEW: ListViewNonScroll for lists that are exactly as large as their content
- EditCfg: Layout stretched (scrollbar on the outside)
- Configurator: Fixed pen button (was hidden in layout)
iOS:
- Updated to CTC 5
- backgroundBinding (background color) not working
- Images in tables not working (WiFi and loco icons)
- Expansion to match Android version in progress
DCC-Sniffer
On the new IO-Board-4, the DCC signal of a digital command station can be read at the sensor input. This allows activating CTC module functions from the digital command station.
- universal-sensors.xml extended by DCC-Sniffer
- Edit config extended by DCC address and status (on the state script)