{"id":15290599,"url":"https://github.com/johnrm174/model-railway-signalling","last_synced_at":"2025-04-13T09:32:26.347Z","repository":{"id":43584313,"uuid":"323939300","full_name":"johnrm174/model-railway-signalling","owner":"johnrm174","description":"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.","archived":false,"fork":false,"pushed_at":"2024-10-25T08:36:49.000Z","size":33626,"stargazers_count":13,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-10-25T11:03:42.142Z","etag":null,"topics":["colour-light-signals","dcc","dcc-control","dcc-signalling","dcc-signals","layout-control","model-railway","model-railway-signalling","pi-sprog","python","raspberry-pi","semaphore-signals","signalling","sprog","track-occupancy","track-sensors","train-tracking"],"latest_commit_sha":null,"homepage":"https://www.model-railway-signalling.co.uk/product/dcc-signalling-system/","language":"Standard ML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/johnrm174.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-12-23T15:37:20.000Z","updated_at":"2024-10-19T13:43:16.000Z","dependencies_parsed_at":"2023-11-24T13:45:12.899Z","dependency_job_id":"1d11ae5d-5344-46d3-a680-46df24ebc19d","html_url":"https://github.com/johnrm174/model-railway-signalling","commit_stats":{"total_commits":414,"total_committers":2,"mean_commits":207.0,"dds":"0.12077294685990336","last_synced_commit":"f5cf0765664db4ea12678dd84d98bb5a8385ae1e"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnrm174%2Fmodel-railway-signalling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnrm174%2Fmodel-railway-signalling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnrm174%2Fmodel-railway-signalling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/johnrm174%2Fmodel-railway-signalling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/johnrm174","download_url":"https://codeload.github.com/johnrm174/model-railway-signalling/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223517714,"owners_count":17158677,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colour-light-signals","dcc","dcc-control","dcc-signalling","dcc-signals","layout-control","model-railway","model-railway-signalling","pi-sprog","python","raspberry-pi","semaphore-signals","signalling","sprog","track-occupancy","track-sensors","train-tracking"],"created_at":"2024-09-30T16:08:44.369Z","updated_at":"2024-11-07T20:02:53.246Z","avatar_url":"https://github.com/johnrm174.png","language":"Standard ML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# model-railway-signalling\n\nA DCC model railway signalling application written in Python, enabling automated and interlocked layout \nsignalling schemes to be designed and configured via the UI without the need to write any code. The\napplication is primarily intended for the Raspberry Pi, but will also run on other platforms (albeit \nwithout some of the Raspberry-Pi specific interfacing functions). \n\n* Enables layout schematics to be created with signals, points, track sections and block instruments.\n* Supports most types of UK colour light signals, semaphore signals, and ground signals.\n* Interfaces with the Pi-SPROG DCC command station to drive the signals and points out on the layout.\n* Uses the Raspberry Pi GPIO inputs to provide train detection in support of signalling automation.\n* Incorporates MQTT networking to allow multiple signalling applications to be linked for larger layouts.\n* Provides a [Public API](https://github.com/johnrm174/model-railway-signalling/blob/main/PUBLIC_API.md) \nto support custom layout control interfaces.\n\n![Example Screenshot](https://github.com/johnrm174/model-railway-signalling/blob/main/README_screenshot2.png)\n\nConfigured / pre-installed systems are now available to purchase from:\n[https://www.model-railway-signalling.co.uk/](https://www.model-railway-signalling.co.uk/)\nThe website also included a number of user guides that can be downloaded (in PDF format).\n\nMy youTube channel also has a number of videos demonstrating the use of the application:\n[https://www.youtube.com/@DCCModelRailwaySignalling](https://www.youtube.com/@DCCModelRailwaySignalling)\n\n## What's new for Release 4.8.0:\n\n* Improved object creation - when you click a button to add a new object to the schematic, the object\nnow moves with the cursor until 'placed' on the canvas in the desired position (by left mouse click).\nUseful for working on layout schematics larger than the displayed window scroll area.\n* Improved copy function - The new objects now appear on the schematic as soon as you have copied them.\nThey then track the cursor until 'placed' on the canvas in the desired position (by left mouse click).\nUseful for working on 'busy' layout schematics where the copied items would have overlayed other objects.\n* Other minor improvements to the schematic editor in terms of cursor styles during object moves and area\nselections (Edit Mode), and scrolling of the displayed canvas area via the mouse/touchscreen (Run Mode).\n* New DCC Accessory switches feature, enabling you to add and configure buttons on the schematic to \ncontrol other DCC-enabled accessories on your layout (e.g. If you are still analogue for control of trains,\nthen you can use this feature with external DCC-relay modules for operating track isolating sections).\n* Improved Route Feature - DCC switches can be added to the route configuration to operate DCC accessories\nneeded to complete the route setup (level crossings, track isolating sections etc). \n* The font, font size, font colour (black, white or auto) and font style can now be specified for Route\nButtons (these options can also be applied to text boxes and DCC Switches)\n* The canvas (background) colour and grid colour can now be changed and the grid hidden in edit mode\n* Bugfix to colour chooser - Previous colour will now be retained if cancelled (without errors)\n* Bugfix to object selection (shift-left-click) - will now no longer error if cursor is not over an object\n\n![Example Screenshot2](https://github.com/johnrm174/model-railway-signalling/blob/main/README_screenshot1.png)\n\nBug reports and feedback is welcome and appreciated:\n* What aspects are intuitive? What aspects aren't?\n* What aspects do you particularly like?\n* What aspects particularly irritate you?\n* What new features would you like to see?\n\nemail: enquiries@model-railway-signalling.co.uk\n(if reporting bugs then please attach the sig file, application logs and any relevant screenshots)\n\n## Installing the application\n\nFor a first time installation use:\n\u003cpre\u003e\n$ pip install model-railway-signals             \u003c== This should work for most python installations\nor\n$ python -m pip install model-railway-signals   \u003c== If the command line version of pip is not installed/enabled\nor\n$ python3 -m pip install model-railway-signals  \u003c== If you have multiple major versions of python installed\n\u003c/pre\u003e\nWhen installing the application on later versions of python you may get the following error:\n\u003cpre\u003e\nerror: externally-managed-environment\n\u003c/pre\u003e\nTo overcome this, add the '--break-system-packages' argument to the command - e.g.\n\u003cpre\u003e\n$ pip install --break-system-packages model-railway-signals \n\u003c/pre\u003e\n\u003cpre\u003e\n$ sudo mv /usr/lib/python3.11/EXTERNALLY-MANAGED /usr/lib/python3.11/EXTERNALLY-MANAGED.old\n\u003c/pre\u003e\nTo upgrade to the latest version use:\n\u003cpre\u003e\n$ pip install --upgrade model-railway-signals            \u003c== This should work for most python installations\nor\n$ python -m pip install --upgrade model-railway-signals  \u003c== If the command line version of pip is not installed/enabled\nor\n$ python3 -m pip install --upgrade model-railway-signals \u003c== If you have multiple major versions of python installed\n\u003c/pre\u003e\nTo remove the application:\n\u003cpre\u003e\n$ pip uninstall model-railway-signals                    \u003c== This should work for most python installations\nor\n$ python -m pip uninstall model-railway-signals          \u003c== If the command line version of pip is not installed/enabled\nor\n$ python3 -m pip uninstall model-railway-signals         \u003c== If you have multiple major versions of python installed\n\u003c/pre\u003e\nTo install a specific version of the application the application:\n\u003cpre\u003e\n$ pip install model-railway-signals==4.5.0               \u003c== This should work for most python installations\nor\n$ python -m pip install model-railway-signals==4.5.0     \u003c== If the command line version of pip is not installed/enabled\nor\n$ python3 -m pip install model-railway-signals==4.5.0    \u003c== If you have multiple major versions of python installed\n\u003c/pre\u003e\nThe application has minimum external dependencies (over and above the 'standard' python installation),\n'pyserial' and 'paho-mqtt', both of which should automatically get installed with the application.\nIf for some reason this doesn't happen (I've been made aware of one instance on a Windows platform) then\nthese packages can be installed seperately (prior to installing the model-railway-signals package):\n\u003cpre\u003e\n$ pip install paho-mqtt\n$ pip install pyserial\n\u003c/pre\u003e\nIf you want to use Block Instruments with full sound enabled (bell rings and telegraph key sounds)\nthen you will also need to install the 'simpleaudio' package. If 'simpleaudio' is not installed then \nthe application will still function correctly (just without sound).\n\u003cpre\u003e\n$ pip install simpleaudio\n\u003c/pre\u003e\nIf you are running on a later version of Python you may need to install libasound2 before the simpleaudio pip install will work.\n\u003cpre\u003e\n$ sudo apt-get install libasound2-dev\n\u003c/pre\u003e\nNote that for Windows, the 'simpleaudio' it has a dependency  on Microsoft Visual C++ 14.0 or greater \n(so you will need to ensure Visual Studio 2015 is installed first).\n\n\n## Running the application\n\nThe python package should be run as a module (note underscores):\n\u003cpre\u003e\n$ python -m model_railway_signals  \u003c== This should work for most python installations\nor\n$ python3 -m model_railway_signals \u003c== If you have multiple major versions of python installed\n\u003c/pre\u003e\nIf required, a layout schematic can be loaded at startup:\n\u003cpre\u003e\n$ python -m model_railway_signals -f layout_file.sig\n\u003c/pre\u003e\nIf required, the logging level can be specified at startup (ERROR, WARNING, INFO or DEBUG)\n\u003cpre\u003e\n$ python -m model_railway_signals -f layout_file.sig -l DEBUG\n\u003c/pre\u003e\n\nApplication documentation, can be found in the 'user_guide' folder: \n[https://github.com/johnrm174/model-railway-signalling/tree/main/user_guide](https://github.com/johnrm174/model-railway-signalling/tree/main/user_guide)\n\nSome example layout configuration files can be found in the 'configuration_examples' folder:\n[https://github.com/johnrm174/model-railway-signalling/tree/main/configuration_examples](https://github.com/johnrm174/model-railway-signalling/tree/main/configuration_examples)\n\nMy youTube channel also has a number of videos demonstrating the use of the application:\n[https://www.youtube.com/@DCCModelRailwaySignalling](https://www.youtube.com/@DCCModelRailwaySignalling)\n\nAnd finally, a top tip for running the application on the latest Debian Bookworm release which uses Wayland as the GUI backend\nrather than X11 (which was the backend for previous Debian releases). I found that with Wayland, the Tkinter GUI performance\nwas terrible for some reason (not just my application - python/Tkinter performance in general) - and that was running on a\nRaspberry Pi 5 which I would have expected to improve overall performance. Anyway, I found that the fix is to switch the GUI\nbackend of the Raspberry Pi back to X11 - performance of the user interface is now lightning quick!\n\nTo change the backend - Run \"sudo raspi-config\", select 'Advanced Options' then 'Wayland' and select X11.\n\nAn additional benifit was that some of the other applications I use (such as the kazam video capture software)\nwill now work as normal on the Raspberry Pi 5.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnrm174%2Fmodel-railway-signalling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjohnrm174%2Fmodel-railway-signalling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjohnrm174%2Fmodel-railway-signalling/lists"}