STG Posted September 27, 2020 Share Posted September 27, 2020 I use a raspberry pi with JMRI. Hi, Do you have any more details that you could share.Okay, I have 3 separate raspberry Pis, some jobs can be merged into 1 to reduce the number of Pis Needed:RPi no.1 - Controls JMRI WiThrottle Interface, with small screen and keyboard for changing roster etcRPi no.2 - Controls Signals and Points via relays connected to GPIO pins. Pin output is controlled via a python program on the Pi, listening, and a separate program on a control computer, which connects to the Pi accross the wifi.RPi no.3 (optional) - Announcements - Python program once again connects to control computer, trains are scheduled from this computer, to be announced, and also are placed on a mini-screen next to the operator.Code Length: >1000 LinesCode Diffculty: Moderate (easier if control device runs a text-based interfase rather than a GUI)Programming with JMRI - I have looked into this, although it runs on Jython, which is not my favourite programming language ever, and the documentation is sparse.PotentialSensors could be used to interlock and automate signals Link to comment Share on other sites More sharing options...
96RAF Posted September 27, 2020 Share Posted September 27, 2020 Rocrail supports RasPihttps://wiki.rocrail.net/doku.php?id=english#raspberry_pi Link to comment Share on other sites More sharing options...
RDS Posted September 28, 2020 Author Share Posted September 28, 2020 I use a raspberry pi with JMRI. Hi, Do you have any more details that you could share.I have a number of Raspberry Pi's and have built a few Projects but the ability to control a model railway really appeals. Link to comment Share on other sites More sharing options...
RDS Posted September 28, 2020 Author Share Posted September 28, 2020 I raised this thread because Forum Member STG mentioned (on another thread) using a Raspberry Pi in conjunction with JMRI. Link to comment Share on other sites More sharing options...
RDS Posted September 28, 2020 Author Share Posted September 28, 2020 @STGThank you. I may look into that in the future. I have a few other Python programs on the go at the moment. I favour the GUI approach. I have started using tkinter on my programs now. Link to comment Share on other sites More sharing options...
STG Posted September 28, 2020 Share Posted September 28, 2020 I favour the GUI approach. I have started using tkinter on my programs now.I used tkinter, but personally find it hard to make it look nice, and some of the features have limitations, ie. for some features your code has to generate and execute code through the program itself, although this sort of complexity would only be seen in programs coded for generic use, not for use on a particular railway unless complex.Also, I found programs coded for generic use, although worked, required more user input for simple tasks, so hardcoding would be less time-consuming for the operator.Experimenting ended my up with 5 prototypes, and conclusions:Don't code it generic or it'll consume operator timeGoogle TTS is the most similar TTS for announcements in real lifeA similar screen used in the train-tech smart screen can be found online for use with RPis Link to comment Share on other sites More sharing options...
STG Posted September 30, 2020 Share Posted September 30, 2020 Before I forget, my favourite tkinter tool is the tkinter.messagebox:Imported viafrom tkinter.messagebox import*and then for information dialogsshowinfo(title=None, message=None)and for error dialogsshowerror(title=None, message=None)These use the default dialog box settings for the computer in use, and add a nice touch compared to bland tkinter typical light-grey windows and a few lines of text.(also tkinter.filedialog may be useful for opening items such as train rosters, or mimic panels) Link to comment Share on other sites More sharing options...
Graham-1251243 Posted June 11, 2022 Share Posted June 11, 2022 Hi. Ive just completed the first stage of a Raspberry Pi controlled system, using an RPI 4, PiHut relay board for the signals, a 298 motor controller and a number of IR sensors. Its all working great now. But I need to control two tracks independently using a single RPI, Im thinking I need to learn some form of concurrent control such as threading. Does anyone have any advice if this is the right approach, or know where I can get good advice on this. I will add a picture of the layout (N gauge) later if anyone is interested Link to comment Share on other sites More sharing options...
Graham-1251243 Posted June 11, 2022 Share Posted June 11, 2022 I meant to say that the code is all written in Python using the Mu editor. The locos are analogue and the L298N motor controller (usually used for Robotics) controls the speed using Pulse Width Modulation. Its incredibly easy to use though using the Python Motor function. The whole program is only 120 or so lines of code at the moment. I got started on the project after watching a tutorial by Penguin Tutorials on YouTube. Worthwhile watching Link to comment Share on other sites More sharing options...
rpjallan Posted June 14, 2022 Share Posted June 14, 2022 I watched some videos on YouTube a while ago of a guy using Arduino with JMRI. He built his own controller if I remember correctly. I'll post a link if I can find it... Link to comment Share on other sites More sharing options...
rpjallan Posted June 14, 2022 Share Posted June 14, 2022 Have a look at this: I guess there are people do similar things with Raspberry Pi... Link to comment Share on other sites More sharing options...
Johan-373596 Posted November 26, 2023 Share Posted November 26, 2023 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 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now