HOW-TO MMDVMHost with a DVMega

NOTE: The following is based on a single band RPi shield – it should work with the dual band RPi shield too.  For the Arduino UNO based DVMega, substitute /dev/ttyAMA0 with /dev/ttyACM0.  Also note you should not need to remove getty processes and bootup info from /dev/ttyACM0 as it doesn’t go to them.

FURTHER NOTE: There are slight differences in the processes to remove getty processes between Raspbian Wheezy and Raspbian Jessie – they are annotated along the way.

YET ANOTHER NOTE: You need to disable the built-in bluetooth on a Raspberry Pi 3 to restore UART0/ttyAMA0 over GPIOs 14 & 15 by modifying /boot/config.txt – the process is towards the end just after disabling getty processes on /dev/ttyAMA0.

UPDATE: You can grab the “bleeding edge” source code for MMDVMHost by using G4KLX’s git repository, in which case you don’t need to join the MMDVM Yahoo group and grab the latest release from there.  Instructions at the end …

UPDATE: You can now update the firmware on your DVMega RPi shield directly from the RPi without removing the ATMEGA328 chip or the use of separate cables or Arduinos.  Instructions here.

G0WFV’s Note: Since writing my original post, I have had a change of heart regarding “best practice” when installing MMDVMHost.  You are best off using the bleeding edge code (or at least a labelled release from GitHub) rather than grabbing the files from the group.  The files on Yahoo are now a bit out of date – at the time of writing this note, the file are dated Sep 2016 – considerably old firmware and host software which will be missing a lot of innovations and bug fixes!

Whilst this HOW-TO deals with installing MMDVMHost, the MMDVM firmware can be also grabbed from GitHub – if you do so, ensure you grab matching versions!  Failure to do so can and has lead to unexpected operation of your repeater/hotspot!  Jon tends to label both MMDVMHost and the MMDVM firmware on the same day; look for git commits in MMDVMHost and MMDVM with the comment “Bump the version date” or similar on the same date – these will be matching release versions.

OR (if you are adventurous!) just grab the latest commits of both (they should be compatible with each other!) I have re-written my post to reflect the process I now use to install or update MMDVMHost … 

Install git …

sudo apt-get update
sudo apt-get install git

Grab the source code …

cd ~/Downloads
git clone https://github.com/g4klx/MMDVMHost.git
cd MMDVMHost

If you haven’t already, install make, gcc and other development tools…

sudo apt-get update
sudo apt-get install build-essential

Build MMDVMHost…

cd MMDVMHost
make

Edit MMDVM.ini to suit…

nano MMDVM.ini

Remove the getty process from /dev/ttyAMA0 (Caution: the process is different for Raspbian Wheezy and Raspbian Jessie!)

In Raspbian Wheezy…

nano /etc/inittab

Look for the line that spawns a getty on /dev/ttyAMA0 and comment it out (# at the start of the line).

In Raspbian Jessie…

Stop the getty spawning on /dev/ttyAMA0…

sudo systemctl stop serial-getty@ttyAMA0.service

Prevent it from starting on boot…

sudo systemctl disable serial-getty@ttyAMA0.service

Remove the bootup info from /dev/ttyAMA0 by editing /boot/cmdline.txt and removing references to /dev/ttyAMA0 or serial0 (same process in both Wheezy and Jessie as far as I can tell)…

nano /boot/cmdline.txt

On the Raspberry Pi 3 ONLY, disable built-in Bluetooth…

sudo bash -c 'echo "dtoverlay=pi3-disable-bt" >> /boot/config.txt'

Reboot the Rpi…

sudo reboot

Check group ownership of /dev/ttyAMA0 – it should be dialout and not tty by this stage!  Add yourself to the dialout group…

ls -l /dev/ttyAMA0
crw-rw---T 1 root dialout 204, 64 Mar 10 13:47 /dev/ttyAMA0
sudo usermod –a –G dialout <username>

Logout and log back in.

Change directory back to where you built MMDVMHost and run it…

cd <path>
./MMDVMHost MMDVM.ini

Advertisements

70 thoughts on “HOW-TO MMDVMHost with a DVMega

  1. Hi my friend, thank you for this instruction.

    I followed everything to the letter and is running.

    I see the process when running shows me the DV-MEGA module DualBand -> MMDVM protocol version: 1 description: DVMEGA HR2.28

    Master noted that connects to BM:
    Host MMDVM Repeater 7345007 – 380705522, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

    L am making process of connecting to a reflector is as always:
    Making a private call by TG reflector 9 to X, but the dashboard that do not see the connection.

    And the program is executed to make here:
    I: 05/01/2016 18: 43: 56,871 Loaded 34339 DMR Ids to the callsign lookup table
    M: 01.05.2016 18: 43: 56,872 Set to Idle Mode
    M: 05.01.2016 18: 43: 59,518 into the master successfully Logged

    That may be missing or wrong?

    Thank you

    Like

      1. Hi and thank for replay,
        Thanks again for this guide. The problem I had was due to a human error in programming the freq. It works great for access to Reflectors and TG in BrandMeister. I have left is to test in sending and receiving messages (SMS)

        Like

  2. I’m curious about the LCD options in the .ini file. Are there any guides for configuration and wiring to the Raspberry Pi 2/3 for this? Thanks!

    Like

    1. It all depends on which one you want? I use a simple HD44780 with mine but it takes a bit of wiring up as the DVmega is already on the GPIO so had to get a breakout board to make life easier.

      The other screens use USB so connect fairly easily (I’ve no personal experience of them!)

      There are no guides as far as screens with MMDVM go, but if you look for guides for the HD44780 and wiringPi they work.

      Don’t blindly follow a guide, try to understand it and what you’re wiring where, else you can damage things – I broke my first screen by wiring something wrong!

      Like

  3. I understood that it makes DMR connection, also. Is it correct?
    Is it possible to connect C4FM like DV4mini USB Stack, also?
    I want to know the configuration(including program in Raspberry pi) between LCD display and GPIO.

    Like

    1. Yes.

      No. Not at this time.

      Have a look at HD44780 and the wiringPi library – all the info is based on that, although you need to be creative with how you get to the GPIO for the LCD as the DVMega is already on it, right?! (Hint: use a breakout board!)

      Like

  4. I followed the instructions exactly and ran through them multiple times, but I keep getting “segmentation fault” when I try to execute ./MMDVMHost MMDVM.ini.

    Any ideas or help would be greatly appreciated! Using a single band DV-Mega.

    Thanks!

    Liked by 1 person

  5. When I receive, it is very good and no problems. But When I transmit my signal by pushing the PTT, MMDVMHost with DVMega shows me error message as follows,
    “D-Star, non repeater RF header received from (callsign)”
    What ? Where are problems?

    Like

      1. I have the same issue as described above, I have had the hotspot running previously on western dstars image and not had issues with my radio settings. Can you elaborate further on the correct settings? Thanks Thomas.

        Like

      2. Firstly, ircddbgateway, MMDVMHost and your radio all have to match as far as the module is concerned.

        Secondly you still need to treat the DVMega as a repeater when co figuring the channel – set it to duplex but with a shift of 0 (zero) else the repeater functions of the radio do not work and it thinks you’re having a simple QSO.

        Like

  6. Hi – thanks for the guide – everything is working fine here with a DV Mega on Pi3 with MMDVM. It connects to reflector 4400 on boot by default, and I can change to other reflectors by making a direct call to the manual ID number – eg: 4401, 44100 etc.My question is about how to access talkgroups directly – if I see someone talking on Talkgroup 31268, on the Brandmeister hoseline, how can I connect my radio to it through MMDVM? TG 31268 is not a reflector as I understand, but a standard talkgroup, supposedly generated on the fly when first called. How can I access it through my radio and MMDVM? A private call to 31268 (or anything not starting 4) fails.

    Like

  7. Help please. When I execute the program I get an error. It says:

    Can not open device – \\.\COM3

    Then it stop.

    What might I have done wrong.

    Thank you

    Like

  8. I meant to add in that it is a RPi2 and the DV Mega is the dualband version. I have also tried changing the “3” to 1, 2 and 4 and still get the same error. I have tried doing a search on Google for how to find the serial port number and the search came up with nothing. Maybe I’m using the wrong kind of search.

    Thank you

    Like

  9. My logging. Think I’m on the right track. DVMega on Arduino Uno-board.

    I: 2016-08-10 12:40:43.165 This software is for use on amateur radio networks only,
    I: 2016-08-10 12:40:43.167 it is to be used for educational purposes only. Its use on
    I: 2016-08-10 12:40:43.167 commercial networks is strictly prohibited.
    I: 2016-08-10 12:40:43.168 Copyright(C) 2015, 2016 by Jonathan Naylor, G4KLX and others
    M: 2016-08-10 12:40:43.168 MMDVMHost-20160624 is starting
    I: 2016-08-10 12:40:43.169 General Parameters
    I: 2016-08-10 12:40:43.169 Callsign: PA5K
    I: 2016-08-10 12:40:43.169 Duplex: no
    I: 2016-08-10 12:40:43.170 Timeout: 180s
    I: 2016-08-10 12:40:43.170 RF Mode Hang: 10s
    I: 2016-08-10 12:40:43.170 Net Mode Hang: 3s
    I: 2016-08-10 12:40:43.170 D-Star: enabled
    I: 2016-08-10 12:40:43.171 DMR: enabled
    I: 2016-08-10 12:40:43.171 YSF: enabled
    I: 2016-08-10 12:40:43.171 Modem Parameters
    I: 2016-08-10 12:40:43.172 Port: /dev/ttyACM0
    I: 2016-08-10 12:40:43.172 RX Invert: no
    I: 2016-08-10 12:40:43.173 TX Invert: yes
    I: 2016-08-10 12:40:43.173 PTT Invert: no
    I: 2016-08-10 12:40:43.174 TX Delay: 100ms
    I: 2016-08-10 12:40:43.174 DMR Delay: 0 (0.0ms)
    I: 2016-08-10 12:40:43.175 RX Level: 50%
    I: 2016-08-10 12:40:43.175 D-Star TX Level: 50%
    I: 2016-08-10 12:40:43.175 DMR TX Level: 50%
    I: 2016-08-10 12:40:43.176 YSF TX Level: 50%
    I: 2016-08-10 12:40:43.176 RX Frequency: 435000000Hz
    I: 2016-08-10 12:40:43.176 TX Frequency: 435000000Hz
    I: 2016-08-10 12:40:43.177 Osc. Offset: 0ppm
    M: 2016-08-10 12:40:43.177 Opening the MMDVM
    E: 2016-08-10 12:40:43.177 Cannot open device – /dev/ttyACM0

    Like

    1. Check your Arduino is being recognised by the host…

      ls -ltr /dev/tty*

      It looks as though either the Arduino isn’t being recognised in which case /dev/ttyACM0 will not appear in the output from the ls above, or it’s in use by something else.

      Like

      1. I’ve reached the same error message – Cannot open device – /dev/ttyACM0. I don’t have a /dev/ttyACM0, so I guess something isn’t right. You instructions above all went without errors. Apart from ttyAMA0 Group Ownership wasn’t dialout, it was tty, so I changed that.
        Also – I have the DVMega directly attached to a RPi2 – what’s an Arduino got to do with it, as in your comment?

        TIA,
        Tony…

        Like

      2. Have a look at what you wrote and then ask yourself the question what am i doing wrong …. You’ve answered your own question in a round about way.

        Incidentally, if ttyMA0 is still owned by group TTY then it is still being used by the boot up info at start. Changing ownership to dial out will not change this, you need to disable the output as per the instructions.

        Like

  10. what am I doing wrong here is my command and returned response

    pi@raspberrypi:~ $ sudo usermod –a –G dialout pi
    Usage: usermod [options] LOGIN

    Options:
    -c, –comment COMMENT new value of the GECOS field
    -d, –home HOME_DIR new home directory for the user account
    -e, –expiredate EXPIRE_DATE set account expiration date to EXPIRE_DATE
    -f, –inactive INACTIVE set password inactive after expiration
    to INACTIVE
    -g, –gid GROUP force use GROUP as new primary group
    -G, –groups GROUPS new list of supplementary GROUPS
    -a, –append append the user to the supplemental GROUPS
    mentioned by the -G option without removing
    him/her from other groups
    -h, –help display this help message and exit
    -l, –login NEW_LOGIN new value of the login name
    -L, –lock lock the user account
    -m, –move-home move contents of the home directory to the
    new location (use only with -d)
    -o, –non-unique allow using duplicate (non-unique) UID
    -p, –password PASSWORD use encrypted password for the new password
    -R, –root CHROOT_DIR directory to chroot into
    -s, –shell SHELL new login shell for the user account
    -u, –uid UID new UID for the user account
    -U, –unlock unlock the user account
    -v, –add-subuids FIRST-LAST add range of subordinate uids
    -V, –del-subuids FIRST-LAST remove range of subordinate uids
    -w, –add-subgids FIRST-LAST add range of subordinate gids
    -W, –del-subgids FIRST-LAST remove range of subordinate gids
    -Z, –selinux-user SEUSER new SELinux user mapping for the user account

    pi@raspberrypi:~ $

    Like

  11. Hello, I have just about managed to get my hotspot up and running and have made contacts on both DMR and Dstar, fantastic!
    One question i have is that when previously running the hotspot dedicated to Dstar on an image from Western Dstar i used to get announcments when linking or unlinking reflectors, i dont get this anymore with this setup.
    So question is should I? Or can I enable it?

    Many Thanks for any response.

    Like

  12. Using Jessie with Pi 3 B, when I run MMDVM it halts with the error message I checked with ls -ltr /dev/tty* and the ttyACM0 is on the list. Did Chmod 777 on /dev/ttyACM0. No luck. Any suggestions would be appreciated.

    Like

  13. I’ve got the DV Mega working and connected to Brandmeister, which is pretty cool.

    How can I set MMDVMHost to auto-connect to a certain reflector at start-up?

    Also, is there a way NOT to get TG 3100 to come through by default, all the time?

    Thanks & 73

    Like

  14. I have configured MMDVM.ini to work with DVMEGA DMR only but when try to open MMDVM I’ve got the following message: Unable to read the firmware version after six attempts
    I am not able to resolve, perhaps someone can help me ?

    Like

  15. using a dvmega dual band and pi3
    run through the setup and click MMDVM and it opens and immediately closes.
    had to change the port from ttyACM0 to ttyAMA0
    not it will open for about 15 seconds and then close.
    the log says cannot read firmware version closed after 6 tries.

    any ideas?

    Like

    1. any luck with this I had everything working then the next day I had the same thing MMDVM would open then immediately close

      Like

  16. Anyone know why only 1 out of 5 transmissions works. they keep getting jumbled up.
    received RF header for wrong repeater ( BW6FBW) from W6FBW
    M: 2016-11-19 06:41:37.129 D-Star, received RF header from W6FBW /8OAD to CQCQCQ
    M: 2016-11-19 06:41:45.391 D-Star, received RF header from W6FBW /8OAD to CQCQCQ
    M: 2016-11-19 06:41:45.860 D-Star, received RF end of transmission, 0.5 seconds, BER: 0.0%
    M: 2016-11-19 06:42:10.470 D-Star, received RF header from W6FBW /8OAD to REF014CL
    M: 2016-11-19 06:42:11.240 D-Star, received RF header for wrong repeater ( BW6FBW) from W6FBW
    M: 2016-11-19 06:42:30.805 D-Star, received RF header from W6FBW /8OAD to REF014CL
    M: 2016-11-19 06:44:14.854 D-Star, received RF header for wrong repeater ( BW6FBW) from W6FBW
    M: 2016-11-19 06:44:17.933 D-Star, received RF header from W6FBW /8OAD to REF014CL
    M: 2016-11-19 06:44:17.938 D-Star link status set to “Linking to REF014 C ”
    M: 2016-11-19 06:44:18.030 D-Star link status set to “Linked to REF014 C “

    Like

  17. Sometimes, when I press transmit on D-STAR, I get “received RF header for wrong repeater (X BKB5XX)”. But then, if I transmit again, changing nothing, it works.

    What gives? What have I misconfigured on my radio that it’s sending that packet first?

    Like

  18. I have MMDVM running and connected to Brandmeister server but nothing on RF side, no beacon or data. Any idea what could cause that. DV-Mega attached directly to a Pi2

    Like

    1. Removed and refitted the DV-Mega board and it now transmits. Had tested using Western image first to check beacon counter which didn’t move. An IT fix of off and on again and it’s fine.

      Like

  19. Hi Tony,
    I wonder if you can advise me.
    Does the DVMega uhf support slot1 and slot2 on the hotspot, using rasp-pi and MMDVMHost
    I have tried with editing MMDVM.ini set it to Duplex
    what is the Daemon setting for ? I cant find any info on that

    and under [DMR settings]
    set slot1=1 and slot2=2
    I have programmed my md380 for slot1 and slot2 but I think I maybe missing something.
    As it doesn’t see it as a repeater,
    In other words you get the little blue arrow ->| on the md380 display which signifies simplex
    colourcodes all match.
    So what am I missing? just a little confused that’s all. .
    When someone is on 4400 chatting away I cant change reflector group.
    So I was thinking if I can change slots I can then change to another group?
    Do I have this correct or am I barking up the wrong tree, or just barking mad? LOL
    Cheers Tony 73 Mark G0NMY

    Like

    1. The dvmega is a simplex device.

      You must set duplex=0, slot1=0, slot2=1 for it to work.

      The 0 and 1 are boolean (on or off)

      Additionally, you need to set your Rx and Tx freqs to the same value.

      Ignore the daemon setting for now, it runs just fine without it.

      Like

  20. OK thanks Tony that explains it nicely I did find info on the Daemon option actually in the MMDVMHost directory.
    I should of looked there first lol.
    Ok so I will edit my MMDVM.ini to turn slot one off and slot 2 on.
    the TX and RX frequencies are the same so nothing to change there. I was just under the illusion that it could be made into a repeater.
    Thanks for the quick reply. I do understand it now. I must have been having a senior moment, they seem to be multiplying.
    73 Tony thanks again
    Mark G0NMY

    Like

  21. Where do I find documentation that clearly explains what each setting in MMDM.ini does?

    Where do I find the correct DMR network IP, port, password ?

    Is there something somewhere that actually explains clearly step by step what happens from the DMR transceiver -> DVMEGA -> DMR n/w etc ?

    I’ve reviewed several sources of information on the web and they are either out of date, self contradicting, get DSTAR + DMR mixed up, or simply don’t work.

    Thanks,

    KG6ZIC

    Like

    1. I understand your frustration. There is no such documentation. MMDVMHost has been a moving target that has been difficult to hit (the pace of development has been such that anything written has been, as you have discovered, superceded very quickly!)

      Just out of interest, are you able to let me know which bracket my instructions fall into with regards to your criticism and and I might be able to tweak them to be clearer.

      Like

  22. I have a pi3 which will run an ambe3000 (from DVMEGA) on an arduino mega connected with USB on the pi. How can I check MMDVM is running? I get a warning at boot in the bootlog: Cannot add dependency job for unit mmdvmhost.timer, ignoring: Unit mmdvmhost.timer failed to load: Invalid argument.

    Thanks in advance

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s