You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

7.3 KiB

title summary date lastmod categories tags draft
MMDVM hotspot on Archlinux On a Raspberry Pi 2 2024-01-28T10:10:11+0000 2024-01-28T10:12:11+0000
amateur-radio
archlinux
dstar
hotspot
linux
mmdvm
raspberry-pi
true

Installation ala wiki pages

I usually setup any Raspberry Pi without screen and keyboard but I make use of the serial console.

Raspi 2 with wires connected to GPIO Pins GND, RXD and TXD

Preparations (microSD card)

Partition the microSD card.

$ sudo fdisk /dev/sda
Device         Boot  Start      End  Sectors  Size Id Type
/dev/sda1        2048   411647   409600  200M  c W95 FAT32 (LBA)
/dev/sda2      411648 15759359 15347712  7.3G 83 Linux

Format filesystems.

$ sudo mkfs.vfat /dev/sda1
$ sudo mkfs.ext4 /dev/sda2

I am curerntly in ~/mnt.

$ mkdir boot root
$ sudo mount /dev/sda1 boot
$ sudo mount /dev/sda2 root
$ wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-armv7-latest.tar.gz
$ sudo bsdtar -xpf ArchLinuxARM-rpi-armv7-latest.tar.gz -C root
$ sync
$ sudo mv root/boot/* boot/
$ sudo umount boot root

So, place the microSD card in the Raspberry Pi and boot it up (with the serial console connected).

First start

There are the following two users pre-defined:

Username Password
root root
alarm alarm

I prefer my username as dominic, so I changed it:

# usermod -l dominic -d /home/dominic -m alarm
# groupmod -n dominic alarm

{{< alert circle-info >}} The user alarm may come from ArchLinux ARM. {{< /alert >}}

So the first real thing is upgrading the system. We start as this:

# pacman-key --init
# pacman-key --populate archlinuxarm
# pacman -Syu

Some general system administration tasks as time setup network setup etc...

I'm using NetworkManager on the Raspi so I install it

# pacman -S networkmanager
# nmcli device wifi connect {network-ssid} --ask

Now we may login via ssh.

Installation of DStarGateway

I prefer compiling as normal user so I login as dominic. We will need some packages.

$ sudo pacman -S --needed base-devel wget boost man-db gtest

I hope I got all that we need, if you run into errors, just install the missing ones 😉

$ mkdir git && cd git
$ git clone https://github.com/F4FXL/DStarGateway.git
$ cd DStarGateway
$ make

This ran for 38 minutes -- I will not forget to add -j4 the next time :face_with_rolling_eyes:

You would now typically install the files but this is the part that made me stop for a while. Whatever I was doing, it won't work automated. I'm not a developer, but to me this looks like as if make -C enters the directory before it runs the top-level Makefile so the export ... lines never get executed and the Makefiles in the sub-directories will never know about them. I didn't want to dive deeper into this and decided to just install the rest by hand.

$ sudo make install

It will break, but at least install the binary files into /usr/local/bin. Also install the hostfiles (will need the program wget).

$ sudo make newhostfiles

Copy the systemd unit files to the right directory per hand:

$ sudo cp debian/* /usr/lib/systemd/system/

{{< alert >}} Inspect them because you may edit some paths. {{< /alert >}}

Also have a look at the configuration files in /usr/local/etc/.

Enable the services, but I don't start them yet (except for a short test) because the hotspot will connect to the DSTAR reflector but we can't talk or hear anything. Once they are enabled, they will autostart at the next reboot.

To enable the services:

$ sudo systemctl enable dstargateway.service
$ sudo systemctl enable dgwtimeserver.service

Because the make install did not finish before, I have to manually install the Data folder contents (AMBE files, Hostfiles). I could not get this to work the way it was described in the repository, but I installed them this way:

Move to the Data directory and add the following line on top of the file:

export DATA_DIR=/usr/local/share/dstargateway.d/

Then rund sudo make install within the Data directory again and all should be fine.

Installation of MMDVMHost

Also this requires special packages, although I think those are for the new FM features -- that a hotspot won't use at all...

$ sudo pacman -S libsamplerate
$ git clone git@github.com:g4klx/MMDVMHost.git
$ cd MMDVMHost
$ make -j4
$ sudo make install-service

That would fail, but we can do it by hand.

Setup the user mmdvm:

$ sudo useradd --user-group -M --system mmdvm --shell /bin/false
$ sudo usermod --groups uucp --append mmdvm

So we run the command one more time:

$ sudo make install-service

Binaries are installed and the systemd unit files too.

Modify the configuration file /etc/MMDVM.ini.

Enable the service:

$ sudo systemctl daemon-reload
$ sudo systemctl enable mmdvmhost.service

Setup the UART

We can't start MMDVMHost right away (well, we can, but it will not work yet).

We need to disable the serial console because we need the UART at the GPIO pins for our modem hardware.

Disable the service, that accesses the serial console:

$ sudo systemctl disable serial-getty@ttyAMA0.service

Open /boot/cmdline.txt and remove console=serial0,115200 from the line. Save and reboot.

Another problem occurs, I will probably have to flash an actual firmware to the modem.

E: Received a NAK to the SET_CONFIG command from the modem
I: MMDVMHost-20240126 exited on receipt of an unknown signal

But we need another compiler. I install paru to get that compiler with its dependencies.

The installation of paru is very easy:

$ sudo pacman -S --needed base-devel
$ git clone https://aur.archlinux.org/paru.git
$ cd paru
$ makepkg -si
$ paru -Syu
$ paru -S arm-linux-gnueabihf-gcc

Oh hell, this is going to take ages on the Raspberry Pi 2...

DSTAR Registration

A DSTAR registration is mandatory if you want to be transmitted on original ICOM repeaters. Otherwise your transmission will not be forwarded properly and you may look for errors for a long time...

I registered in 2020 at https://regist.dstargateway.org/ but there is one important thing to add to the webui there: do not choose long passwords (like those from a password manager) because it will get cut off somewhere and it took me quite a while to find that error.

{{< alert skull-crossbones >}} I can't believe that there are still websites in 2024 that limit the lenght of a password! {{< /alert >}}

I do have 12 characters now, I usually use 20 or more.