Skip to content

010.010 Installation of D‐Rats on Microsoft Windows within MSYS2 MingW64

MAURIZIO ANDREOTTI edited this page Nov 12, 2023 · 1 revision

Installation of D-Rats on Microsoft Windows.

Note use of D-Rats for sending text or data to a radio or a ratflector that connects to a radio requires a valid Amateur Radio License.

These instructions were tested on Microsoft Windows 10.

Installation of D-Rats for running on Microsoft Windows is currently a multiple step procedure.

  1. A membership in D-Rats Mailing List on groups.io.
  2. Optional Install of LZHUF for Winlink communication.
  3. Install MSYS2 MingW64 Python and GTK runtime environment.
  4. Option 1, Run from checkout from Git Repository
  5. Option 2, Setup of a Python Virtual Environment for running D-Rats.
  6. Option 2, Installing the latest Python "tarball" for D-Rats.

This is required as at this time we can not create a single package to install both D-Rats and the required Python + GTK Run-time environment.

The MSYS2 was chosen for the development support because it is free to be installed on any Microsoft Windows environment that MSYS2 currently supports.

Alternatives to MSYS2 are Cygwin and for Windows 10 64 bit or later using a WSL2 Linux like Ubuntu. Unfortunately support for WSL2 Linux to be able to access USB Serial devices is currently an experimental add on.

This is needed to download the installation files, and your best resource for support for D-Rats is on this mailing list.

This was the easiest to setup somewhat public download location that I could setup with a stable URL.

Only members of the D-Rats group can upload or download the files.

Sign up for an account at https://groups.io./g/d-rats/. Once your account is set up, then Follow this link for instructions on Joining the D-Rats group.

There may be a short delay while the list moderators approve your joining the list.

If you do not want to join the D-Rats Mailing List on groups.io, then you can download the sources from GitHub Ham-Radio-Software D-Rats Project and GitHub Ham-Radio-Software LZHUF project and follow the instructions there for building and installing.

Optional Install of LZHUF for Winlink communication

If you intend on communicating with Winlink, you will need to install the lzhuf program.

The LZHUF program is pre-build as either a 64 bit or 32 bit Windows MSI package. Since only 64 bit Microsoft Windows is supported by MSYS2, you only need to install the 64 bit image.

Log into https://groups.io./g/d-rats/ and download the file lzhuf_x64.msi. Once the file is downloaded, just double click it to install it.

Install MSYS2 MingW64 Python and GTK runtime environment.

Please note that it is possible that the MSYS2 site may reorganize their site, so you may need to find the most current links.

Go to MSSY2 Installation and follow the instructions for the install.

Downloading and running the installer brought up a setup Wizard.

Click Next to begin. I recommend taking the default Installation folder and Start Menu shortcuts.

Once the base install is complete, then click on finish with the "Run MSYS2 now." check box still clicked.

This should bring up a window with the Msys2 shell command running.

Now some packages are needed to be installed for running D-Rats.

The simplest way to install them is to download the script that installs them.

You can copy the command below into your paste buffer and use a right click and paste to place it in the Msys2 shell.

wget https://raw.githubusercontent.com/ham-radio-software/D-Rats/master/msys2_packages.sh

The wget command may fail if the certificate authority bundle is not up to date, in that case you can override the certificate failure with:

wget --no-check-certificate https://raw.githubusercontent.com/ham-radio-software/D-Rats/master/msys2_packages.sh

$ wget https://raw.githubusercontent.com/ham-radio-software/D-Rats/master/msys2_packages.sh
--2022-11-23 12:28:40--  https://raw.githubusercontent.com/ham-radio-software/D-Rats/master/msys2_packages.sh
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.199.109.133, 185.199.110.133, 185.199.111.133, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.199.109.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 769 [text/plain]
Saving to: ‘msys2_packages.sh’

msys2_packages.sh        100%[==================================>]     769  --.-KB/s    in 0s

2022-11-23 12:28:40 (21.5 MB/s) - ‘msys2_packages.sh’ saved [769/769]

Then run it with ./msys2_packages.sh .

I have one report of this script hanging, and I found this about it on the internet is MSYS2 package install hanging.

This script not only is installing the packages needed for D-Rats, it is also updating the Msys2 packages for updates since the installer kit was created.

If the Msys2 command box exits, it is because that it updated a component that needed Msys2 to be restarted.

Find the "MSYS2 MINGW64" entry in the start menu and launch it to re-open the window.

You will want to re-run this script every month or so until it completes with out closing the window that it is run under to make sure that your msys2 environment is up to date with all security patches.

You will probably want to "pin" this entry to your taskbar or create a desktop shortcut to it, as this is what you will be using to run D-Rats.

Re-run the ./msys2_packages.sh command in it. It may take a few times running it until everything is updated.

As you can see, there is a lot to install. Periodically you can re-run this script to make sure that your msys2 environment is up to date.

Adding the Github client

At this point, if you plan to be part of the tester team, or if you expect to be interested into testing the fixes which will come in advance to software release as pull requests (PRs), you can install the github client for MSYS executing:

pacman -S mingw-w64-x86_64-github-cli

this will provide you with the "gh" command.

Choose Option 1 and or Option 2 paths.

At this point, you actually have several choices of how to install an run D-Rats, and you can go to Current D-Rats readme for the more advanced methods running from a clone or copy of the D-Rats sources.

Option 1 and Option 2 can both be used. Option 1 is easier to setup.

Option 2 has some additional functionality in D-Rats enabled as it adds the python geopy and feedparser from the PyPi library. Likely most users will not notice that. The geopy module in the older python 2 module stopped working a while back.

Option 1 Run from checkout from Git Repository

Not all features will be available to the D-Rats program. It is also likely that you would not miss them.

Make sure that git is installed with pacman -Syu --noconfirm git

Clone the git repository with git clone https://github.com/ham-radio-software/D-Rats.git

$ git clone https://github.com/ham-radio-software/D-Rats.git
Cloning into 'D-Rats'...
remote: Enumerating objects: 2908, done.
remote: Counting objects: 100% (1543/1543), done.
remote: Compressing objects: 100% (497/497), done.
remote: Total 2908 (delta 1075), reused 1177 (delta 1034), pack-reused 1365
Receiving objects: 100% (2908/2908), 2.48 MiB | 4.72 MiB/s, done.
Resolving deltas: 100% (2020/2020), done.
Updating files: 100% (213/213), done.

Option 1, The message catalog needs to be built.

cd D-Rats
./build_pot.sh

Option 1, Running D-rats

cd D-Rats
./d-rats.py

The current need for cd D-rats before './d-rats.py' is a bug and will be fixed on a future build.

Option 1, Updating D-Rats

cd D-Rats
git pull

Restart D-rats

Option 1, Create a shortcut for running D-Rats

Make a copy of the "MSYS2 Mingw 64-bit" short cut from the Start menu.

Rename the shortcut to be D-Rats.

In the properties, change Target to be C:\msys64\usr\bin\env.exe MSYSTEM=MINGW64 /usr/bin/bash -li -c "cd D-Rats && ./d-rats.py"

In the properties, change the Start in C:\msys64\home\%USERNAME%

Save the changes.

Option 2 Setup of a Python Virtual Environment for running D-Rats

For this option the instructions are for a traditional PIP install.

More details are at Running-D-Rats-in-a-Python-virtual-environment-and-PIP

Create the virtual environment for d-rats with python -m venv ~/d-rats_venv --system-site-packages .

Activate the virtual environment.

$ source ~/d-rats_venv/bin/activate
(d-rats_venv)
malmberg@COMPUTERNAME MINGW64 ~
$

Option 2, Installing the latest Python "tarball" for D-Rats

The tar.gz or actually tar dot anything is known as a tarball.

At the time of this writing and testing of this document, only a D-Rats pre-release is available.

Go to Groups.io D-Rats File Downloads . Select the directory for "D-Rats release" or "D-Rats pre-release" and download the tarball for the version that you want to run.

Do not be concerned with the ".whl" file, you will not use it. Mac OS-X users may need to use that file.

The file will show up in Msys2 in with ls $USERPROFILE\\downloads\\

Make sure that the Python Virtual environment is activated, and use pip to install it.

(d-rats_venv)
malmberg@COMPUTERNAME MINGW64 ~
$ pip install $USERPROFILE\\downloads\\D-Rats-0.3.10b6.dev287.tar.gz
Processing c:/users/malmberg/downloads/d-rats-0.3.10b6.dev287.tar.gz
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Collecting geopy
  Downloading geopy-2.3.0-py3-none-any.whl (119 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 119.8/119.8 kB 782.7 kB/s eta 0:00:00
Requirement already satisfied: pyserial in c:/msys64/mingw64/lib/python3.10/site-packages (from D-Ra
ts==0.3.10b6.dev287) (3.5)
Requirement already satisfied: lxml in c:/msys64/mingw64/lib/python3.10/site-packages (from D-Rats==
0.3.10b6.dev287) (4.9.1)
Requirement already satisfied: pycairo in c:/msys64/mingw64/lib/python3.10/site-packages (from D-Rat
s==0.3.10b6.dev287) (1.22.0)
Collecting feedparser
  Downloading feedparser-6.0.10-py3-none-any.whl (81 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 81.1/81.1 kB 1.1 MB/s eta 0:00:00
Requirement already satisfied: Pillow in c:/msys64/mingw64/lib/python3.10/site-packages (from D-Rats
==0.3.10b6.dev287) (9.3.0)
Requirement already satisfied: PyGObject in c:/msys64/mingw64/lib/python3.10/site-packages (from D-R
ats==0.3.10b6.dev287) (3.42.1)
Collecting sgmllib3k
  Downloading sgmllib3k-1.0.0.tar.gz (5.8 kB)
  Preparing metadata (setup.py) ... done
Collecting geographiclib<3,>=1.52
  Downloading geographiclib-2.0-py3-none-any.whl (40 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.3/40.3 kB 970.5 kB/s eta 0:00:00
Using legacy 'setup.py install' for sgmllib3k, since package 'wheel' is not installed.
Building wheels for collected packages: D-Rats
  Building wheel for D-Rats (pyproject.toml) ... done
  Created wheel for D-Rats: filename=D_Rats-0.3.10b6.dev287-py3-none-any.whl size=493299 sha256=5ed9
128a4a4a7afce188fd50989eab4be2e07152b338445c909934689fddc077
  Stored in directory: c:/users/malmberg/appdata/local/pip/cache/wheels/55/53/82/22e5094f2060b23944f
023a4ca0ea5671f975cee929b7a730d
Successfully built D-Rats
Installing collected packages: sgmllib3k, geographiclib, feedparser, geopy, D-Rats
  Running setup.py install for sgmllib3k ... done
Successfully installed D-Rats-0.3.10b6.dev287 feedparser-6.0.10 geographiclib-2.0 geopy-2.3.0 sgmlli
b3k-1.0.0

[notice] A new release of pip available: 22.2.2 -> 22.3.1
[notice] To update, run: python.exe -m pip install --upgrade pip
(d-rats_venv)
malmberg@COMPUTERNAME MINGW64 ~

Option 2m Running D-Rats

First make sure that you have the "MSYS2 MINGW64" window active.

Then make sure that the Python virtual environment is active.

And simply run the command 'd-rats.py' to launch.

The first time, this will bring up a box that when you click OK will take you to the configuration dialog. Set your name and Call sign at a minimum and select save. You can change the rest later.

Some users have encountered an issue with Directories not found that will be addressed in a future fix to D-Rats. The work around is documented at Folder Problem Installing D-Rats on Windows 10

Good luck.

Clone this wiki locally