Text notifications for approaching trains.
- Python
- ATCS Monitor
- Clone this repository to your machine.
cdintosrc/- Run
pip install -r requirements.txt - Open ATCS Monitor, and view the dispatch display for the subdivison you'd like to monitor.
- Take a full-screen screenshot, and upload it to https://pixspy.com/. Use the site to identify pixel coordinates of the signals/tracks you'd like to monitor.
- Create your own version of
BNSF_BrushSub.pythat uses the pixel values you identified. - To set up texting, create a free Twilio account. Set up SMS on their site, which requires getting a phone number from them (free w/ trial credits).
- Creat a copy of .env.example in the same directory, except name it
.env. Replace the placeholder values with the actual values from your Twilio account. - Make sure nothing is blocking the dispatcher display on your computer, since it works based on automatic screenshots. Then, run
python3 YourFilename.py, where the filename is what you copied fromBNSF_BrushSub.py.
- Takes screenshots of ATCS monitor at regular intervals
- Analyzes pixels of interest (switches, track occupancy, etc)
- Feeds that data into a state machine that determines where the train is and what it's doing.
- Sends the appropriate messages with a link to a railfan camera.
ATCS Monitor is currently a closed-source Windows application. I don't have much experience with Windows, so I haven't tried to reverse engineer the application to obtain train location info headlessly. I might be able to analyze the network traffic via Wireshark and do it that way. Regardless, if someone wants to fork this and continue development, I'd appreciate it.
I'd also like to add a more modular system for handling parameters on train movement. For example, the user could choose between NB and SB trains just by choosing the right data source and state machine to use. That would be encapsulated in a module, maybe in a database, so that the main application doesn't need to be modified every time there is a new route.
Eventually, a frontend will be necessary to manage when to receive and what types of notifications to receive per user.