Install MMDVMHost on Raspberry Pi and tuning MMDVM for DMR digital mode

Tune DMR with MMDVMCal

Tuning the DMR digital mode

The DMR mode is not the simplest mode to set. Logically, the other modes will also be then adjusted. We will see what method to reach this goal.

We present the technique allowing you to have an optimum result. You will need to equip yourself with:

Nous vous présentons la technique permettant d’avoir un résultat optimum. Vous devrez vous équiper avec :

  • A spectrum analyzer and its attenuators
  • an oscilloscope

First, we will set the transmission of the repeater, then in a second step, the reception of the repeater. For this, we will use the calibration software MMDVMCal. Let’s see how to install it.

Installing the Calibration Software

Download MMDVMCal

Change to the /opt directory

We are now downloading Jonathan’s MMDVMCal project and made available on https://github.com/G4KLX/, with this command:

Compile the MMDVMCal software

We change now to the /opt/MMDVMCal directory that contains the source code previously downloaded. We will launch the compilation of the software.

Tuning the DMR transmission

To make our adjustments, your transceivers must be connected to the MMDVM filter shield. Take a moment to check your wire-to-wire connections before you start the settings (Rx Audio, Squelch, Tx Audio, PTT and Ground).

In my case, I use two Motorola GM360 sets. They are connected to the filter shield with PS2 (6-pin) connectors, and on the GM360 accessory socket (Supplier eg Aliexpress). The Squelch (COR) signal level must be checked (active = high level), and if necessary be reversed by programming the GM360.Brochage des prises PS2 (MMDVM) vers le connecteur Motorola HLN9457a

Motorola GM360

Motorola GM360

GM360 Rear Accessory Connector

MMDVM shield for Arduino designed by F5UII zoom

MMDVM, filter shield with PS2 connectors for transceivers

Start the tuning software, specifying the serial port on which the arduino is connected to the Raspberry Pi. Usually, the USB port is created under  /dev/ttyACM0

The help menu is displayed (h key).

Place the “D” command (shift key D) to enter the DMR mode setting. To switch to transmission, press the space bar. The PTT light on the MMDVM  board must light up. Your transmitter must now emit. At this time, the MMDVMCal software sends a low-frequency signal of 1200 Hz to your transmitter. You can optionally listen the signal with an analog receiver set on the output frequency of your (future) relay.

Your spectrum analyzer must now be connected to the RF output of the transmitter. Be sure to set up a sufficiently powerful attenuator to protect your analyzer. Set your analyzer to see the transmit signal.

We will start by reducing the LF signal level generated by the MMDVM board, reducing the gain to 0%. To do this, press the “t” key (lower key t) several times. Check that the multi-turn TX potentiometer  (R98 on my shield) is close to the middle of its range, and in any case, not at the end of the range.

Since the LF level is zero, you should only read the fundamental frequency on your analyzer (Bessel function J0).

fondamental-lf-null

Fundamental frequency with amplitude J0

We will now increase the level of the low frequency 1200 Hz signal, the “harmonics” will appear to the left and right of the line J0. To increase the level, press the “T” key (uppercase T).

lf-1200-injected

The frequency modulation spectrum with a 1200Hz BF signal (J0, J1, J2, J3 and J4 are present)

Now, by continuing to increase the signal level with the “T” key (shift key T), you will see that the amplitude of the J line decreases. Beyond this point, by continuing to press “T”, the amplitude of the line J increases again. Note down the percentage you have reached, when the line is at minimum amplitude. We will save this TX level percentage later in the MMDVMHost configuration file.

This operating point can now be fine-tuned to the transmit potentiometer R98 of the filtering MMDVM shield, in order to always look for the amplitude of the lowest J0. This gives a spectrum like that there. Your shield is noww tune to transmit DMR.

lf-1200-level-where-j0-is-minimum

Optimum adjustment of the DMR emission, the line J0 has disappeared

1,2000 kHz and 600 mV Peak-to-peak

The signal injected on the Motorola GM360 corresponding to this operating point has an amplitude of 0.6 V. Note that this level is dependent on your transceiver, and that may not be an universal reference.

Signal en entrée du GM360

Amplitude du signal MMDVMCal pour J0 au minimum (poste GM360)

In DMR, the frequency modulation deviation must be 2.75 kHz. MMDVMCal generates a signal of 1200 Hz. The Bessel J0 appears null when modulation index (x) is equal to 2.4. With this setting where the line J0 disappears, the operating point is set the deviation to 2.88 kHz (index = 2880/1200 = 2.4). We have than to minimize the TX Level (in mmdvm.ini file) by 5% to set the right deviation. For example, if we have find a TXLevel of 85% in MMDVMCal, we will set in mmdvm.ini (85*0.95 =) 81 (Read below).

Bessel Functions. Excerpt from Work Practical Electronics,École Polytechnique de l’UNS (in french)

Tuning with a SDR receiver (USB RTL key)

It is entirely possible to use a SDR receiver (such as a USB DVBT receiver RTL xxx) to replace the spectrum analyzer. This solution requires installing the SDRSharp software for example.

Setting DMR using a simple SDR RTL key

Tuning DMR reception

Let’s see how to set the reception. This second phase is simpler. Indeed, the goal is simply that the audio levels are not too strong and do not saturate the analog input of the arduino Due. We will use an oscilloscope for this operation.

First of all, I specify that your receiving station must output a low frequency signal without preemphasis or de-emphasis. The GM360 signal sent to the accessory jack is “Audio RX Flat”. If you can, configure your radio to send RX audio even if the squelch (COR) is not active.

 

Verification consists in checking the oscilloscope signal A0 which is sent to the arduino. Place your tip on pin 7 of IC2. You can take mass on JP5 or JP6 for example.

Even in the absence of an RF signal by the receiver, the filter amplifies the signals. If signal saturation exceeds 3V peak-to-peak, decrease the amplitude by turning potentiometer R99.

 

This is an example of signals you have on analog input A0 when a DMR signal is received by the receiver. We can clearly seen that the DMR is a digital mode with “switched frames”, with “no transmission” periods (largest amplitudes), where the noise signals evolve at a maximum of +/- 1 V. The DMR signals evolve at about +/- 400mV

dmr-rx-level

DMR transmission


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!

19 thoughts on “Install MMDVMHost on Raspberry Pi and tuning MMDVM for DMR digital mode

  1. Bonjour,
    j’aurai mis un décalage du démarrage du MMDVM idem YSFGateway
    et je mettrai le fichier MMDVM.ini (YSFGateway.ini) dans ex: /home/pi pour le conserver pendant les updates.
    donc lancement /opt/MMDVMHost/MMDVMHOST /home/pi/MMDVM.ini
    Beau travail
    Merci

    (Translate by F5UII below)
    Hello,
    I would have set a start delay of the MMDVM idem YSFGateway
    And I will put the file MMDVM.ini (YSFGateway.ini) into ex: /home/pi to keep it during the updates.
    So launch is made by /opt/MMDVMHost/MMDVMHOST /home/pi/MMDVM.ini
    Good job
    Thank you

    1. Merci Jean-Yves pour ces commentaires. En effet, il vaut mieux placer les fichiers de configuration hors du répertoire mis à jour. Bonne remarques
      Thank you Jean-Yves for these comments. Indeed, it is better to place the configuration files out of the updated directory. Good remarks

  2. Félicitations pour cet article, et Merci !

    (Translation by F5UII)
    Congratulations for this article, and thank you!

  3. Bonjour,
    Excellent article, félicitations.
    Ceux qui voudront ajouter un display LCD devront recompiler en utilisant le makefile ad-hoc et adapter les scripts s’ils utilisent une image Raspbian pré-configurée ( DMR Utah par exemple)
    Pour un LCD n’oubliez pas de démarrer MMDVMHost avec les droits de root (a cause de la librairie WiringPi ). Ce “détail” m’a fait perdre pas mal de temps, heureusement que le support de la liste Yahoo a été efficace.
    73,
    Jeff, F5BCB

    (Translation by F5UII)
    Hello,
    Excellent article, congratulations.
    Those who want to add a LCD display will need to recompile using the ad-hoc makefile and adapt the scripts if they are using a pre-configured Raspbian image (eg Utah DMR)
    For an LCD do not forget to start MMDVMHost with the root rights (because of the WiringPi library). This “detail” made me waste a lot of time, fortunately that the support of the Yahoo Group was effective.
    73,
    Jeff, F5BCB

    1. Merci Jean-François pour ce commentaire et le partage d’information avec cette précision technique concernant les écrans LCD.

      Thank you Jeff for this comment and the sharing information with this technical precision regarding the LCD screens.

      73
      Christian

  4. There is an error: the first Bessel null is 2.4048, so 1200*2.4048 = 2885,76Hz. The correct deviation for
    DMR is 2749Hz, 5% lower.

    My recommendation is to find the null using the potentiometer and then just reduce the TXlevel by 5. Try to avoid low TXlevels (50-75 is fine) to use the maximum DAC dynamic range ensuring a good SNR.

    Traduction :
    Il y a une erreur: le premier Bessel est nulle à 2.4048, donc 1200 * 2.4048 = 2885,76Hz. La déviation correcte pour DMR est 2749Hz, 5% inférieure.

    Ma recommandation est de trouver le point J0 nulle à l’aide du potentiomètre, puis de réduire le TXlevel de 5. Essayez d’éviter les TXlevels faibles (50-75 est très bien) pour utiliser la plage dynamique maximale DAC assurant un bon SNR.

  5. Félicitations pour la qualité de cet article, et Merci !
    Ceci permettra aux OM’s d’aboutir dans leurs travaux.
    Bravo.
    F4GIX

    (Translation)
    Congratulations for the quality of this article, and Thank you!
    This will allow the OMs to succeed in their work.
    Bravo.
    F4GIX

  6. As of the November 2016 release, Raspbian has the SSH server disabled by default. You will have to enable it manually. This is done using raspi-config:

    Enter sudo raspi-config in the terminal, first select Interfacing options, then navigate to ssh, press Enter and select Enable or disable ssh server.

    For headless setup, SSH can be enabled by placing a file named ‘ssh’, without any extension, onto the boot partition of the SD card.

    (Translation F5UII)
    À partir de la version Novembre 2016, Raspbian a le serveur SSH désactivé par défaut. Vous devrez l’activer manuellement. Cela se fait à l’aide de raspi-config:

         Entrez sudo raspi-config dans le terminal, sélectionnez d’abord les options Interfacing, puis naviguez jusqu’à ssh, appuyez sur Entrée et sélectionnez Activer ou désactiver le serveur ssh.

         Pour une configuration sans tête, SSH peut être activé en plaçant un fichier nommé ‘ssh’, sans extension, sur la partition de démarrage de la carte SD.

    1. Thank you for this important information … it means that if we follow the first manipulation, we are obliged to connect a screen and a keyboard, which I never realized with a Raspberry Pi, having always used SSH by networkg.

      (Translation)
      Merci pour cette information importante… cela veux dire que si l’on suit la première manipulation, on est obligé d’y brancher un écran et un clavier, chose que je n’est jamais réalisé avec un Raspberry Pi, ayant toujours utilisé SSH en réseau.

      1. I have not tried this but it should turn on SSH at boot
        (from my above note)

        “For headless setup (read as no keyboard or monitor) , SSH can be enabled by placing a file named ‘ssh’, without any extension, onto the boot partition of the SD card.”

        Doug

        (Translation F5UII)
        Je n’ai pas essayé ceci mais cela devrait activer SSH au démarrage
        (de mon commentaire précédent)

        “Pour la configuration sans interface (pas de clavier ou de moniteur), SSH peut être activé en plaçant un fichier nommé ‘ssh’, sans extension, sur la partition de démarrage de la carte SD.

        Doug

  7. Congratulations and thank you for producing such an excellent guide to setting up the MMDVM / Arduino Due / Pi combination.

    73

    Mike – G6GOS


    (Traduction de F5UII)
    Félicitations et merci d’avoir produit un excellent guide sur la mise en place de la combinaison MMDVM / Arduino Due / Pi.

    73

    Mike – G6GOS

    1. Thank you Mike, happy to help you with the tunning of the fabulous MMDVM 😉

      Merci Mike, heureux de pouvoir vous aidez à la mise au point du fabuleux MMDVM 😉

  8. F5UII,
    Thank you for the excellent guide for tuning up the MMDVM board. My unit now works on all modes except DMR. Since I am not familiar with DMR, it might be a MD380 radio setup problem or maybe an MMDVM.ini setting.

    Here is what I am getting on the MMDVMHost terminal screen when I key the MD-380:
    M: 2017-06-01 01:22:25.471 CSBK BS_Dwn_Act for ANY received from 3122007
    M: 2017-06-01 01:22:31.442 Debug: DMRIdleRX: data sync found centre/threshold 0 473
    M: 2017-06-01 01:22:31.446 Debug: DMRIdleRX: data sync found centre/threshold -20 498
    M: 2017-06-01 01:22:31.457 CSBK BS_Dwn_Act for ANY received from 3122007
    M: 2017-06-01 01:22:32.678 DMR, Logged into the master successfully
    M: 2017-06-01 01:22:33.098 Debug: DMRSlotRX: csbk found slot/pos/centre/threshold 2 457 -30 452
    M: 2017-06-01 01:22:37.939 Debug: DMRIdleRX: data sync found centre/threshold 10 441
    M: 2017-06-01 01:22:37.951 CSBK BS_Dwn_Act for ANY received from 3122007
    M: 2017-06-01 01:22:39.594 Debug: DMRSlotRX: csbk found slot/pos/centre/threshold 2 466 11 480
    M: 2017-06-01 01:22:41.424 Debug: DMRIdleRX: data sync found centre/threshold 7 442
    M: 2017-06-01 01:22:41.438 CSBK BS_Dwn_Act for ANY received from 3122007
    M: 2017-06-01 01:22:45.346 Debug: DMRIdleRX: data sync found centre/threshold -24 491
    M: 2017-06-01 01:22:45.349 Debug: DMRIdleRX: data sync found centre/threshold -34 476
    M: 2017-06-01 01:22:45.360 CSBK BS_Dwn_Act for ANY received from 3122007
    M: 2017-06-01 01:22:49.511 Debug: DMRIdleRX: data sync found centre/threshold -11 462
    M: 2017-06-01 01:22:49.521 CSBK BS_Dwn_Act for ANY received from 3122007
    M: 2017-06-01 01:22:53.074 Debug: DMRIdleRX: data sync found centre/threshold -20 456
    M: 2017-06-01 01:22:53.085 CSBK BS_Dwn_Act for ANY received from 3122007

    Any suggestions would be appreciated.
    Thanks,
    Dave
    K5OZ

    (Traduction)
    F5UII,
    Nous vous remercions de l’excellent guide pour régler le modem MMDVM. Mon appareil fonctionne maintenant sur tous les modes sauf DMR. Comme je ne connais pas DMR, il pourrait s’agir d’un problème de configuration radio MD380 ou peut-être d’un paramètre MMDVM.ini.
    Toute suggestion serait appréciée.
    Merci,
    Dave
    K5OZ

    1. Hello Dave,

      Have a look on the TCXO operation. With this command (adapted on current logfile of course), we check stability
      tail -f /MMDVM-2017-06-03.log | grep --line-buffered pos | cut -c91-94
      During transmission with your MD380 to the repeater, you must have same stable value
      in my case with 12.000MHz TCXO
      450
      450
      450
      450
      ...

      If its derives, check to TCXO output with a scope. The sinus level must be 0-3.3V. If the 0 is not reach (highest value), you may shorcut C22.

      Hope this will help you
      73

      (Traduction)
      Bonjour Dave

      Vérifions le fonctionnement du TCXO. Avec cette commande (personnalisé avec le dernier fichier log bien-sûr), nous vérifions la stabilité
      tail -f /MMDVM-2017-06-03.log | grep --line-buffered pos | cut -c91-94
      Dans mon cas, avec un TCXO 12.000MHz j’ai
      450
      450
      450
      450
      ...

      Si cela dérive, vérifier avec un oscillo la sortie du TCXO. Les niveau du signal sinusoïdal doivent être 0-3.3V. Si le 0 n’est pas atteint (valeur plus haute), vous pouvez court-circuiter C22.

      J’espère que cela vous aidera.
      73

  9. Bonjour Christian,
    Tu nous parles d’atténuateurs, tu me conseilles de prendre quelle(s) valeur(s) pour ne pas abimer un DSA815TG ? Sachant que j’utilise un FT7900 en 5W ( pour les réglages )
    Merci d’avance

    73’s

    (Translation)
    Hello Christian,
    You talk about attenuators, what value (s) can you advise me not to damage a DSA815TG? I use a FT7900 in 5W (for adjustments)
     
    Thank you in advance

    1. Sébastien,

      D’après ce que j’ai trouvé dans la documentation, ton analyseur mesure jusqu’à +20dBm (100mW) et sera endommagé à partir de +25dBm (316mW).
      5W étant 37 dBm, l’atténuateur doit donc être d’au moins 17dBm. Un atténuateur standard de 50dBm amène à ce que tu vois sur les captures d’écran.

      J’ajoute qu’il n’est pas nécessaire de mettre l’émetteur en ligne pour réaliser le réglage MMDVMCal, puisque nous ne cherchons pas à connaitre les niveaux, mais uniquement d’afficher le spectre. Il suffit d’une petit antenne sur le spectre.

      (Translation) From what I found in the documentation, your analyzer measures up to + 20dBm (100mW) and will be damaged from + 25dBm (316mW).
      5W being 37 dBm, the attenuator must therefore be at least 17 dBm. A standard attenuator of 50dBm leads to what you see on the screenshots.

      I add that it is not necessary to put the transmitter in line to realize the MMDVMCal setting, since we do not try to know the levels, but only to display the spectrum. Just a small antenna on the spectrum.

      73

  10. Bonjours, nous avons suivit votre tuto, mais au moment de lancer la commande “sudo /opt/MMDVMCal/MMDVMCal /dev/ttyACM0
    nous avons la réponse suivante :

    Version: 1 "MMDVM 20170501 TCXO (D-Star/DMR/System Fusion/P25/RSSI/CW Id) (Build: 22:17:02 Jun 30 2017)"
    Invalid response
    0000: E0 04 02 00

    avez vous une idée du soucis ?

    (Translation)

    Hello, we followed your tutorial, but when running the command “sudo /opt/MMDVMCal/MMDVMCal /dev/ttyACM0
    We have the following answer:

    Version: 1 "MMDVM 20170501 TCXO (D-Star/DMR/System Fusion/P25/RSSI/CW Id) (Build: 22:17:02 Jun 30 2017)"
    Invalid response
    0000: E0 04 02 00

    Do you have an idea of ​​the worry?

    1. Bonjour,

      Cela indique à priori qu’il n’y a pas de communication entre MMDVMHost et votre platine de filtrage MMDVM.
      Le port USB est-il bien raccordé; Voyez vous le port USB ? Executez cette commande qui doit lister ttyACM0 lorsque la liaison est branchée.
      ls /dev/ttyAC*

      (Translation)

      Hello,

      It lay indicates that there is no communication between MMDVMHost and your MMDVM filtering modem.
      Is the USB port connected properly? Do you see the USB port? Execute this command, which should list ttyACM0 when the connection is linked.
      ls /dev/ttyAC*

Leave a Reply

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