DS1NMA Blog

집에 설치된 라즈베리파이 서버가 SD카드로 OS 파티션을 구성하니 시간이 지나면 갑자기 메모리가 손상되는 일이 자주 있다. 1년에 4~5번꼴로 삭제와 포맷, 재설치가 반복이 되기 때문에 현재 라즈베리파이 서버에 D-STAR Hotspot 기능과 IP-PBX, Web server, NAS Storage Server가 구동되고 있어 이런 많은 구성을 두는 나로선 상당히 피곤하다.

 

라즈베리파이4 에서는 bootloader 차원에서 USB부팅이 가능하여 앞으로는 OS를 SD카드를 사용하지 않고 USB로 연결된 안정적인 1TB HDD를 사용하기로 하여 새로 구성을 하면서 설치과정을 정리해 보았다.

Destinate : Raspberry Pi 4 4GB + DVMega Board , after installed complete Asterisk 16 and FreePBX 15

 

● Initialize

# systemctl stop serial-getty@ttyAMA0.service
# systemctl disable serial-getty@ttyAMA0.service 

# nano /boot/cmdline.txt

‘console=serial0,115200’  삭제

 

# nano /boot/config.txt

dtoverlay=disable-bt 추가

 

● Install MMDVMHost with compile

# apt-get install git screen

 

# cd /tmp                                                                                                                        → if you use HD44780

# w get https://project-downloads.drogon.net/wiringpi-latest.deb     → if you use HD44780

# sudo dpkg -i wiringpi-latest.deb                                                                     → if you use HD44780

(Raspberry Pi4 기종이 apt repository의 WiringPi에서는 지원하지 않아 최신버전 2.52 패키지로 설치해야 HD44780 출력이 동작함, http://wiringpi.com/wiringpi-updated-to-2-52-for-the-raspberry-pi-4b/)

 

# cd /opt
# git clone https://github.com/g4klx/MMDVMHost.git

# git clone https://github.com/g4klx/MMDVMCal.git

# cd /opt/MMDVMHost

 

# make                                                     → if you use HD44780, don't use make

# make -f Makefile.Pi.HD44780      → if you use HD44780, execuate this command.

 

# nano MMDVM.ini

[General]

Callsign=DS1NMA

Id=450371

#Timeout=180

Duplex=1

# ModeHang=10

RFModeHang=10

NetModeHang=3

Display=HD44780

Daemon=0

 

[Info]

RXFrequency=432380000

TXFrequency=437380000

Power=1

Latitude=0.0

Longitude=0.0

Height=0

Location=Seoul, Korea

Description=DS1NMA Repeater

URL=rep.kkit.kr

 

[Log]

# Logging levels, 0=No logging

DisplayLevel=1

FileLevel=2

FilePath=/var/log/MMDVM

FileRoot=MMDVM

 

[CW Id]

Enable=1

Time=10

# Callsign=

 

[DMR Id Lookup]

File=/opt/MMDVMHost/DMRIds.dat

Time=24

 

[NXDN Id Lookup]

File=NXDN.csv

Time=24

 

[Modem]

# Port=/dev/ttyACM0

Port=/dev/ttyAMA0

#Port=\\.\COM3

# Protocol=uart

# Address=0x22

TXInvert=1

RXInvert=0

PTTInvert=0

TXDelay=100

RXOffset=0

TXOffset=0

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=RSSI.dat

Trace=0

Debug=0

 

[Transparent Data]

Enable=0

RemoteAddress=127.0.0.1

RemotePort=40094

LocalPort=40095

# SendFrameType=0

 

[UMP]

Enable=0

# Port=\\.\COM4

Port=/dev/ttyACM1

 

[D-Star]

Enable=1

Module=B

SelfOnly=0

AckReply=1

AckTime=750

AckMessage=0

ErrorReply=1

RemoteGateway=0

# ModeHang=10

 

[DMR]

Enable=0

Beacons=0

BeaconInterval=60

BeaconDuration=3

ColorCode=1

SelfOnly=0

EmbeddedLCOnly=0

DumpTAData=1

# Prefixes=234,235

# Slot1TGWhiteList=

# Slot2TGWhiteList=

CallHang=3

TXHang=4

# ModeHang=10

 

[System Fusion]

Enable=0

LowDeviation=0

SelfOnly=0

TXHang=4

#DGID=1

RemoteGateway=0

# ModeHang=10

 

[P25]

Enable=0

NAC=293

SelfOnly=0

OverrideUIDCheck=0

RemoteGateway=0

# ModeHang=10

 

[NXDN]

Enable=0

RAN=1

SelfOnly=0

RemoteGateway=0

# ModeHang=10

 

[POCSAG]

Enable=0

Frequency=439987500

 

[D-Star Network]

Enable=1

GatewayAddress=127.0.0.1

GatewayPort=20010

LocalPort=20011

# ModeHang=3

Debug=0

 

[DMR Network]

Enable=0

Address=44.131.4.1

Port=62031

Jitter=360

# Local=62032

Password=PASSWORD

# Options=

Slot1=1

Slot2=1

# ModeHang=3

Debug=0

 

[System Fusion Network]

Enable=0

LocalAddress=127.0.0.1

LocalPort=3200

GatewayAddress=127.0.0.1

GatewayPort=4200

# ModeHang=3

Debug=0

 

[P25 Network]

Enable=0

GatewayAddress=127.0.0.1

GatewayPort=42020

LocalPort=32010

# ModeHang=3

Debug=0

 

[NXDN Network]

Enable=0

LocalAddress=127.0.0.1

LocalPort=14021

GatewayAddress=127.0.0.1

GatewayPort=14020

# ModeHang=3

Debug=0

 

[POCSAG Network]

Enable=0

LocalAddress=127.0.0.1

LocalPort=3800

GatewayAddress=127.0.0.1

GatewayPort=4800

# ModeHang=3

Debug=0

 

[TFT Serial]

# Port=modem

Port=/dev/ttyAMA0

Brightness=50

 

[HD44780]

Rows=2

Columns=16

 

# For basic HD44780 displays (4-bit connection)

# rs, strb, d0, d1, d2, d3

Pins=11,10,0,1,2,3

 

# Device address for I2C

I2CAddress=0x20

 

# PWM backlight

PWM=0

PWMPin=21

PWMBright=100

PWMDim=16

 

DisplayClock=1

UTC=1

 

[Nextion]

# Port=modem

Port=/dev/ttyAMA0

Brightness=50

DisplayClock=1

UTC=0

#Screen Layout: 0=G4KLX 2=ON7LDS

ScreenLayout=2

IdleBrightness=20

 

[OLED]

Type=3

Brightness=0

Invert=0

Scroll=1

Rotate=0

Cast=0

 

[LCDproc]

Address=localhost

Port=13666

#LocalPort=13667

DimOnIdle=0

DisplayClock=1

UTC=0

 

[Lock File]

Enable=0

File=/tmp/MMDVM_Active.lck

 

[Mobile GPS]

Enable=0

Address=127.0.0.1

Port=7834

 

[Remote Control]

Enable=0

Port=7642

 

 

# cd /opt/MMDVMCal   

# make

 

# nano /lib/systemd/system/mmdvmhost.service

[Unit]

Description=MMDVM Host Service

After=syslog.target network.target

 

[Service]

User=root

WorkingDirectory=/opt/MMDVMHost

ExecStart=/usr/bin/screen -S MMDVMHost -D -m /opt/MMDVMHost/MMDVMHost /opt/MMDVMHost/MMDVM.ini

ExecStop=/usr/bin/screen -S MMDVMHost -X quit

 

[Install]

WantedBy=multi-user.target

 

# chmod 755 /lib/systemd/system/mmdvmhost.service
# ln -s /lib/systemd/system/mmdvmhost.service /etc/systemd/system/mmdvmhost.service

# nano /lib/systemd/system/mmdvmhost.timer

[Timer]
OnStartupSec=60

[Install]

WantedBy=multi-user.target

 

# chmod 755 /lib/systemd/system/mmdvmhost.timer

 

# ln -s /lib/systemd/system/mmdvmhost.timer /etc/systemd/system/mmdvmhost.timer

# systemctl daemon-reload

# systemctl enable mmdvmhost.timer

# reboot

 

● Install ircDDBGateway (get github repository and compile)

 

# apt-get install libwxgtk3.0-dev git build-essential

# cd ~

# git clone --depth 1 https://github.com/g4klx/ircDDBGateway.git

# cd ~/ircDDBGateway

# make

# make install

 

데몬은 /usr/bin/ircddbgatewayd

설정파일은 nano /etc/ircddbgateway

language=6
gatewayCallsign=DS1NMA
latitude=0.0
longitude=0.0
description1=Seoul

description2=Korea

url=http://rep.kkit.kr

ircddbEnabled=1

ircddbHostname=rr.openquad.net

ircddbUsername=ds1nma

ircddbPassword=

aprsEnabled=1

aprsHostname=rotate.aprs2.net

aprsPort=14580

ccsEnabled=1

ccsHost=CCS704

dextraEnabled=1

dextraMaxDongles=3

dplusEnabled=1

dplusMaxDongles=3

dplusLogin=DS1NMA

dcsEnabled=1

remoteEnabled=1

remotePassword=1

remotePort=10022

infoEnabled=1

echoEnabled=1

logEnabled=0

dratsEnabled=1

dtmfEnabled=1

repeaterBand1=B

repeaterType1=0

repeaterAddress1=127.0.0.1

repeaterPort1=20011

frequency1=437.38

offset1=0.0000

rangeKms1=0.0000

agl1=0.000

reflector1=XRF076 B

atStartup1=1

reconnect1=0

latitude1=0.000000

longitude1=0.000000

데이터폴더는 /usr/share/ircddbgateway

로그는 /var/log/ircddbgateway

 

# nano /lib/systemd/system/ircddbgatewayd.service

[Unit]

Description=D-STAR Gateway Daemon

After=network.target

 

[Service]

User=root

ExecStart=/usr/bin/ircddbgatewayd

Restart=on-abort

 

[Install]

WantedBy=multi-user.target

# systemctl daemon-reload

# systemctl start ircddbgatewayd

# systemctl status ircddbgatewayd