Welcome to MattzoBricks › Forums › MattzoBricks General Forum › Rocrail on Raspberry Pi
- This topic has 5 replies, 2 voices, and was last updated 3 years, 1 month ago by Nikos Lygizos.
-
AuthorPosts
-
-
February 26, 2021 at 04:54 #2475Nikos LygizosParticipant
Running the MattzoControllers from a Raspberry Pi
-
February 26, 2021 at 05:15 #2476Nikos LygizosParticipant
I thought of “shrinking” the computer running Rocrail from a laptop/desktop to something the size of Altoids box!
That means, Raspberry Pi! So I got me a RPi 4 with 4GB of memory and 32GB SD (Class 10). I do not use the NOOBS image because it is “bladed” with applications I will not need for running Rocrail on it. Actually, I used the Raspberry Pi OS Lite and installed all necessary packages manually as the “Desktop” and “Recommended” images have a lot of applications, utilities etc.
By the way, the built below is headless (no keyboard, monitor nor mouse required). For the below installation I used a Windows 10 and a Centos VM but can be done with a Mac or just a linux system.
- Download the Raspberry Pi OS Lite image and unzip the image.
- Burn the image on the SD card using Balena Etcher
- On the root directory of the image create a text file “wpa_supplicant.conf” and enter your WiFi information (do not use Note):
$ sudo nano wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US ————- 2 Letter Country WiFi Designation Here
network={
ssid=”Your Wifi SSID 5GHz prefared”
psk=”passphrase”
} - Create an empty file “ssh:
$ sudo touch ssh - Put the CD card in the Raspberry Pi and power-up
- Find the IP address of the Raspberry Pi and ssh (Putty):
ssh xx.xx.xx.xx - Login using “pi” and “raspberry” for password.
- Enter the following commands to update to the latest:
$ sudo su –
# apt update
# apt upgrade
# reboot - Change the pi default password
pi@raspberrypi:~ $ passwd - Install needed packages:
# apt install xserver-xorg
# apt install raspberrypi-ui-mods
# apt install lightdm
# apt install realvnc-vnc-server
# apt install mosquitto
# apt install libwxgtk3*
# reboot - ssh back to the Pi using the new password.
- Enter:
$ sudo raspi-config - Update the following options:
System Options –> Boot/Auto Login –> Desktop
Display Options –> Resolution –> Any but default (monitor limitations)
Interface Options –> VNC
Localisation Options –> Timezone
Performance Options –> GPU Memory -256
Advance Options –> Expand Filesystem - Final reboot:
$ sudo reboot - Install Rocrail:
$ wget https://wiki.rocrail.net/rocrail-snapshot/Rocrail-ARMHF.zip
$ unzip Rocrail-ARMHF.zip -d ~/Rocrail
$ cd Rocrail
$ desktoplink.sh - Using your RealVNC login to the Pi Desktop and start a terminal (ssh) window.
- Enter the following commands to create a Rocrail button:
$ cd Rocrail
$ desktoplink.sh - Click the “Rocrail” button and done!
You will have to re-program all you MattzoControllers with the IP of this Raspberry Pi, unfortunately.
Initially, is working great except some delayed actions. Especially from the MTC4PU “missing” commands, I think.
Enjoy!
Nikos- This reply was modified 3 years, 1 month ago by Nikos Lygizos.
-
February 26, 2021 at 08:30 #2478ZoltanParticipant
I use a total standard PI4 with default Raspbian and the actual Rocrail zip for ARM.
Works okay.
The PI4 is big enough for all “unneeded” apps which but do not make any problem, and the installation is much easier this way. -
February 27, 2021 at 04:22 #2480Nikos LygizosParticipant
Do you use any MTC4PU controllers?
-
February 27, 2021 at 07:56 #2481ZoltanParticipant
No, but I plan it 🙂 Have but no locos yet for it.
I currently use MTC4PF, switch & sensor controllers.
(And I use Rocrail for other train setups, with a DR5000 in several gauges.)-
February 28, 2021 at 23:45 #2601Nikos LygizosParticipant
I need to dig in the logs for finding where the delay occurs. I have found several times both locomotives do not stop at the END of a block sensor until they passed it a few car lengths. I have not observed this issue when I run Rocrail and mosquito from a fast Windows 10 system. The only difference besides hardware and OS is that mosquito on the Pi is version 1.1 and 2.0 on Windows 10 system.
Any thoughts?
-
-
-
-
AuthorPosts
- You must be logged in to reply to this topic.