r4d10n / mmdvm-sdr

MMDVModem for SDR apps - mmdvm firmware port for running on x86/ARM Linux
28 stars 7 forks source link

mmdvm-sdr


MMDVM firmware by Johnathan Taylor G4KLX - ported for x86 / arm - Tested on x86 Linux / RasPi 3 / PlutoSDR (embedded) / Android 6 (arm - rooted - w/ termux) .


Communicates with MMDVMHost using Virtual PTY (emulated serial port) in Linux. Requires single point modification in MMDVMHost code (disable RTS check).

Duplex/simplex DMR hotspot with a SDR device like the ADALM Pluto or LimeSDR, transmits both timeslots in duplex mode, but can receive only in DMO mode. Other digital modes can be added with minor effort.


Install:

Requires an additional dependency, libzmq for GNU radio integration. Install libzmq and libzmq-dev. On Debian Bullseye:

apt-get install libzmq3-dev libzmq5

Clone, compile mmdvm-sdr

git clone https://github.com/r4d10n/mmdvm-sdr
cd mmdvm-sdr
mkdir build
cd build

For native builds (x86):

cmake ..

For cross-compiling arm (rpitools to be installed):

cmake .. -DCMAKE_TOOLCHAIN_FILE=../Toolchain-rpi.cmake
make

Running the modem binary:

./mmdvm 

It will display the PTY endpoint, which has to be specified in the MMDVHost/MMDVM.ini.

MMDVMHost RTS check disable modification:
  1. Clone MMDVMHost
  2. Modify Modem.cpp around Line 120 from true to false #L120
  3. make
  4. Edit MMDVM.ini - Callsign, ID, Network - refer MMDVM Setup
  5. In [Modem] section, point Modem port to the Virtual PTY (modify as suited), also enable RX invert and TX invery and Debug:
    Port=/home/pi/mmdvm-sdr/build/ttyMMDVM0
    TXInvert=1
    RXInvert=1
    PTTInvert=0
    TXDelay=0
    RXOffset=0
    TXOffset=0
    DMRDelay=0
    RXLevel=100
    TXLevel=100
    RXDCOffset=0
    TXDCOffset=0
    RFLevel=100
    RSSIMappingFile=RSSI.dat
    UseCOSAsLockout=0
    Trace=0
    Debug=1
  6. Run MMDVMHost using the modified MMDVM.ini
    ./MMDVMHost MMDVM.ini

The RRC filtered pre-FM modulation audio samples are sent to GNU radio via ZeroMQ, TCP ports 5990 and 5991 at a rate of 24000 samples per second baseband.


Use cases:

pi_nbfm -freq 144.5 -audio RXSamples.wav -dev 6250 
pi_fm_rds -freq 144.5 -audio RXSamples.wav
leaniiotx -s 1000000.0 --bw 200000.0 -f 144500000.0 -v -d --bufsize 0x8000 --nbufs 32 < RXSamples.iq
sox -t wav RXSamples.wav -r 24000 -c 1 -b 16 -e signed-integer - | fl2k_fm - -f 32000 -s 100e6 -c 44.4781e6 -i 48000

TODO:


Disclaimer

Standard emission warnings apply. Use Filtering while transmitting using PWM/DAC modes.

This code is a hack. Feel free to break, fix, push and merge !


Licensing

ZeroMQ and GNU radio integration code written by Adrian Musceac YO8RZZ, redistribute with same license (GPLv3) as the original MMDVM code by Jonathan Naylor G4KLX.

All copyrights on MMDVM and mmdvm-sdr by original authors apply.