JMRI on Raspberry Pi

I have finalized my DCC system. As previously mentioned I have built a DCC++ Base Station per the instructions found on the DCC++ YouTube site and other resources on the web. On my blog I have lots of links and how to’s for that. To run DCC++ you either have to use the software that was developed for it or use JMRI. I chose JMRI. Instead of running it on my lap top I wanted a dedicated computer for it so I invested in a Raspberry Pi. A Pi, is a very small credit card sized board designed to run a version of Linux. No worries, no Linux knowledge is needed. Steve Todd has it all done for you and a visit to his site will get you what you need to set it up.

I went another way. I wanted to document the procedure start to finish for my own pleasure and so I started with a brand new installation of the Raspbian Operating System. Below I will detail that procedure out. It got complicated because the latest OS is a little different than previous versions and the procedure to change it to an Access Point is different. I have shown step by step what I have done for anyone wanting to repeat my process.

I began by downloading the latest version of NOOBS (New Out Of the Box Software) for the Raspberry Pi. (12/9/17) this file contains the latest version of the Raspian operating system for the Pi. I am using a Raspberry Pi 3 mounted in a plastic case.

Once downloaded, NOOBS was loaded on the micro SD card and the simple instructions were followed from This provided me with a fresh, clean install of the operating system.

With the operating system installed, I installed JMRI following the instructions as found at:

  • Setup JMRI to connect to my DCC++ Base Station
  • Copied Roster from PC to JMRI with USB stick.
    • Exported Roster on PC
    • Imported Roster on Pi
  • Renamed from MyJMRIRailroad to West Haven Industrial via Edit/Preferences/Railroad Name
  • Run DecoderPro at Startup
    • In a terminal open the session autostart file:
      sudo nano /home/pi/.config/lxsession/LXDE-pi/autostart
    • Add the following line, with the path to the location where you installed DecoderPro:
    • Save the file and quit the editor.
  • Set WiThrottle Server to open at startup via Edit/Preferences/Start Up/Start WiThrottle Server
  • Set JMRI to turn on track power at startup via Edit/Preferences/Start Up/Power Button
  • Setup VNC to allow remote access and control
  • Setup Pi as Access Point
    • NOTE: Raspbian Stretch works differently than most of the tutorials on the internet… Follow instructions below:
    • Download and install DNS and AP software packages:
      sudo apt-get install dnsmasq hostapd
    • Edit the dhcpcd.conf file:
      sudo nano /etc/dhcpcd.conf
      add the following:
      interface wlan0
      static ip_address=
      static routers=
      static domain_name_servers= wlan0
    • Edit dnsmasq.conf file:
      sudo nano /etc/dnsmasq.conf
    • Edit /etc/hostapd/hostapd.conf
      sudo nano /etc/hostapd/hostapd.conf
    • Edit /etc/default/hostapd
      sudo nano /etc/default/hostapd
    • Start the services:
      sudo service hostapd start
      sudo service dnsmasq start
    • Reboot the Pi
  • You can now access the westhaven network via WiThrottle  and VNC

Again, none of this is necessary as the image from Steve Todd does ALL the configuration for you. This is just for the DIY crowd using the latest version of the Pi OS.

With everything up and running, I wanted to try attaching my MERG Booster to the system. This was an easy thing to do. Track output of the DCC++ to the DCC IN on the booster. Power up the Pi and the DCC++ Base Station, then power up the booster. I was running trains in 5 minutes. See my comments on the MERG Booster for more information.

Now I have a complete 5Amp DCC system and it cost me less than $200 Canadian. The booster with power supply worked out to $62. The DCC++ Base Station was less than $20 and the rest is the Pi, memory card and its associated power supply. I bought a kit but the individual components are available cheaper.

0 Replies to “JMRI on Raspberry Pi”

  1. My experience using Steve Todd’s excellent JMRI image for Raspberry Pi was that I still needed to do the following step to get everything working as it should:
    Set JMRI to turn on track power at startup via Edit/Preferences/Start Up/Power Button

    Thankfully I found the solution to my problem on your site!

  2. Greg;

    I realize this may be an old post but thank you nonetheless. Would you share a link as to where to purchase the rPi (B2+?).

    Neil Erickson

  3. I’d use whichever is most obtainable. Any will run JMRI without problem. I’d also recommend Steve Todd’s image for setup.

Leave a Reply

Your email address will not be published. Required fields are marked *