This month I started tinkering with controlling a model railway with an RPi. If you are okay with looking at a beta version and incomplete documentation you could have a look at my Github repository and wiki at https://github.com/dajomas/MoRaPi/tree/release/0.1.0