Friday, 23 October 2020

Raspberry Pi - For JMRI

No not a a Raspberry Pie (the type you like to eat).

Have been watching with a keen interest the progress of the Raspberry Pi mini computer.

The Raspberry Pi is a PC on a board that are about $100. The idea is that they are small, simple, solid state and are used for what ever project you can come up with. The Raspberry Pi 4 fits into the palm of your hand and is about as powerful as your average size Laptop these days. Has 4 USB ports, built in WiFi, a wired network port, 2 x HDMI ports etc etc. Is runs a version of Linux called Raspbian. All totally Free..




I had watched a few tutorials on setting one up to run JMRI and had been sitting on the fence for a while as I had a old Laptop that I was using to run Panel Pro on the layout. The issue with the laptop is that it takes a while to start, does not have a battery and was a general pain in the neck. I found a cheap, used Raspberry Pi 4B 4Gb on ebay so thought why not.. Lets have a crack at this.

The guys at JMRI have set up a image for the Pi so that it can just be copied to a SD card for the Pi and it will auto detect the DCC system and connection to the Loconet. Too easy I thought..... and it was..

I have now got the Pi running on the layout in a way so that it does not have a screen, it boots up when the layout power is turned on as I walk in the room. The Pi then auto starts JMRI and the Panel for the layout and then runs the layout initialisation routine to set all the turnouts to a known state for the signals to work.

It is best to shutdown the the Raspberry Pi rather than just killing the power, so I have set up a turnout number that I can operate from the throttle so that it runs the shutdown routine for the Pi. Once done I can then kill the power to the layout. 

As an alternative, I also have an old iPad in the room that connects to the JMRI web server (that auto starts when the Pi starts). I have a panel that has some basic functions on it (per below) so I can enable the staging auto reverse set up so that I can just set a train running and JMRI will set for the selected clear track and then detect when the train is in the loop and auto throw the turnout so that the train can exit safely. It then waits for the train to clear the staging turnouts and a few extra blocks and then rests.



The panel also has a switch on it to shutdown the Pi so that I dont need to use the throttle. All rather nifty.. So now I can do away with the laptop and only drag it out when I need to program a loco.

The Pi has USB ports so that a keyboard, mouse and monitor can be installed if needed, but I can just remote control to it from my laptop or the iPad if needed. So no screen or keyboard is required in the RR Room.


All rather nifty really. That was a nice distraction from buildings. Now back to the buildings.

2 comments:

  1. WOW how cool is that. Beats the old Toshiba lap Top brick that I dad to start and run the fast clock and the PC that sat under the dispatchers desk.
    Way to cool Brendan.

    ReplyDelete
  2. Hi Brendan, impressive stuff with the Pi. Well done on getting so much done during lockdown. Brian

    ReplyDelete