These instructions describe the installation of Java 11 and JMRI 5+ on a Raspberry Pi computer running Raspberry Pi OS. The install process uses the general Linux instructions at Linux Install. Raspberry Pi specific activities are on this page.
The orignal version of this page is at JMRI on Raspbian. Be aware that much of the information on the old page is obsolete.
The Raspberry Pi is becoming increasingly popular as a small and cheap computer. Raspberry Pi OS is based on Debian and is recognized as being a very user friendly distribution.
Follow the steps at Linux Install to install Java and JMRI on a Raspberry Pi running either Raspberry Pi OS or Raspbian.
Note: The information for installing Raspberry Pi OS on a Raspberry Pi computer is available at Raspberry Pi Documentation.
If the Raspberry Pi will not have a display, keyboard and mouse, it can use a virtual VNC (Virtual Network Computing) interface. The RealVNC server is included in Raspberry Pi OS.
This is enabled by selecting Preferences ⇒ Raspberry Pi Configuration from the Raspberry start menu. In the Interface tab select VNC . For remote terminal access using ssh also enable SSH .
To automatically start the GUI version of PanelPro or DecoderPro during startup, add a symbolic link to the desktop icon.
cd ~/.config
mkdir autostart (might not exist)
cd autostart
ln -s ~/Desktop/PanelPro.desktop PanelPro.desktop
The Linux install of JMRI includes a JmriFaceless application. This is a minimal JMRI application with no GUI windows. Since there are no JMRI windows, everything must be configured using DecoderPro or PanelPro.
<entry key="autoStart">true</entry>
~/JMRI/JmriFaceless
at the command line.ssh <user>@<ip address>
/home/<user>/JMRI/JmriFaceless &
sudo -u <user> /home/<user>/JMRI/JmriFaceless &
.
The rc.local script runs as root so the sudo command is used
to start JmriFaceless as the user.Normally, the Raspberry Pi is shut down using the desktop start menu, either with a
monitor, mouse and keyboard or via VNC. It can also be shut down by logging in with ssh and
doing a terminal command, sudo shutdown -h now
, or doing a ssh remote command.
In JMRI, a Logix/LogixNG can be used to invoke the ShutdownOS.py Jython script.
LogixNG has a Shutdown action. This example uses a sensor that can be set from a browser connected to the JMRI Web Server.
LogixNG: Shutdown
ConditionalNG: Shutdown
! A
If Then Else. Execute on change
? If
Sensor Shutdown is Active
! Then
Shutdown JMRI/computer: Shut down the computer
! Else
If you just want to shutdown JMRI, without shutting down the Pi, there are several alternatives: