MMDVM Hotspot

MMDVM Hotspot

This is probably the right article if you intend to compile your MMDVM tools by yourself.

This page is currently under construction. There might be still some errors or incorrect information – I’ll update when I got more time.

The newer setup on my RaspberryPi 4.

Configuration

MMDVM.ini

[General]
Callsign=OE7DRT
Id=2327180
#Timeout=600
Timeout=3600
Duplex=1
RFModeHang=300
NetModeHang=300
Display=None
Daemon=0

[Info]
RXFrequency=431100000
TXFrequency=438700000
Power=1
# 47.073253
# 10.974632
Latitude=47.073253
Longitude=10.974632
#Latitude=47.073242
#Longitude=10.974577
Height=0
Location=Laengenfeld
Description=Austria
URL=https://oe7drt.com/projects/mmdvm-hotspot/

[Log]
DisplayLevel=2
FileLevel=2
FilePath=/var/log/mmdvm
FileRoot=MMDVM

[CW Id]
Enable=0
Time=10

[DMR Id Lookup]
File=/usr/local/etc/DMRIds.dat
Time=24

[NXDN Id Lookup]
File=/usr/local/etc/NXDN.csv
Time=24

[Modem]
Port=/dev/ttyAMA0
TXInvert=1
RXInvert=0
PTTInvert=0
TXDelay=100
#RXOffset=-200
#TXOffset=0
TXOffset=225
RXOffset=50
DMRDelay=0
RXLevel=50
TXLevel=50
RXDCOffset=0
TXDCOffset=0
RFLevel=100
CWIdTXLevel=50
D-StarTXLevel=50
DMRTXLevel=50
YSFTXLevel=50
P25TXLevel=50
NXDNTXLevel=50
POCSAGTXLevel=50
RSSIMappingFile=/usr/local/etc/RSSI.dat
Trace=0
Debug=0

[Transparent Data]
Enable=0
RemoteAddress=127.0.0.1
RemotePort=40094
LocalPort=40095
SendFrameType=1

[UMP]
Enable=0
Port=/dev/ttyACM1

[D-Star]
Enable=0
Module=B
SelfOnly=0
AckReply=1
AckTime=750
ErrorReply=1
RemoteGateway=0
ModeHang=20
AckMessage=0

[DMR]
Enable=1
Beacons=0
BeaconInterval=60
BeaconDuration=3
ColorCode=3
SelfOnly=0
EmbeddedLCOnly=0
DumpTAData=1
CallHang=3
TXHang=4
#CallHang=4
#TXHang=5
ModeHang=20
OVCM=0
Id=232718000

[System Fusion]
Enable=1
LowDeviation=0
SelfOnly=0
TXHang=4
RemoteGateway=0
ModeHang=20

[P25]
Enable=0
NAC=293
SelfOnly=0
OverrideUIDCheck=0
RemoteGateway=0
ModeHang=20

[NXDN]
Enable=0
RAN=1
RemoteGateway=0
SelfOnly=0
ModeHang=20

[POCSAG]
Enable=1
Frequency=438025000

[D-Star Network]
Enable=0
GatewayAddress=127.0.0.1
GatewayPort=20010
LocalPort=20011
Debug=0
ModeHang=20

[DMR Network]
Enable=1
Address=89.185.97.34
Port=55555
#Jitter=0
Jitter=1000
Password="none"
Slot1=1
Slot2=1
Debug=0
ModeHang=20
Options="StartRef=4197;RelinkTime=120;UserLink=1;TS1_1=232;TS2_1=232;TS2_2=2327;"

[System Fusion Network]
Enable=1
LocalAddress=127.0.0.1
LocalPort=3200
GatewayAddress=127.0.0.1
GatewayPort=4200
Debug=0
ModeHang=20

[P25 Network]
Enable=0
GatewayAddress=127.0.0.1
GatewayPort=42020
LocalPort=32010
Debug=0
ModeHang=20

[NXDN Network]
Enable=0
LocalAddress=127.0.0.1
LocalPort=14021
GatewayAddress=127.0.0.1
GatewayPort=14020
Debug=0
ModeHang=20

[POCSAG Network]
Enable=1
LocalAddress=127.0.0.1
LocalPort=3800
GatewayAddress=127.0.0.1
GatewayPort=4800
ModeHang=5
Debug=0

[TFT Serial]
Port=modem
Brightness=50

[HD44780]
Rows=2
Columns=16
Pins=11,10,0,1,2,3
I2CAddress=0x20
PWM=0
PWMPin=21
PWMBright=100
PWMDim=16
DisplayClock=1
UTC=0

[Nextion]
Port=/dev/ttyNextionDriver
#Port=/dev/ttyUSB0
#Port=modem
Brightness=50
DisplayClock=1
UTC=0
ScreenLayout=4
IdleBrightness=50

[NextionDriver]
Port=/dev/ttyUSB0
DataFilesPath=/usr/local/etc/
LogLevel=0
GroupsFile=groups.txt
DMRidFile=stripped.csv
#DMRidDelimiter=,
#DMRidId=1
#DMRidCall=2
#DMRidName=3
#DMRidX1=4
#DMRidX2=5
#DMRidX3=7
ShowModeStatus=0
RemoveDim=1
WaitForLan=0
SleepWhenInactive=0

[OLED]
Type=3
Brightness=0
Invert=0
Scroll=0
Rotate=0
Cast=0
LogoScreensaver=0

[LCDproc]
Address=localhost
Port=13666
DimOnIdle=0
DisplayClock=1
UTC=0

[Lock File]
Enable=0
File=/tmp/MMDVMHost.lock

[Mobile GPS]
Enable=0
Address=127.0.0.1
Port=7834

[Remote Control]
Enable=0
Port=7642

YSFGateway.ini

[General]
Callsign=OE7DRT
Suffix=RPT
# Suffix=ND
Id=2327180
RptAddress=127.0.0.1
RptPort=3200
LocalAddress=127.0.0.1
LocalPort=4200
WiresXMakeUpper=1
WiresXCommandPassthrough=1
Debug=0
Daemon=0

[Info]
RXFrequency=431100000
TXFrequency=438700000
Power=1
Latitude=47.073253
Longitude=10.974632
Height=0
Name=OE7DRT_YSFGateway
Description=Multi-Mode Repeater Austria, Testing

[Log]
# Logging levels, 0=No logging
DisplayLevel=0
FileLevel=1
FilePath=/var/log/mmdvm
FileRoot=YSFGateway

[aprs.fi]
Enable=1
Server=euro.aprs2.net
Port=14580
Password=******

#[APRS]
#Enable=0
#Address=127.0.0.1
#Port=8673
#Description=APRS Description
#Suffix=Y

[Network]
# Startup=FCS00120
# Startup=Alabama-Link
#Startup=YSF23201
#Startup=FCS23201
Startup=AT-C4FM-Austria
InactivityTimeout=10
Revert=1
Debug=0

[YSF Network]
Enable=1
Port=42000
Hosts=/usr/local/etc/YSFHosts.txt
ReloadTime=60
ParrotAddress=127.0.0.1
ParrotPort=42012
YSF2DMRAddress=127.0.0.1
YSF2DMRPort=42013
YSF2NXDNAddress=127.0.0.1
YSF2NXDNPort=42014
YSF2P25Address=127.0.0.1
YSF2P25Port=42015

[FCS Network]
Enable=1
Rooms=/usr/local/etc/FCSRooms.txt
Port=42001

[GPSD]
Enable=0
Address=127.0.0.1
Port=2947

[Remote Commands]
Enable=0
Port=6073

DAPNETGateway.ini

[General]
Callsign=OE7DRT

# Categories / Rubrics
#
# 0327180 My RIC
# 1230001 APRS, Satelliet, DX-cluster, Solar, Events (E-Skips...)
#    1001 DAPNET News
#    1027 OE-Msg
#    1017 OE7-Msg
#    1030 2m Relais
#    1031 70cm Relais Tirol
#    1032 23cm Relais Tirol
#    1033 DMR-Relais Tirol
#    1041 KATWARN Meldungen Tirol
#    1061 Wasserpegel Tirol
#    1051 Satelliten (ISS...)
#    1060 DAPNET Statistiken
#    1080 OE7-WX
#    1081 ZAMG-OE7 (Wetterwarnungen)
#    1082 Hilfsorganisationen

#WhiteList=327180,1081,1082,1041,1051,1230001,224
WhiteList=327180,1081,1082,1041,1230001,224
#BlackList=8,200,208,216,1060,2504,4520,4512
#BlacklistRegexfile=/tmp/blregexes.txt
#WhitelistRegexfile=/tmp/wlregexes.txt
RptAddress=127.0.0.1
RptPort=3800
LocalAddress=127.0.0.1
LocalPort=4800
Daemon=0

[Log]
# Logging levels, 0=No logging
DisplayLevel=1
FileLevel=1
FilePath=/var/log/mmdvm
FileRoot=DAPNETGateway

[DAPNET]
Address=dapnet.afu.rwth-aachen.de
Port=43434
AuthKey=25uuSBSyEZUohQqrWn0H
SuppressTimeWhenBusy=1
Debug=1

/etc/crontab

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed
17 *  * * * root    cd / && run-parts --report /etc/cron.hourly
25 6  * * * root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6  * * 7 root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6  1 * * root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

# Collect statistics about system load, temperature
#59 * * * * rsync -ah /var/log/mmdvm/system-stats-fine.csv dominic@192.168.178.4:/volume1/NetBackup/Hambox/var/log/mmdvm/system-stats-fine.csv
#59 *   * * *   pi  cp -af /var/log/mmdvm/system-stats-fine.csv ~/
#*/10 *   * * *   pi  /home/pi/bin/stats.sh >> /var/log/mmdvm/system-stats-fine.csv

# Update Ham databases
#30 4   * * * root  /var/www/html/database/dbupdate.sh > /dev/null 2>&1
30 4  * * * root  curl --fail -o /usr/local/etc/DMRIds.dat -s http://www.pistar.uk/downloads/DMRIds.dat
32 4  * * * root /usr/local/sbin/YSFHostsupdate.sh 1> /dev/null 2>&1

# Regular shutdown of hotspot on regular work days
##30  6  * * 1-6 root  /usr/local/sbin/hotspot off
##15 18  * * 1-5 root  /usr/local/sbin/hotspot on
##0  12  * * 6   root  /usr/local/sbin/hotspot on

# Restart hotspot at 5:00 am
##0   5  * * *   root  /bin/systemctl reboot

# Shrink /var/log
#7 */4  * * * root  /usr/local/sbin/shrinklog > /dev/null 2>&1

# COVID-19 Runde
#58 17  * * * root  /home/pi/bin/covidrunde start > /dev/null 2>&1
#5  19  * * * root  /home/pi/bin/covidrunde stop  > /dev/null 2>&1

For backup: DMRGateway.ini

I know, I don’t use DMRGateway any more but ffs, I need that configuration somewhere printed ;-)

[General]
RptAddress=127.0.0.1
RptPort=62032
LocalAddress=127.0.0.1
LocalPort=62031
RuleTrace=0
Daemon=0
Debug=0
RFTimeout=20
NetTimeout=20

[Log]
DisplayLevel=1
FileLevel=1
#FilePath=/var/log/MMDVM
#FilePath=/home/mmdvm/log
FilePath=/var/log/mmdvm
FileRoot=DMRGateway

[Voice]
Enabled=1
Language=en_GB
Directory=/usr/local/etc/DMR_Audio

[Info]
Enabled=0
RXFrequency=430425000
TXFrequency=438025000
Power=1
Latitude=47.073253
Longitude=10.974632
Height=0
Location="Laengenfeld"
Description="Austria"
URL=https://www.qrz.com/db/oe7drt

[XLX Network]
Startup=950
Enabled=0
File=/usr/local/etc/XLXHosts.txt
Port=62030
Password=passw0rd
ReloadTime=60
Slot=2
TG=6
Base=64000
Relink=60
Debug=0
Id=2327180
UserControl=1

[DMR Network 1]
Enabled=1
Address=94.199.173.125
Port=62031
TGRewrite0=2,8,2,8,1
PCRewrite0=2,84000,2,84000,1001
TypeRewrite0=2,9990,2,9990
SrcRewrite0=2,84000,2,8,1001
PassAllPC0=1
PassAllTG0=1
PassAllPC1=2
PassAllTG1=2
Password="********"
Debug=0
Id=232718003
Name=BM_Austria_2321

[DMR Network 2]
Enabled=1
Address=89.185.97.34
Port=55555
TGRewrite0=1,1,1,1,7
TGRewrite1=1,10,1,10,80
TGRewrite2=1,100,1,100,100
TGRewrite3=1,232,1,232,1
TGRewrite4=2,232,2,232,1
TGRewrite5=2,8181,2,8181,9
TGRewrite6=2,8191,2,8191,9
TGRewrite7=2,9,2,9,1
PCRewrite0=1,9055,1,9055,6
PCRewrite1=2,9055,2,9055,6
PCRewrite6=2,4000,2,4000,1001
Password="PASSWORD"
Debug=0
Id=232718004
Name=DMR+_IPSC2-OE-DMO
# last original line
#Options="StartRef=4197;RelinkTime=15;UserLink=1;TS1_1=110;TS2_1=232;"
Options="StartRef=4197;RelinkTime=15;UserLink=1;TS1_1=232;TS1_2=110;TS1_3=20;TS1_4=;TS1_5=;TS2_1=232;TS2_2=;TS2_3=;TS2_4=;TS2_5=;"
# COVID-19 Updated rules (adds TG6 and TG7)
#Options="StartRef=4197;RelinkTime=15;UserLink=1;TS1_1=232;TS1_2=110;TS1_3=20;TS1_4=6;TS1_5=7;TS2_1=232;TS2_2=;TS2_3=;TS2_4=;TS2_5=;"

[DMR Network 3]
Enabled=0
Name=DMR2YSF_Cross-over
Id=2327180
Address=127.0.0.1
Port=62033
Local=62034
TGRewrite0=2,7000001,2,1,999998
SrcRewrite0=2,1,2,7000001,999998
PCRewrite0=2,7000001,2,1,999998
Password=PASSWORD
Location=0
Debug=0

Software / Firmware

Config.h (older version; test version)

/*
 *   Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#if !defined(CONFIG_H)
#define  CONFIG_H

// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
// #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
//#define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
#define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS

// Enable ADF7021 support:
#define ENABLE_ADF7021

// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
#define DUPLEX

// TCXO of the ADF7021
// For 14.7456 MHz:
//#define ADF7021_14_7456
// For 12.2880 MHz:
#define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain:
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
//#define STM32_USB_HOST
// #define STM32_I2C_HOST

// I2C host address:
#define I2C_ADDR 0x22

// Enable mode detection:
#define ENABLE_SCAN_MODE

// Send RSSI value:
#define SEND_RSSI_DATA

// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
// #define SERIAL_REPEATER
// #define SERIAL_REPEATER_BAUD 115200

// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1

// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE

// Disable mode LEDs blink during scan mode:
#define QUIET_MODE_LEDS

// Engage a constant or descreet Service LED mode once repeater is running
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
#define DISCREET_SRV_LED_INVERTED

// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS

// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS

// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET

// Enable modem debug messages
// #define ENABLE_DEBUG

// Disable frequency bands check
// #define DISABLE_FREQ_CHECK

// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN

// Enable UDID feature
// #define ENABLE_UDID

#endif

Config.h (newer version, actual from today: 23rd August 2020)

/*
 *   Copyright (C) 2017,2018,2019 by Andy Uribe CA6JAU
 *
 *   This program is free software; you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation; either version 2 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program; if not, write to the Free Software
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#if !defined(CONFIG_H)
#define  CONFIG_H

// Select one board (STM32F103 based boards)
// 1) ZUMspot RPi or ZUMspot USB:
// #define ZUMSPOT_ADF7021
// 2) Libre Kit board or any homebrew hotspot with modified RF7021SE and Blue Pill STM32F103:
//#define LIBRE_KIT_ADF7021
// 3) MMDVM_HS_Hat revisions 1.1, 1.2 and 1.4 (DB9MAT & DF2ET)
// #define MMDVM_HS_HAT_REV12
// 4) MMDVM_HS_Dual_Hat revisions 1.0 (DB9MAT & DF2ET & DO7EN)
#define MMDVM_HS_DUAL_HAT_REV10
// 5) Nano hotSPOT (BI7JTA)
// #define NANO_HOTSPOT
// 6) NanoDV NPi or USB revisions 1.0 (BG4TGO & BG5HHP)
// #define NANO_DV_REV10
// 7) D2RG MMDVM_HS RPi (BG3MDO, VE2GZI, CA6JAU)
// #define D2RG_MMDVM_HS

// Enable ADF7021 support:
#define ENABLE_ADF7021

// Enable full duplex support with dual ADF7021 (valid for homebrew hotspots only):
#define DUPLEX

// TCXO of the ADF7021
// For 14.7456 MHz:
//#define ADF7021_14_7456
// For 12.2880 MHz:
#define ADF7021_12_2880

// Configure receiver gain for ADF7021
// AGC automatic, default settings:
#define AD7021_GAIN_AUTO
// AGC automatic with high LNA linearity:
// #define AD7021_GAIN_AUTO_LIN
// AGC OFF, lowest gain: 
// #define AD7021_GAIN_LOW
// AGC OFF, highest gain:
// #define AD7021_GAIN_HIGH

// Host communication selection:
#define STM32_USART1_HOST
//#define STM32_USB_HOST
// #define STM32_I2C_HOST

// I2C host address:
#define I2C_ADDR 0x22

// Enable mode detection:
#define ENABLE_SCAN_MODE

// Send RSSI value:
#define SEND_RSSI_DATA

// Enable Nextion LCD serial port repeater on USART2 (ZUMspot Libre Kit and ZUMspot RPi):
// #define SERIAL_REPEATER
// #define SERIAL_REPEATER_BAUD 115200

// Enable Nextion LCD serial port repeater on USART1 (Do not use with STM32_USART1_HOST enabled):
// #define SERIAL_REPEATER_USART1

// Enable P25 Wide modulation:
// #define ENABLE_P25_WIDE

// Disable mode LEDs blink during scan mode:
#define QUIET_MODE_LEDS

// Engage a constant or descreet Service LED mode once repeater is running 
// #define CONSTANT_SRV_LED
// #define CONSTANT_SRV_LED_INVERTED
// #define DISCREET_SRV_LED
#define DISCREET_SRV_LED_INVERTED

// Use the YSF and P25 LEDs for NXDN
// #define USE_ALTERNATE_NXDN_LEDS

// Use the D-Star and DMR LEDs for POCSAG
// #define USE_ALTERNATE_POCSAG_LEDS

// Enable for RPi 3B+, USB mode
// #define LONG_USB_RESET

// Enable modem debug messages
#define ENABLE_DEBUG

// Disable frequency bands check
// #define DISABLE_FREQ_CHECK

// Disable frequency restrictions (satellite, ISS, etc)
// #define DISABLE_FREQ_BAN

// Enable UDID feature
#define ENABLE_UDID

#endif