Automatic start of MMDVMHost

In this article, you will learn how to make MMDVMHost automatically start when your Raspberry Pi is turned on.

The automatic start of MMDVMHost

On the Raspberry Pi, there are two solutions (the ones I know) to automatically launch software when the Raspbeery Pi is turned on (or rebooted), running under Raspbian.

Simple startup

To start MMDVMHost automatically, the easiest solution is to edit this startup file and add the command line to start MMDVMHost before the statement exit 0

Starting with declaring a MMDVMHost service

Another solution, a little more elegant is to create a service.

Prerequisites

Installation of screen

Creating the service file

In the [Service] section, the last two lines make it possible to restart MMDVMHost in the event of a crash. It should be noted that it is very rare to be confronted with unexpected stops of MMDVMHost. We will test the proper functioning of the restart further down in the article.

The MMDVMHost launch directories shown here correspond to those used during the MMDVMHost install tutorial.

Creating the launch timer file

The start of the service is delayed after 60 seconds after startup

Enforcement and service

We can restart the service manager

Now the MMDVMHost service is ready to start. At this point, we can start the service without restarting.

Verification of Service Operation

You can verify that the service launch MMDVMHost, by appearing in processes (ps) with the following statement. Must be displayed 3 rows.

For verify the operation of the service, you will have access to the MMDVMHost log with the following command

The operating status of the service is returned with this command

Let’s now test the automatic restart.

Step 1: The service is running, MMDVMHost is present in the list of processes:

Step 2: We will kill the MMDVMhost process with

Step 3: Immediately check the list of processes.

There is only one line left … But 10 seconds later, the same command again displays the 3 lines. MMDVMHost has been restarted!

Other command

To stop the service

Conclusion

Vous aurez compris que la seconde solution présentée et qui consiste à démarrer MMDVMHost en tant que service est plus robuste grâce à la fonction offerte par le service de redémarrer automatiquement MMDVMHost sur arrêt intempestif.

Au besoin les commentaires sont ouverts ci-dessous pour vos remarques, ou questions.


If you would be interested to participate in a possible future new grouped order (MMDVM board, SvxLink Card), leave your email below to be reported!

10 thoughts on “Automatic start of MMDVMHost

  1. Bonjour
    la solution la plus simple faire un fichier dans l’autostart avec un décalage de 30 secondes

    (Translation)
    Hello
    The simplest solution is to make a file in the autostart with a 30 second delay

    sudo su
    cd ./config
    sudo mkdir autostart ('s'il n'existe pas)
    cd autostart
    sudo nano MMDVMHost.desktop:

    [Desktop Entry]
    Name=MMDVMHost
    Exec=sh -c "sleep 30 && cd /opt/MMDVMHost; sudo ./MMDVMHost MMDVM.ini"
    Terminal=false
    Type=Application
    Icon=
    Categories=Hamradio;

    CTRL+x Yes pour sortir

  2. Good Morning,

    Advice please before I do a total rebuild..

    I have followed the build sequence for MMDVM and Adriano on a PI 3
    but something is wrong with one of my settings
    as the Pi boots up it fails for DMR and just keeps running around in a loop
    Is there a way to break that loop, or login via an other virtual screen to stop it please.
    All the best and thank you from Alan

    (Traduction)
    Bonjour,

       Conseils avant de faire une reconstruction totale.

    J’ai suivi la séquence de construction pour MMDVM et Adriano sur un PI 3
    Mais quelque chose ne va pas avec l’un de mes paramètres
    Lorsque le Pi démarre, il échoue pour DMR et continue de tourner en boucle
    Existe-t-il un moyen de briser cette boucle, ou de vous connecter via un autre écran virtuel pour l’arrêter s’il vous plaît.
    Tout le meilleur et merci d’Alan

  3. Hello,

    I think that you may use my service menu here : https://www.f5uii.net/en/mmdvm-management-menu/

    It include the stop command of the service. If you kill simply the MMDVMHost process, yes, the service will start again !

    73 Chris

    (Traduction)
    Bonjour,

    Je pense que vous pouvez utiliser mon menu de gestion ici: https://www.f5uii.net/fr/mmdvm-management-menu/

    Il comprend la commande d’arrêt du service. Si vous tuez simplement le processus MMDVMHost, oui, le service le relancera !

    73 Chris

  4. Good Afternoon Chris, that does look great, BUT I need to get in first
    which I cannot do…

    All the best from Alan

    (Traduction)
    Bon après-midi Chris, ça a l’air génial, MAIS j’ai besoin d’entrer en premier
      Chose que je ne peux pas faire …

    Alan

    1. I do not understand how it is possible to have so a trooble. Is it booting in circle ?
      I believe that you know connect remotely your Raspberry Pi via SSH like explained here
      https://www.raspberrypi.org/documentation/remote-access/ssh/windows.md

      That you can stop your service (sudo systemctl stop mmdvmhost.service) and also kill the process (sudo killall MMDVMHost)

      (Traduction)
      Je ne comprends comment cela est possible d’en arrivé là. Est-ce que cela reboote en cycle ?
      Je suppose que vous savez vous connecter à distance au Raspberry Pi via SSH comme expliqué ici.
      https://www.raspberrypi.org/documentation/remote-access/ssh/windows.md

      Alors, vous pourrez stopper le service (sudo systemctl stop mmdvmhost.service) et aussi tuer la tâche (sudo killall MMDVMHost)

  5. Hi Chris I hope this will explain…

    http://www.highforce.com/pi.jpg

    what you see keeps repeating, i need to stop it to install your program, or goto single user mode
    and cancel the rc.local file

    All the best from Alan

    (Traduction)
    Bonjour Chris J’espère que cela sera plus clair …
    http://www.highforce.com/pi.jpg
    Ce que vous voyez continue de répéter, je dois l’arrêter pour installer votre programme, ou passer en mode utilisateur unique
    Et annuler le fichier rc.local
    Alan

    1. Alan,

      This is no link with the way you start MMDVMHost ! It is just telling that you can not reach the DMR master server via internet.
      You have to check
      1) you have enter the good master ip or host adress, port and password in the MDMVM.ini, section [DMR Network]
      2) Your internet gateway ip address indicated in your Rasperry Pi is corresponding to your internet box, so that the ip routing come out to internet.
      you can have a look if you can ping google.com and our master with ping www.google.com command

      (Traduction)

      Alan,
      Cela na rien à voir avec la façon MMDVMHost démarre ! Cela indique juste que vous n’arrivez pas à atteindre le server Master DMR via internet.
      Vous devez vérifier
      1) que vous avez bien renseigner la bonne adresse ip ou nom de host, port et password dans MMDVM.ini à la section [DMR Network]
      2) que l’adresse ip du gateway internet est bien renseigné dans le Raspberry Pi, qu’il corresponde à l’adresse de votre box internet, de façon à ce que les routages ip aille sur internet.
      Vous pouvez vérifier que le ping vers google et vers votre master fonctionne avec la commande ping www.google.com

  6. I am understanding what you are saying all good advice

    BUT

    I CANNOT get into ROOT

    Control C or Esc will not get me out of this, I cant even remote access in via the ethernet

    I hope you understand, sorry if my English is bad..

    All the best from Alan & Thank you.

  7. Hi Chris,

    It appears that after 15minutes, the pi allows you to connect via ssh which I did do, and stop the mmdvm
    created the menu as describe in your web pages, make life a lot easier 🙂 thank you for that..

    I disabled everything except Fusion, then set the software running again…
    and this is what I get, http://www.highforce.com/p2.jpg

    Thank you for your help & support..

    All the best from Alan

    (Traduction)
    Salut chris,

        Finalement après 15 minutes, le pi m’a autorisé à m’y connecter via ssh, chose que j’ai faite et puis arrêter mmdvm
        J’ai créé le menu comme décrit sur votre site Web, ce qui rend la vie beaucoup plus facile 🙂 merci pour ça …

        J’ai désactivé tout, sauf Fusion, puis réinitialiser le logiciel …
        Et c’est ce que je reçois, http://www.highforce.com/p2.jpg

    Merci de votre aide et de votre support..

    Salutations Alan

Leave a Reply

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