added new blog post

This commit is contained in:
Michael Clemens 2021-12-13 11:03:00 +01:00
parent 0309edc200
commit 314ad86775
11 changed files with 314 additions and 0 deletions

View File

@ -11,6 +11,11 @@ tags:
url: /hardrock50-remote-display/
---
UPDATE: I moved the client and the server into one repository: https://git.qrz.is/clemens/hr50-remote-display. It furthermore now supports user actions via a button.
Original post:
I am using my [Hardrock-50](https://qrz.is/building-the-hardrock50/) as part of a remote station so I am of course not able to monitor its display which shows the selected band, keying method, temperature, SWR, power etc. Since I need/want this information and also prefer a physical display, I made two little projects that can be combined together:
### HR50-API

View File

@ -0,0 +1,172 @@
---
title: "M17 with the TYT MD380 + OpenRTX + Pi-Star + MMDVM"
type: post
author: micha
date: 2021-12-13T07:00:00+02:00
tags:
- Ham Radio
- Mods
- M17
url: /m17-md380-openrtx-pistar-mmdvm/
---
In this post I will explain in detail how to become QRV on M17 with the following setup:
* [TYT MD380](200~https://www.miklor.com/MD380/)
* Raspberry Pi / [Pi-Star](https://www.pistar.uk/) / MMDVM Hotspot
The process will be the following:
* Modification of the MD380: In order to transmit M17 audio, the radio needs to be modified so the MCU has direct access to the mic without the audio being routed over the HR_C5000.
* Installation of OpenRTX on the MD380
* Modification of the Pi-Star installation
* Upgrading the MMDVM firmware to at least v1.6.0
## Disclaimer and Thanks
First of all: None of this is my work. It is just a documentation of how I implemented the work of others. Furthermore, I would not have come far without the help of multiple devs and users of the M17 and OpenRTX project. Some but not all of them are DL5SMB, IU2KWO, IU2KIN, IU5BON, tarxvf. Thank you!
Another thing: If you follow these instructions you might:
* destroy your MD380
* destroy our MMDVM hat
* kill a lot of time
* have a lot of fun
## MD380 Mod
The modification of the TYT MD380 is described [here in great detail](https://openrtx.org/#/md380_mods) and would normally need no further explaination. If you compare the images on the linked website with how my modification looks like, you will notice some differences:
![image](/img/md380_mod_done.jpg)
Difference 1: I don't have any SMD components, which is why I performed the "Mic -> MCU" mod (upper part in the picture) with a regular resistor. Make sure that the resistance is positioned in such a way that it does not press against the display during / after assembly.
![image](/img/md380_mod_resistor.jpg)
Difference 2: I messed up with the "RF -> MCU" mod (lower part in the picture) and damaged a solder pad:
![image](/img/md380_mod_pad.jpg)
The alternative is to take some wire and connect pin 1 of U101 with pin 18 of the STM32. I needed a microscope for this to solder...
![image](/img/md380_mod_workaround.jpg)
## Flashing OpenRTX to the MD380
Please follow the instructions [of the OpenRTX user's manual](https://openrtx.org/#/user_guide).
I flashed the [latest nightly build](https://openrtx.schinken-radio.de/nightly/openrtx_md3x0_wrap).
## Patching Pi-Star
Connect to your Pi-Star via SSH and switch the filesystem to rw mode:
```
# rpi-rw
```
Now update the system to the latest version:
```
# sudo pistar-update
# sudo pistar-upgrade
```
Afterwards, use [nolith's patch script (Github)](https://github.com/nolith/Pi-Star_Binaries_sbin/wiki) to path your Pi-Star installation with everything needed for M17:
```
# curl https://raw.githubusercontent.com/nolith/Pi-Star_Binaries_sbin/M17/pistar-install-m17 | sudo bash -
```
The following command starts the M17 Gateway service:
```
# sudo systemctl start m17gateway.service
```
Now enable M17 in your dashboard:
![image](/img/m17_pi_star_config1.jpg)
Afterwards, configure the M17 gateway service to your likings. You can find the settings under "Expert/M17 GW". The URL is: http://<HOTSPOT_IP>/admin/expert/fulledit_m17gateway.php
![image](/img/m17_pi_star_config2.jpg)
## Updating MMDVM
The following steps might vary depending on what MMDVM modem you are using. I am using the default Chinese eBay variant that can be plugged on eg. on a Raspberry Pi Zero and is often sold in combination with a metal enclosure and a OLED screen, the MMDVM_HS_HAT.
Connect to your Pi-Star via SSH and switch the filesystem to rw mode:
```
# rpi-rw
```
Install needed tools and libs:
```
# sudo apt-get update
# sudo apt-get install gcc-arm-none-eabi gdb-arm-none-eabi libstdc++-arm-none-eabi-newlib libnewlib-arm-none-eabi
```
Clone the source into the local file system:
```
# git clone https://github.com/juribeparada/MMDVM_HS
```
There is a library inside this repository linked as submodule. We need to take care that it will be available during compile time:
```
# cd MMDVM_HS/
# git submodule init
# git submodule update
```
Edit the file _Config.h_ and adapt all parameters to your needs. I edited/checked the following params:
```
#define MMDVM_HS_HAT_REV12 //defines which board you use
#define ENABLE_ADF7021
#define ADF7021_14_7456 // use this if you have the 14MHz tcxo
#define STM32_USART1_HOST
#define ENABLE_SCAN_MODE
```
Now we need to stop some services since they will interfere with the flashing process:
```
# sudo pistar-watchdog.service stop
# sudo systemctl stop mmdvmhost.timer
# sudo systemctl stop mmdvmhost.service
```
We can now compile and flash the new firmware:
```
# make clean
# make
# make mmdvm_hs_hat
```
## Usage
### Using the MD380
Before using the MD380, you need to set the following things:
* Enter your callsign:
* Press the green button
* Select "Settings"
* Enter call
* Change mode to M17
* Press and hold the button below the PTT button
* Press 5 until it shows "M17"
* Enter the frequency of your hotspot in the main VFO screen
### Switching the Reflector
You can switch to another reflector with the following command (Thanks DL5SMB!):
```
# echo "ReflectorM17-M17 C" | nc -u 127.0.0.1 6075
```

View File

@ -0,0 +1,137 @@
---
title: "Server Backup with Borgmatic and Borgbase"
type: post
author: micha
date: 2021-11-18T18:00:00+01:00
tags:
- Backup
- Linux
url: /server-backup-with-borgmatic-and-borgbase/
---
In this article I document how I backup my servers locally as well as remotely to [borgbase.com](https://www.borgbase.com). After implementing the follwoing steps, you'll get:
* encrypted backups to a local directory
* encrypted offsite backups
* alarms in the case backups fail
## Preconditions
All these steps have been tested with Debian 10/11. You'll need a paid subscription with BorgBase or use your own remote repository server. All commands have to be executed in the context of the user _root_.
## Installation of Borg and Borgmatic
On the system that needs to be backed up:
```
# apt install borgbackup borgmatic
# mkdir -p ~/.config/borgmatic
# cat ~/.ssh/id_rsa.pub
```
Copy the output of the last command. If you don't have SSH keys generated, you can do so by typing
```
# ssh-keygen
```
## Configuring the Repositories
Login to BorgBase (https://www.borgbase.com) and perform the following steps:
* Add a new SSH key under _Account - SSH Keys - Add public key_ and paste here your previously copied public key
* Go to _Repositories - New Repo_, create a new repository and add the new SSH pubkey
* Look up how to initialize your repo under _Setup - Initialize Repo_. Copy the first command, e.g. "borg init -e repokey-blake2 abcdefgh@abcdefgh.repo.borgbase.com:repo"
## Initializing your Repositories
Now is the time to generate and store a secure passphrase in your password manager. This will be needed to encrypt/decrypt your backups
Initialize both the local and the remote repository by entering the following command. If asked, enter the previously generated passphrase:
```
# borg init -e repokey-blake2 /backup/borgmatic/
# borg init -e repokey-blake2 abcdefgh@abcdefgh.repo.borgbase.com:repo
```
## Configuration of Borgmatic
Create and edit the configuration file:
```
# vi ~/.config/borgmatic/config.yaml
```
Paste and adapt the following content:
```
location:
source_directories:
- /etc
- /home
- /var/www
one_file_system: true
repositories:
- /backup/borgmatic
- abcdefgh@abcdefgh.repo.borgbase.com:repo
exclude_patterns:
- '*.pyc'
- ~/*/.cache
- NoSyncNoBackup
exclude_caches: true
exclude_if_present: .nobackup
storage:
compression: auto,zstd
encryption_passphrase: <YOURSECRETPASSWORD>
archive_name_format: '{hostname}-{now}'
retention:
keep_daily: 3
keep_weekly: 4
keep_monthly: 12
keep_yearly: 2
prefix: '{hostname}-'
consistency:
checks:
# uncomment to always do integrity checks. (takes long time for large repos)
#- repository
- disabled
check_last: 3
prefix: '{hostname}-'
hooks:
# List of one or more shell commands or scripts to execute before creating a backup.
before_backup:
- echo "`date` - Starting backup"
after_backup:
- echo "`date` - Finished backup"
```
Finally execute the following command to create your first backup:
```
# borgmatic
```
## Backup Scheduling
In order to automatically perform backups e.g. every day at 1:00 am, edit the crontab with
```
# crontab -e
```
Paste the following line into the editor:
```
0 01 * * * /usr/bin/borgmatic >/dev/null 2>&1
```

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 193 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 208 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 598 KiB