A model railway signalling system written in Python for the Raspberry Pi. Can be used with the Pi-SPROG command station for full DCC control of points and signals. Also supports train detection via the GPIO ports.
GPL-2.0 License
A DCC model railway signalling application written in Python, enabling automated and interlocked layout signalling schemes to be designed and configured via the UI without the need to write any code. The application is primarily intended for the Raspberry Pi, but will also run on other platforms (albeit without some of the Raspberry-Pi specific interfacing functions).
Configured / pre-installed systems are now available to purchase from: https://www.model-railway-signalling.co.uk/ The website also included a number of user guides that can be downloaded (in PDF format).
My youTube channel also has a number of videos demonstrating the use of the application: https://www.youtube.com/@DCCModelRailwaySignalling
Bug reports and feedback is welcome and appreciated:
email: [email protected] (if reporting bugs then please attach the sig file, application logs and any relevant screenshots)
For a first time installation use:
When installing the application on later versions of python you may get the following error:
To overcome this, remove the 'EXTERNALLY-MANAGED' file from the default python installation and then re-attempt the install (as above). Note that this is the file location for the Raspberry Pi python 3.11 installation. Other platforms may use a different location for this file:
To upgrade to the latest version use:
To remove the application:
To install a specific version of the application the application:
The application has minimum external dependencies (over and above the 'standard' python installation), 'pyserial' and 'paho-mqtt', both of which should automatically get installed with the application. If for some reason this doesn't happen (I've been made aware of one instance on a Windows platform) then these packages can be installed seperately (prior to installing the model-railway-signals package):
If you want to use Block Instruments with full sound enabled (bell rings and telegraph key sounds) then you will also need to install the 'simpleaudio' package. If 'simpleaudio' is not installed then the application will still function correctly (just without sound).
If you are running on a later version of Python you may need to install libasound2 before the simpleaudio pip install will work.
Note that for Windows, the 'simpleaudio' it has a dependency on Microsoft Visual C++ 14.0 or greater (so you will need to ensure Visual Studio 2015 is installed first).
The python package should be run as a module (note underscores):
If required, a layout schematic can be loaded at startup:
If required, the logging level can be specified at startup (ERROR, WARNING, INFO or DEBUG)
Application documentation, can be found in the 'user_guide' folder: https://github.com/johnrm174/model-railway-signalling/tree/main/user_guide
Some example layout configuration files can be found in the 'configuration_examples' folder: https://github.com/johnrm174/model-railway-signalling/tree/main/configuration_examples
My youTube channel also has a number of videos demonstrating the use of the application: https://www.youtube.com/@DCCModelRailwaySignalling
And finally, a top tip for running the application on the latest Debian Bookworm release which uses Wayland as the GUI backend rather than X11 (which was the backend for previous Debian releases). I found that with Wayland, the Tkinter GUI performance was terrible for some reason (not just my application - python/Tkinter performance in general) - and that was running on a Raspberry Pi 5 which I would have expected to improve overall performance. Anyway, I found that the fix is to switch the GUI backend of the Raspberry Pi back to X11 - performance of the user interface is now lightning quick!
To change the backend - Run "sudo raspi-config", select 'Advanced Options' then 'Wayland' and select X11.
An additional benifit was that some of the other applications I use (such as the kazam video capture software) will now work as normal on the Raspberry Pi 5.