====== OpenWebRX and Pi MMDVM Hotspot Based M17 Transceiver - 29/10/21 ======
==== Introduction ====
https://m17project.org
Interested in building and experimenting with an M17 radio?
**Receiver** - Pi running [[https://www.openwebrx.de|Openwebrx]] with M17 support and USB SDR radio.
**Transceiver** - Pi MMDVM Hotspot (PiStar) with custom firmware/software for M17 and a USB headset.
==== OpenWebRX M17 Web RX ====
Raspberry Pi Model 4, 4GB, 16 GB SD card, Generic RTL USB SDR, ethernet to VM Router.
Install image, browser access via OpenWebRX.local
==== Build a Pi Hotspot as an experimental M17 Transceiver ====
Raspberry Pi Model 3b, 1GB, 16 GB SD card, Generic MMDVM Hotspot board, USB headset, ethernet to VM Router.
Standard Pi OS desktop install, network config 192.168.0.111 and config Pi HostName
# Set to a fixed IP
sudo nano /etc/dhcpcd.conf
# Expand file system, locale etc
sudo raspi-config
sudo apt update
sudo apt full-upgrade
** M17 Pi Tools, Client and Daemon setup **
sudo apt install git
sudo apt install gcc
sudo apt install build-essential
sudo apt install libsamplerate0-dev
sudo apt install libasound2-dev
sudo apt install libwxgtk3.0-gtk3-0v5
sudo apt install libwxgtk3.0-gtk3-dev
mkdir M17Radio
cd M17Radio
git clone git://github.com/g4klx/M17Client
cd M17Client
cd Daemon
make
sudo make install
cd ..
cd GUI
make
sudo make install
cd ~/M17Radio/M17Client/Daemon
nano M17Client.ini
# set baud rate in M17Client/Daemon config.ini 115200
M17Client M17Client.ini # To start the M17Client Daemon, best wait till finished though!
** Build and flash the M17 Hotspot Firmware **
https://github.com/juribeparada/MMDVM_man/blob/master/MMDVM-Pi_v0_9_en.md
Disable conflicting services
sudo systemctl disable serial-getty@ttyAMA0.service
sudo systemctl disable bluetooth.service
# in /boot/config.txt - remove the console section
# Add..
enable_uart=1
dtoverlay=pi3-disable-bt
Prepare
cd ~
git clone https://github.com/g4klx/MMDVM_HS
# Refer to install_buildtools.sh to build/install prerequisites
cd MMDVM_HS
git checkout M17
Load Flash Tools
cd ~
git clone https://git.code.sf.net/p/stm32flash/code stm32flash
cd stm32flash
make
sudo make install
Build and Flash
git submodule init
git submodule update
cp ~/MMDVM_HS/configs/MMDVM_HS_Hat.h ~/MMDVM_HS/Config.h
# in Config.h
# uncomment // alternate m17 led
# comment out other // Led option
make
# Flash
sudo make mmdvm_hs_hat
** Configure USB headset on the Pi **
https://iotbytes.wordpress.com/connect-configure-and-test-usb-microphone-and-speaker-with-raspberry-pi/
** Run the M17 Transceiver **
Configure the M17 code plug
cd ~/M17Radio/M17Client/Daemon
nano CodePlug.ini
Start M17 Daemon
cd ~/M17Radio/M17Client/Daemon
M17Client M17Client.ini
# Example running output
M: 2021-10-11 20:24:47.425 M17Client-20211003 is starting
M: 2021-10-11 20:24:47.425 Built 16:33:31 Oct 10 2021 (GitID #6d1514e)
M: 2021-10-11 20:24:47.425 Opening the MMDVM
I: 2021-10-11 20:24:49.436 MMDVM protocol version: 1, description: MMDVM_HS_Hat-v1.5.2 20210919 14.7456MHz ADF7021 FW by CA6JAU GitID #0f3a4fa
I: 2021-10-11 20:24:49.457 Opening UDP port on 7658
W: 2021-10-11 20:24:49.459 Cannot open the RSSI data file - RSSI.dat
M: 2021-10-11 20:24:49.613 Opened default:default Rate 48000
M: 2021-10-11 20:24:49.613 Starting ALSA reader thread
M: 2021-10-11 20:24:49.614 Starting ALSA writer thread
M: 2021-10-11 20:24:49.614 M17Client-20211003 is running
Start M17 Client GUI
cd ~/M17Radio/M17Client/GUI
M17GUI
** Running the M17 Transceiver GUI remotely **
# Configure for correct M17Client server
nano .M17GUI
DaemonAddress=192.168.0.112
DaemonPort=7658
SelfAddress=192.168.0.12
SelfPort=7659
Channel=M17 Calling
Destination=ALL
Volume=84
Metric=1
Run the Tranceiver GUI on another machine and pipe the audio to it using PulseAudio
https://github.com/g4klx/M17Client/blob/1a4b39b1e3c96fdd54d2731b5e96b59f0ad3a028/PulseAudio.md
M17 Hotspot - piStar
M17 Audio to M17 Reflector
-----
======Notes======
====RSSI.dat====
On startup M17Client notes that RSSI.dat is missing, for a Hotspot just use a default RSSI.dat file
# This file maps the raw RSSI values to dBm values to send to the DMR network. A number of data
# points should be entered and the software will use those to work out the in-between values.
#
# The format of the file is:
# Raw RSSI Value dBm Value
#
#
# RSSI Default Values for MMDVM_HS
#
43 -43
53 -53
63 -63
73 -73
83 -83
93 -93
99 -99
105 -105
111 -111
117 -117
123 -123
129 -129
135 -135
141 -141
====Pi UARTs and Bluetooth====
https://www.circuits.dk/setup-raspberry-pi-3-gpio-uart/
Name: disable-bt
Info: Disable onboard Bluetooth on Pi 3B, 3B+, 3A+, 4B and Zero W, restoring
UART0/ttyAMA0 over GPIOs 14 & 15.
N.B. To disable the systemd service that initialises the modem so it
doesn't use the UART, use 'sudo systemctl disable hciuart'.
Load: dtoverlay=disable-bt
Params:
Name: miniuart-bt
Info: Switch the onboard Bluetooth function on Pi 3B, 3B+, 3A+, 4B and Zero W
to use the mini-UART (ttyS0) and restore UART0/ttyAMA0 over GPIOs 14 &
15. Note that this may reduce the maximum usable baudrate.
N.B. It is also necessary to edit /lib/systemd/system/hciuart.service
and replace ttyAMA0 with ttyS0, unless using Raspbian or another
distribution with udev rules that create /dev/serial0 and /dev/serial1,
in which case use /dev/serial1 instead because it will always be
correct. Furthermore, you must also set core_freq and core_freq_min to
the same value in config.txt or the miniuart will not work.
Load: dtoverlay=miniuart-bt,=
Params: krnbt Set to "on" to enable autoprobing of Bluetooth
driver without need of hciattach/btattach
====Linux Notes====
https://www.pragmaticlinux.com/2020/12/how-to-clone-your-raspberry-pi-sd-card-in-linux/
lsblk -p
# Copy SD to image file
sudo dd bs=4M if=/dev/sdb of=~/Downloads/m17trx.img conv=fsync
sudo chown $USER: ~/Downloads/m17trx.img
sudo pishrink ~/Downloads/m17trx.img
# Copy image file to SD
# Using Raspberry imager