Welcome to MattzoBricks Forums MattzoBricks General Forum Rocrail on Raspberry Pi

Viewing 3 reply threads
  • Author
    Posts
    • #2475
      Nikos LygizosNikos Lygizos
      Participant

      Running the MattzoControllers from a Raspberry Pi

    • #2476
      Nikos LygizosNikos Lygizos
      Participant

      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.

      1. Download the Raspberry Pi OS Lite image and unzip the image.
      2. Burn the image on the SD card using Balena Etcher
      3. 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”
        }
      4. Create an empty file “ssh:
        $ sudo touch ssh
      5. Put the CD card in the Raspberry Pi and power-up
      6. Find the IP address of the Raspberry Pi and ssh (Putty):
        ssh xx.xx.xx.xx
      7. Login using “pi” and “raspberry” for password.
      8. Enter the following commands to update to the latest:
        $ sudo su –
        # apt update
        # apt upgrade
        # reboot
      9. Change the pi default password
        pi@raspberrypi:~ $ passwd
      10. 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
      11. ssh back to the Pi using the new password.
      12. Enter:
        $ sudo raspi-config
      13. 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
      14. Final reboot:
        $ sudo reboot
      15. Install Rocrail:
        $ wget https://wiki.rocrail.net/rocrail-snapshot/Rocrail-ARMHF.zip
        $ unzip Rocrail-ARMHF.zip -d ~/Rocrail
        $ cd Rocrail
        $ desktoplink.sh
      16. Using your RealVNC login to the Pi Desktop and start a terminal (ssh) window.
      17. Enter the following commands to create a Rocrail button:
        $ cd Rocrail
        $ desktoplink.sh
      18. Click the “Rocrail” button and done!
      19. 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

    • #2478
      ZoltanZoltan
      Participant

      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.

    • #2480
      Nikos LygizosNikos Lygizos
      Participant

      Do you use any MTC4PU controllers?

      • #2481
        ZoltanZoltan
        Participant

        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.)

        • #2601
          Nikos LygizosNikos Lygizos
          Participant

          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?

Viewing 3 reply threads
  • You must be logged in to reply to this topic.