- ./3d: 3D printable models to replace existing (e.g. better suited) or missing parts.
- ./arduino: Per-signal Arduino software that reads signals from the train
signal web API.
- Compile and flash to the device using Arduino's IDE.
- ./assets: Images used for the project.
- ./LocalTrainCTC:
[OUT OF DATE]
An Android phone app to send state change commands to the signal.- This is an Android Studio project.
- ./photos: Before/after photos of specific signals.
- ./TrainSignalApi: A Java servlet application that runs on the server. This
software is responsible for both serving the web API and listening for
connections from the SignalConsumer.
- This can be built using Apache Ant with
Ivy using the build.xml file in this directory.
The generated
.war
file can be found in the "out" directory.
- This can be built using Apache Ant with
Ivy using the build.xml file in this directory.
The generated
- ./web: A simple web application to interact with the signal. This interface is preferred over the Android app.
The TrainSignalApi is always listening for connections from the SignalConsumer. If the connection is interrupted, the SignalConsumer will attempt to establish a new connection. The server is only capable of hosting a single connection to a signal, so when a new connection is requested (due to interruption or otherwise), the existing connection will be dropped to host the new one. The SignalConsumer has a delay of 2.5 seconds after receiving a command before processing the next, giving it time to physically change.
TrainSignalApi/api?color=COLOR&lamp=LAMPSTATE
-
COLOR: One of the following:
- r: Change the signal to red.
- y: Change the signal to yellow.
- g: Change the signal to green.
-
LAMPSTATE: One of the following:
- 0: Turn the lamp off.
- b: Blink the lamp (this needs to be implemented in hardware).
- 1: Turn the lamp on.
- Arduino UNO: The microcontroller that lives in the train signal.
- Arduino ethernet shield: Used to receive commands from the network.
- Power supply: 12V and at least 3A depending on number of lamps.
- Relay board: Used to switch larger power supply.