setting up JMRI on an Orange Pi with LCD output and Access point for IP
First off download the minimal armbian for the OS (all my examples are built on Orange Pi 3 LTS)
Load Armbian Config
sudo armbian-config
change to Stable selecting System > Stable then update all firmware System > Firmware
Reboot
Load Armbian Config
sudo armbian-config
now setup wireless for the USB Wireless
Select Network > WiFi
Install XFont used by TightVNC server
sudo apt-get install xfonts-base
Install TightVNC server
sudo apt-get install tightvncserver
Setup this user for VNC server,
vncserver :1
We need to assign a password. No need to specify a view-only password.
Use the command to confirm the server is running and the default options applied
ps -ef | grep Xtightvnc
VNC Client can now connect to this server, display :1 refers to port 5901. Hence the connection string is :5901.
However, there is no windows shown up, as Armbian distribution does not include any X-window manager. Now we install Xfce, a light weight X-window desktop.
sudo apt-get -y install xorg lightdm xfce4 tango-icon-theme gnome-icon-theme dbus-x11
Restart VNC server
vncserver -kill :1
vncserver :1
Now the client will show up Xfce desktop over TightVNC.
To make TightVNC autostart on OrangePi startup, use systemctl control. Create a new script,
sudo nano /usr/local/bin/tightvncserver
The content of this script
#!/bin/bash
PATH="$PATH:/usr/bin/"
DISPLAY="1"
DEPTH="16"
GEOMETRY="1024x768"
OPTIONS="-depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}"
case "$1" in
start)
/usr/bin/vncserver ${OPTIONS}
;;
stop)
/usr/bin/vncserver -kill :${DISPLAY}
;;
restart)
$0 stop
$0 start
;;
esac
exit 0
Make this script executable,
sudo chmod +x /usr/local/bin/tightvncserver
Setup systemd script
sudo nano /lib/systemd/system/tightvncserver.service
With this content
[Unit]
Description=Manage tightVNC Server
[Service]
Type=forking
ExecStart=/usr/local/bin/tightvncserver start
ExecStop=/usr/local/bin/tightvncserver stop
ExecReload=/usr/local/bin/tightvncserver restart
User=orangepi
[Install]
WantedBy=multi-user.target
Restart Systemd service and enable tightvncserver,
sudo systemctl daemon-reload
sudo systemctl enable tightvncserver.service
Now we have 4 commands to start, stop, restart, and status over tightvncserver,
sudo systemctl start tightvncserver.service
sudo systemctl stop tightvncserver.service
sudo systemctl restart tightvncserver.service
sudo systemctl status tightvncserver.service
Reboot Orangepi. Now the connection is ready as OrangePi started.
sudo reboot
Install Java
sudo apt install default-jdk -y
setup the Hotspot
sudo nmcli device wifi hotspot ifname wlan0 ssid JMRIPI password "jmripi01"
install NetworkMonitor Tray for GUI
sudo apt install nm-tray
disable hibanate
sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target