Showing posts with label Setup. Show all posts
Showing posts with label Setup. Show all posts

Friday, October 3, 2025

How to download WSPR and FT8 logs from a WEB-888 SDR

Since firmware version v2025.0119 the Web888 is able to log FT8/4 and WSPR decode information to the messages file of the OS. Because a reboot or a simulated reboot, i.e. a power failure will remove any log file from the Web888, I use the following to store the log onto a different host. Additionally I'm also able to further process the log, but that's a different story.
I use a Raspberry Pi (RaPi) as my storage system however, any *nix type system, including the "Fruity MAC" or the "Shattered Windows" (with the *nix add on) could be used by following the below steps. 

Note: Many ways lead to Rome as they say, and this is only one of the many ways this can be achieved, YMMV!

Prerequisite:

  • A little knowhow of how to abuse a keyboard.
  • A little knowledge about some form of *nix (MAC-OS, Linux, etc.).
  • A Terminal program (Putty, MobaXterm, xterm).
  • POSIX *nix commands.
  • ssh
  • ssh-keygen
  • the IP-Address of your Web888.

The step we will take to create the system,
    1. Create Password less access.
    2. create a key
    3. copy key to Web888
    4. modify Web888 boot image
    5. create file store
    6. test system
    7. automate system
Note: I will use the following syntax throughout to help distinguish between commands and command echos.

This is a command you type at (into) the terminal, you can also copy and paste.

And the below is a command echo,

Ok, well done grasshopper.

Create Key

Let's log in to our *nix system with our prefered Terminal application.
Since we are connecting to the Web888 via ssh will will create a set of ssh-keys to enables us to do so.The ssh-keygen application is the tool for us to set this up.

/usr/bin/ssh-keygen -t rsa -b 4096 -C "VK5HW"

Let me quickly explain, the -t specifies what type of key to create, the -b means how big/long the key should be and the -C is a comment field. You can use the comment to add your own callsign or any other comment you wish to the key.
After you pressed the [ENTER] key, you will be greeted with the following text:
Generating public/private rsa key pair.
(Patience is a virtue) you need to wait a little before you'll see  
Enter file in which to save the key (/home/hw/.ssh/id_rsa):
We will accept the default (/home/hw/.ssh/id_rsa) and press the [ENTER] key.
Now the next is the secret ingredient for password less access.
Enter passphrase (empty for no passphrase):
Yep, you guessed it, we hit [ENTER] as we do not want a passphrase (password)! And so the next question is answered exactly the same!
Enter same passphrase again:
Hit that [ENTER] key again.
Your identification has been saved in /home/hw/.ssh/id_rsa
Your public key has been saved in /home/hw/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:some blah here VK5HW
The key's randomart image is:
+---[RSA 4096]----+
| some blah here  |
+----[SHA256]-----+

Let's quickly check,
ls  ~/.ssh/*rsa*
/home/hw/.ssh/id_rsa  /home/hw/.ssh/id_rsa.pub

Two files have been created and we need to install the id_rsa.pub, which is our public key, onto the Web888.

Copy the Key to the Web888

Were are still in our Terminal session and the next task is to set a shell variable with the IP-Address of your Web888's.
ipa=<your Web888's IP-Address>

Note: We will use this shell variable throughout the setup!

Next is a rather long command, which is actually multiple commands strang together which will handle all the required tasks, i.e. setup, copy and to set the appropriate file permissions in one swoop.
cat ~/.ssh/id_rsa.pub | ssh root@$ipa "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys"

Note: Make sure the shell variable ipa has been set!

You'll be greeted with this prompt:
root@<your Web888's IP-Address>'s password:
Because it asked so nicely you should give it the password (changeme), hit [ENTER] and the message Connection closed by <your Web888's IP-Address> port 22 will be displayed on the screen. That's it, no more passwords.

Let's check:
ssh root@$ipa "ls  ~/.ssh"
authorized_keys

With that out of the way let's make sure that our modification of the Web888 firmware survives a reboot.

Modify the Web888 Boot Image File

From our Terminal program ssh to the Web888,
ssh root@$ipa
Welcome to Alpine!

The Alpine Wiki contains a large amount of how-to guides and general
information about administrating Alpine systems.
See <https://wiki.alpinelinux.org/>.

You can setup the system with the command: setup-alpine

You may change this message by editing /etc/motd.

Noticed that the Web888 did not ask for a pesky password!

Let's note the Boot Image File size,
ls -l /media/mmcblk0p1/web-888.apkovl.tar.gz
-rwxr-xr-x    1 root     root         13718 Sep 30 00:22 /media/mmcblk0p1/web-888.apkovl.tar.gz

And then check the status of the boot image file,
lbu st
A root/.ssh
A root/.ssh/authorized_keys

As we can see the two files which we created, .ssh and .ssh/authorized_keys have not been added to the boot image file. To add them we commit those files using the command,
lbu ci
And lets check if the commit has worked,
lbu st

And ... nope nada. We get nothing back from the status command if all went well. And to make sure that the boot image file has really been modified we check,
ls -l /media/mmcblk0p1/web-888.apkovl.tar.gz
-rwxr-xr-x    1 root     root         14402 Oct  3 14:53 /media/mmcblk0p1/web-888.apkovl.tar.gz

and see that the timestamp and the files size have changed!

Our job here is done so logout of the Web888,
exit
Connection to <your web888's IP-Address> closed.

It is now time for a cold drink (Beer?). Hard part is done.

Create File Store

Note: Make sure that you are at your local host.

Next we create the file store which is really only a directory at a place near you, you can call it whatever you want, I will call it web888.
mkdir -p ~/web888 

Done!

Test the System

Well, to test the system we will download a message file. I have created a script which will make the download a bit easier. But for demonstration and for testing I show you the individual commands.
  1. Create a copy of the messages file 
  2. Zero/empty /var/log/messages 
  3. Download the log file
  1. ssh root@$ipa 'cp /var/log/messages /var/log/log'
  2. ssh root@$ipa 'cat /dev/null > /var/log/messages'
  3. ssh root@$ipa 'cat /var/log/log' | grep "user\.info" > ~/web888/log_$(date +%Y%m%d"_"%H%M).txt
And we check,
ls ~/web888/log_20251004_0048.txt
/home/hw/web888/log_20251004_0048.txt

and check if our downloaded file has actual data in it,
cat ~/web888/log_20251004_0048.txt | more
Oct  2 13:48:00 web-888 user.info : 00:03:45.107 ..23456789A.     4        WSPR DECODE:  UTC  dB   dT      Freq
 dF  Call   Grid    km  dBm
Oct  2 13:48:00 web-888 user.info : 00:03:45.124 ..23456789A.     4        WSPR DECODE: 1346 -13  0.1 10.140111
 -1  VK7TW  QE37  1057   30 (1.0 W)

Looking good.
The download script can be found here.

And that is it! You should now be able to download the messages (log file) from your Web888 to your local system. The next step is for the tiny bit more advanced users aka the lazy ones like me. This digs into the *nix scheduler which is used for the automation of the download process.

Automate System

Since I'm rather lazy I prefer to automate something as mundane as downloading files. So to automate the download we use a *nix tool called cron. Cron uses a table called a crontab. The following should help you understand crontab. A crontab entry, or a cron expression looks like this,

<minute> <hour> <day-of-month> <month> <day-of-week> <command>

For example the below cron expression is scheduled at 3 minutes past the hour,i.e. it runs at least once every hour and it will run the script /home/hw/web888_transfer.sh.

To list (-l) the crontab use,

crontab -l
3 */1 * * * /home/hw/web888_transfer.sh "192.168.1.40" "/home/hw/web888/log40_$(date +%Y%m%d"-"%H%M).txt" >> /home/hw/tmp/transfer.log 2>&1

and to edit/modify the crontab table we use,

crontab -e

Note: if you are using the crontab -e command for the first time it might ask you what editor you want to use. Now I can't help you with that choice, I do however use vi but ymmv.

Navigate to the bottom of the file [SHIFT-G].
Next type [SHIFT-A], the message 
-- INSERT --
will pop up. You can now type or copy and paste the following,
3 */1 * * * /home/<your username>/web888_transfer.sh "<your web888's IP-Address>" "/home/<your username>/web888/log_$(date +%Y%m%d"-"%H%M).txt" >> /home/<your username>/web888/transfer.log 2>&1

Note: You need to change <your web888's IP-Address> to the actual IP-Address of your Web888, the shell variable does not work here.

Press [CTRL-C] to stop the editing process and then press [SHIFT-ZZ] (not a typo it is double Z)

You'll be greeted with,
crontab: installing new crontab

And that's it. Done and dusted.

Note: You need to download the web888_transfer.sh file into your home directory and make it executable. The following command will make the web888_transfer.sh user executable, 

chmod 700 ~/web888_transfer.sh

Please note that you are free to mangle any of the above to suit your needs. This is something that should work and point you into the right direction. Since I use two Web888 my setup/schedule/script is/are a bit different.

Good luck, and if I've made a(ny) mistake(s) (highly possible) drop me a note and I'll rectify it.

Oh, and a final word! Don't forget that you have to do steps 2 & 3 and maybe the UPDATE below, after you upgraded the OS (firmware) of the Web888. 

UPDATE:

I forgot that the newer *nix's don't allow cron to be used by users so you might need to add your user account to the cron.allow file. To solve this run the below from your login,

sudo sh -c 'who am i | cut -d" " -f 1 > /etc/cron.allow'

And then check,

cat /etc/cron.allow 
<your user name>

And we most likely need to restart the cron daemon. For that we issue this command,

sudo service cron restart

and the check,

sudo service cron status
● cron.service - Regular background program processing daemon
     Loaded: loaded (/lib/systemd/system/cron.service; enabled; vendor preset: enabled)
     Active: active (running) since Sat 2025-10-04 19:30:08 ACST; 7s ago
       Docs: man:cron(8)
   Main PID: 32363 (cron)
      Tasks: 1 (limit: 4915)
        CPU: 15ms
     CGroup: /system.slice/cron.service
             └─32363 /usr/sbin/cron -f


Appendix

A few examples of how to process the log file.

Show all WSPR decodes:
cat web888/sdr40.log | grep "WSPR DECODE" | grep -v " UTC " | awk '{print $1,$2,$3,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22}'

Oct 3 23:20:01 2318 -18 0.3 21.096153 1 VK4GAW QG62NS 1657 23 (200 mW)
Oct 3 23:20:01 2318 -2 0.4 7.040137 0 VK3GOD QF23 583 23 (200 mW)
Oct 3 23:20:01 2318 -26 0.2 21.096146 0 VK4WGR QG62 1629 0 (1000 uW)
Oct 3 23:20:01 2318 -7 0.0 14.097032 0 VK2OP QF69 1452 23 (200 mW)
Oct 3 23:20:02 2318 -13 0.2 14.097101 0 KO4VJV EL89UG 16140 43 (20 W)
Oct 3 23:20:02 2318 -15 0.1 28.126183 -1 WA7X DM49 14017 30 (1.0 W)
Oct 3 23:20:03 2318 -15 0.2 14.097012 0 VK2QQ QF67GT 1338 23 (200 mW)
Oct 3 23:20:03 2318 -18 0.1 28.126169 1 VK6JJJ PH16 2910 23 (200 mW)
Oct 3 23:20:03 2318 -21 0.2 28.126101 0 K5DNR EM13 14984 30 (1.0 W)
Oct 3 23:20:04 2318 -21 2.2 28.126160 0 W3PM EM64 15898 37 (5.0 W)
Oct 3 23:20:04 2318 -22 0.1 28.126087 1 AA7US DM41 13683 23 (200 mW)
Oct 3 23:20:05 2318 -23 0.2 28.126019 1 AD2Q EN81 16371 30 (1.0 W)
Oct 3 23:22:01 2320 11 0.5 18.106102 -2 VK4AAN QG61AH 1475 30 (1.0 W)

Show all FT8 decodes:
cat web888/sdr41.log | grep "FT8 DECODE:" | awk '{print $17" "$18,$19,$21,$20,$12,$13,$14,$15,$16}'

Fri Oct 3 2025 23:33:00 14074.750 KT4DM EM78 -14 16166km
Fri Oct 3 2025 23:33:00 18100.778 WA6VZN FM19 -13 16865km
Fri Oct 3 2025 23:33:00 24916.606 BG8KUB OL39 -15 7956km
Fri Oct 3 2025 23:33:15 24917.353 JA3OOK PM74 -12 7800km
Fri Oct 3 2025 23:33:15 28076.541 JH1BTY PM95 -11 7902km
Fri Oct 3 2025 23:33:30 18101.684 PY3FOX GF49 -14 12601km
Fri Oct 3 2025 23:33:30 18102.344 K5TIA EL29 -11 15004km
Fri Oct 3 2025 23:33:30 28075.403 7L4JWS PM96 -14 8014km
Fri Oct 3 2025 23:33:30 28076.106 RC0JD PO33 -13 9967km
Fri Oct 3 2025 23:33:45 18101.547 JA2YSO/P PM85 -12 7904km
Fri Oct 3 2025 23:33:45 24917.247 W2XX DM26 -13 13569km
Fri Oct 3 2025 23:33:45 24917.494 N0FW EM79 -9 16181km
Fri Oct 3 2025 23:33:45 28076.934 JA8NRS QN12 -11 8692km

Show all FT8 decodes from JA's

cat web888/sdr40.log | grep "FT8 DECODE:" | awk '{print $17" "$18,$19,$21,$20,$12,$13,$14,$15,$16} ' | egrep " J[A-Z][0-9][A-Z][A-Z][A-Z]| J[A-Z][0-9][A-Z][A-Z]"

Fri Oct 3 2025 23:31:15 28076.878 JI1ISA PM95 -13 7902km
Fri Oct 3 2025 23:31:45 21076.228 JK3HFN PM75 -10 7911km
Fri Oct 3 2025 23:31:45 21076.888 JI2VWY PM85 -13 7904km
Fri Oct 3 2025 23:32:00 28076.619 JA0IAA PM97 -9 8125km
Fri Oct 3 2025 23:32:15 18102.459 JF2DEJ PM85 -7 7904km
Fri Oct 3 2025 23:32:45 24915.581 JA2MAX/P PM95 -11 7902km
Fri Oct 3 2025 23:33:15 28076.541 JH1BTY PM95 -11 7902km
Fri Oct 3 2025 23:33:15 24917.353 JA3OOK PM74 -12 7800km
Fri Oct 3 2025 23:33:45 18101.547 JA2YSO/P PM85 -12 7904km
Fri Oct 3 2025 23:33:45 28076.934 JA8NRS QN12 -11 8692km

Show all 40m FT8 decodes
cat web888/sdr40.log | grep "FT8 DECODE:" | awk '{print $17" "$18,$19,$21,$20,$12,$13,$14,$15,$16} ' | grep " 707.\.... "

Fri Oct 3 2025 21:13:00 7076.325 EA2A IN92 -13 16479km
Fri Oct 3 2025 21:13:45 7074.347 EB4SM IN80 -14 16637km
Fri Oct 3 2025 21:14:45 7074.256 B97LRZ/P AE63 +1 4624km
Fri Oct 3 2025 21:15:30 7075.100 IZ7LDC JN80 -12 14967km
Fri Oct 3 2025 21:16:00 7075.866 PE5ZWC MF78 +11 5812km
Fri Oct 3 2025 21:20:00 7075.094 DF2RQ JN57 -13 15551km
Fri Oct 3 2025 21:20:45 7075.634 YC1GCM OI33 -15 4566km
Fri Oct 3 2025 21:43:45 7076.169 EA7KPT IM67 -15 16954km
Fri Oct 3 2025 21:54:45 7076.775 VK6WX OF85 -10 1969km
Fri Oct 3 2025 23:08:30 7076.259 9T5NJE/R HN63 -16 18503km

Friday, June 28, 2024

IM improvements using DPD with a SSPA

The question that a lot of users seem to have on their mind is "What benefits, if any do I get by using ICOMS DPD in conjunction with a Solid State Power Amplifier (SSPA)"

Well, I measured a 6dB improvement. 

Measurement setup:

Two tone test:


Result:
1st Value    -31.311dB
2nd Value    -31.455dB
3rd Value    -52.398dB
4th Value    -53.545dB
IM Max     -22.2dB
IM Avg     -21.6dB

NOTE: 1st and 2nd are the two tones and 3rd and 4th are IM3.

Look at IM3 and IM5, they are nearly the same in strength.

And the below using my Voice Caller calling CQ:


Result:
1st Value    -23.996dB
2nd Value    -31.168dB
3rd Value    -49.526dB
4th Value    -53.689dB
IM Max    -29.7dB
IM Avg    -24.0dB

DPD ON

Two tone test:


Result:
1st Value    -31.168dB
2nd Value    -31.311dB
3rd Value    -58.996dB
4th Value    -59.139dB

IM Max    -28.0dB
IM Avg    -27.8dB

Well, we do see about a 6dB improvement on the two tone test which is better than a Mosquito fart. But I believe the below is quite a good example on how well it improves your VOICE signal!

And below, using my Voice Caller calling CQ:


Result:
1st Value    -20.840dB
2nd Value    -27.582dB
3rd Value    -57.750dB
4th Value    -60.143dB

IM Max    -39.3dB
IM Avg    -34.7dB

On average we see an improvement of 7dB again better then a Mossi fart.


So I'd say any improvement, be it only 6dB is an improvement. As such I would recommend to upgrade the IC-7610 firmware and enable DPD however, YMMV ....

Tuesday, April 2, 2024

Current TX Setup

Currently I do not use the dbx in the audio chain. I use an old HEIL PROSET PLUS (HPP) headset which I purchased second hand. Now the headset itself is just average, normally I'd be using a Sennheiser for its nice fit, excellent sound reproduction and lightweight. However, the HPP headset does have the original HC4 and HC5 microphone inserts and because the dbx in in service for a different radio I opted for the HPP for the time being.

The current setup is:

    • HHP (HC5)
    • TX Bass: +3
    • TX Treble: +4
    • TBW: 200-2500
    • COMP: 8
    • MIC GAIN: 35%


Wednesday, November 29, 2023

ICOM IC-7610 Digital Predistortion

Well it was only a matter of time (a long time though) that one of the big three Amateur Radio Suppliers would follow the ANAN "PureSignal" crase. 

So what is this Digital Pre-Distortion or DPD for short anyway.

Well, a tiny winey bit of techo talk first.

Every radio has an RF amplifier. This is a component which does add to the performance, and as such to the communication distance of the radio. Sometimes we use an external amplifiers to increase the performance of our radio and even though we call our amplifiers "Linear-amplifier", the RF amplifiers is quite a non-linear device. This nonlinearity creates spectral growth (IM) which leads to interference of adjacent channels. 

Please note that the above is a very, and I really mean a very simplified view.

DPD is a technique to linearise an amplifier, which is basically a mechanism to improve the cleanliness of one's transmission, i.e. to reduce the spectral growth, also known as intermodulation (IM) products.

If you like to get a better understanding of DPD, checkout this description, an excellent read.

To enable DPD on the IC-7610 we need to update the Firmware of the radio to the latest firmware version, Ver. 1.40 available from ICOM Japan.

And before we go any further I'll answer the most important question first!

 "So is it working?"

Yes!

To show you the difference between DPD and non-DPD I've created a few screenshots using 100W into a RF Dummy Load and using my SDR-IQ as a Spectrum Analyser. The transmitted output power of the radio has been set to 100W for these tests.

Pictures 1 and 2 are using a two tone signal recorded and installed onto the IC-7610 TX Voice memories.

Picture 1: 2-tone audio signal, DPD OFF

Picture 2: 2-tone audio signal, DPD ON


And Pictures 3 and 4 are plain old voice signals.

Picture 3: Voice signal, DPD OFF

Picture 4: Voice signal, DPD ON


As can be seen the "crud" (IM) has been reduced quite a bit. I'd say about 20dB more cleanliness. Quite an improvement. 

So onto how to set this up. But first a note:

Before we can enable DPD we need to add a RF Dummy Load to one of the Antenna Ports of the Radio. 

This Dummy Load needs to have a reasonable low VSWR of at least 1.5:1 across all the bands that we would like to use with DPD.

So if we go into the SET Menu we should see a new Menu entry. The DPD Adjustment Menu as depicted in Picture 5. (Only after the installation of the Firmware Ver. 1.40)

Picture 5

If we select the DPD Adjustment Menu we have the option of selecting three different adjustments. Since I don't have an ICOM PW-2 I did select the IC-7610 Single Adjustment.

Picture 6

If you are the owner of an ICOM PW-2 you would follow the setup/adjustments as per the PW-2 manual. 

NOTE: At this stage I have not found a way to integrate my Amplifier into the DPD loop. It is fairly simple using only a TAP to feed an AC (RF) voltage back to an ANAN radio for DPD (Pure Signal) however, this doesn't seem to be the case with the ICOM. It looks like a little bit more trickery is involved to make the feedback loop work with a non-ICOM amplifier.

However, it is still a worthwhile improvement to utilise DPD only on the Radio. 

Remember: 

So by cleaning up the signal to feed your amplifier you will gain lots of brownie points within the community.

The next step is to run the adjustments per band you'd like to operate and use DPD on.

Picture 7

As you can glean from Picture 7, I have run the DPD adjustments successful on most of the band I will operate on. This is indicated by a tick and pawn icon next to the Band designator. 

And you're done.

Try it and be one of the "cleaner" signals on our bands. 

Additionally, if you don't have DPD the following most likely will help you to become one of the cleaner signals on the band. To reduce this nonlinearity, we could operate our amplifier at a lower power so that the active device in your (Linear)-amplifier (the power transistor or valve) will operate within its linear region.

Who would have thought that that is an option

Oh, and if you do not believe me maybe the below quote from the ARRL-LAB will convince you.

Excerpt: (Page 38 - Lab Notes: RF-KIT RF2K-S)

Update: 

The below is my signal on 20m:


And on 40m:

Saturday, July 1, 2023

Controling the RF-KIT Amplifier via UDP

Having gone through the trials and tribulation of online "shopping for answers" I thought I better write down how I got my amplifier to follow the band/frequency of my radio, an ICOM IC-7610.  

Please note: Many ways lead to Rome, as well to a solution for the amplifier to follow the Radios frequency/band. This is only one of the many.

Since I've already control my radio from my PC via the logging program from DXLAB, it was quite easy to Setup the amplifier to follow the radios frequency/band after some very good information had been passed on from Martinus, CT1IQI.

I first configured the amplifier for network access. I tried using the WiFi Interface but that had intermittent hissifits  so I connected it to my wired network using a STP patch cable (CAT6) and configured the Network interface of the RF2K-S through the menu system.

From the main screen select [MENU] :


and select [Network] [LAN] or [WiFi] :


The default will be DHCP however, I would advise to use a manual IP-Address. It does make it easier in finding the devices IP-address (YMMV). And should the DHCP reservation time out, it might assign a new IP-Address to the amplifier causing future connection issues.

NOTE: If you are using DHCP you'll have to search for the IP-address in your router/dhcp server address table. Make sure to have the address reserved, i.e. map the address as a static address. Consult your manual on how to do so (it would be nice it the amplifier would display its own LAN/WiFi MAC-Address, this would make finding the DHCP assigned IP-address a lot easier)


I've setup my router to act as a Name Server, as such I've also populated the [Name Server] field. (Again YMMV)

To test if the amplifier is reachable from your PC use the ping command. 

hw@rapi4:~ $ ping -c 3 rf2k-s <-- use your amplifiers IP-address (ping 1.2.3.4)
PING rf2k-s (192.168.1.11) 56(84) bytes of data.
64 bytes from rf2k-s (192.168.1.11): icmp_seq=1 ttl=64 time=0.476 ms
64 bytes from rf2k-s (192.168.1.11): icmp_seq=2 ttl=64 time=0.429 ms
64 bytes from rf2k-s (192.168.1.11): icmp_seq=3 ttl=64 time=0.423 ms
--- rf2k-s ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 0.423/0.442/0.476/0.023 ms

Having finished setting up the Network interface of the amplifier it's time the control Interface.
Select [Interface] and select UDP as the Default operational interface:


Now select [UDP] to select Port 12060 (the default)



and check Listen to active radio.

Now onto the Radio Control Application. In my case that is Commander from the DXLAB suite of applications. 

NOTE: I've been told that Log4OM is capable of the same feat however, I've not tried this.

In Commander open the Configuration Panel and select <Net Serv> from the [General] tab:


which brings us to the UDP Network Service window.


We add our amplifier IP Address and Port number as shown and enable the UDP Network Service. The New transceiver (Xcvr) Delay is set at 10, you might like to experiment here if you are using a WiFi connection.  

That's it for the configuration. For operation you would make sure that you select UDP through the UNIV menu.




Monday, May 29, 2023

A Multi Frequency WSPRing (whispering) System using KA9Q-Radio

The "KA9Q Radio software suit" is a an ingenious sort of a SDR program suite. It is capable of receiving a huge number of frequencies simultaneously. I believe that this is a unique feature of this applications. It seems to go back to the original *nix philosophy of "small is beautiful" e.g. small well written applications that do one job and do this one job very well. Because there is no graphical ballast, it will perform its task on the most modest comput-hardware. Meaning it will run on a Raspberry Pi system starting with the Pi3. Note, that there is no need for an expensive GPU nor the need to use virtual audio cables or a Soundcard for that matter.

Because of the "multiple frequencies simultaneously" capability I've set up a WSPR receiver for my QTH so that during times that I do not operate I can at least monitor band activity and/or propagation. Initially I will monitor from LF (136kHz) to the end of HF (28MHz). If this is going to workout well I will also start building a system for VHF/UHF.  

Depending on the SDR one is going to use there is a requirement for a fast to really fast USB port. In my case I'm going to use the RX888M2, which needs a really fast USB3 port to stream 32 MHz of bandwidth in one go across the port. However, if I would use my Pluto or RSPdx and any of the TV-Dongles I can get away with a speedy USB2 port and for the SDR-IQ with it max 192kHz a slow USB port will do.

I can't stress this enough, the use of good usb cables is a requirement (not to long and it should have good shielding). Additionally, even though all my cables come with a molded choke, I do add additional choke(s) to all of my cables. I've had good success with that however, if that doesn't help reducing the noise from the USB/PC connection then "these" are apparently very good in suppressing CMC noise (EMI).

Below are the steps that I used to get the system up and running. And I believe that if you follow those steps you will be able to get a working "Multi Frequency WSPR receiving System" up and running in no time.

I've had a spare little PC (NUC) lying around (I7-4765) with 8GB of memory and a 250GB SSD which I bought second hand for about A$250. My installation is based on Debian Version 11.7 (Bullseye) and all following steps are based on this OS. The reason to use the NUC was to have both the SDR and the WSPR decoder running on a single host. The WSPR decoder is chewing up all the available CPU resources. 

If you go with the Pi solution I recommend at least a Pi4-4GB and to install Debian Bullseye.

WARNING: If you are going to use a Raspberry PI as the compute resource make absolutely sure that you have enough current available to support the Pi and the RX888! I use a home made 5V 10A Power-supply which is feed of the shacks 12V rail. I've tried with a powered USB-HUB to no avail!

INFO: I have highlighted text in bold, this is so one can copy and then paste the copied text into a terminal instead of typing everything into the terminal. Don't forget to press <Enter> at the end. Command returns are displayed in courier.

NOTE: sudo didn't work for me out of the box.

There are many ways to fix this issue however, I did it this way:
$ su -
 echo "$(who am i | awk '{print $1}') ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/$(who am i | awk '{print $1}')
chmod 440 /etc/sudoers.d/$(who am i | awk '{print $1}')
# ls /etc/sudoers.d/$(who am i | awk '{print $1}')
 -r--r----- 1 root root 27 May 28 20:21 /etc/sudoers.d/<your username>

So with that out of the way we can now get and install required libraries.

$ echo "
build-essential
libusb-1.0-0-dev
libusb-dev
libncurses5-dev
libfftw3-dev
libbsd-dev
libhackrf-dev
libopus-dev
libairspy-dev
libairspyhf-dev
librtlsdr-dev
libiniparser-dev
libavahi-client-dev
portaudio19-dev
libopus-dev" > /tmp/required

$ for _required in $(cat /tmp/required); do sudo apt install $_required -y; done

If you like to run the system for a while it helps if the stupid hibernation is switched off.

 $ sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

I find it much easier to work with names rather then with ip-addresses and port-numbers, as such I'd use the Multicast DNS function of the AVAHI Daemon. Your mileage may vary though! 

$ sudo systemctl start avahi-daemon.service
$ sudo systemctl status avahi-daemon.service
 avahi-daemon.service - Avahi mDNS/DNS-SD Stack
     Loaded: loaded (/lib/systemd/system/avahi-daemon.service; enabled; vendor preset: enabled)
     Active: active (running) since Sun 2023-06-11 22:16:53 ACST; 3 days ago
TriggeredBy: ● avahi-daemon.socket
   Main PID: 548 (avahi-daemon)
     Status: "avahi-daemon 0.8 starting up."
      Tasks: 2 (limit: 9342)
     Memory: 1.3M
        CPU: 15.899s
     CGroup: /system.slice/avahi-daemon.service
             ├─548 avahi-daemon: running [sun.local]
             └─566 avahi-daemon: chroot helper

Not needed in the use case.

Check if en_US.UTF-8 language is installed.
First check:
$ locale -a
C
C.UTF-8
en_AU.utf8
POSIX

And if it is missing, run:
$ sudo dpkg-reconfigure locales

This will bring up a graphical-ui (ncurses) selection display. Scroll down until you see en_US_UTF-8, press spacebar to select and then <ok>

Generating locales (this might take a while...)
  en_AU.UTF-8... done
  en_US.UTF-8... done
Generation complete. 
 
$ locale -a
C
C.UTF-8
en_AU.utf8
en_US.utf8 <-- required
POSIX

Now download the source files for the KA9Q radio suit:
$ mkdir tmp
$ cd tmp
wget https://github.com/ka9q/ka9q-radio/archive/refs/heads/main.zip

Extract the downloaded file (main.zip):
$ unzip main.zip
$ ls -l
total 2.4M
drwxr-xr-x 4 hw hw 4.0K May 28 16:15 ka9q-radio-main
-rw-r--r-- 1 hw hw 2.4M May 28 18:16 main.zip

Compile and install KA9Q-Radio applications:
$ export LANG=en_US.UTF-8
$ cd ka9q-radio-main

NOTE: There are two (2) Makefiles, Makefile.linux and Makefile.pi. If you use a RaPi you need to link Makefile.pi to Makefile 

$ ln -s Makefile.linux Makefile 
$ sudo make install

Next we create a "wisdom" file. 

NOTE: Depending on your system this can take a while. Creating a wisdom file on a RaPi took a while. I cooked a meal, ate the meal, check the RaPi .... not yet .... went and watch a movie ... check again and voila done! So be patience grasshopper.

$ fftwf-wisdom -v -T 1 -o /tmp/wisdom rof500000 cof36480 cob1920 cob1200 cob960 cob800 cob600 cob480 cob320 cob300 cob200 cob160

Or if you are keen and like to know how long it took to create your wisdom file you could run the below.

$ time fftwf-wisdom -v -T 1 -o /tmp/wisdom rof500000 cof36480 cob1920 cob1200 cob960 cob800 cob600 cob480 cob320 cob300 cob200 cob160
fftw-wisdom: system-wisdom import failed
Planning transform: cob160
Planning transform: cob200
Planning transform: cob300
Planning transform: cob320
Planning transform: cob480
Planning transform: cob600
Planning transform: cob800
Planning transform: cob960
Planning transform: cob1200
Planning transform: cob1920
Planning transform: cof36480
Planning transform: rof500000

real    4m14.131s
user    4m8.088s
sys     0m0.048s

Move the generated wisdom file in to its rightful place.
$ test -s /var/lib/ka9q-radio/wisdom && sudo mv /var/lib/ka9q-radio/wisdom /var/lib/ka9q-radio/wisdom.old
$ sudo mv /tmp/wisdom /var/lib/ka9q-radio/wisdom
$ sudo chown $(who am i | awk '{print $1}').radio /var/lib/ka9q-radio/wisdom

Now its time to install the K1JT's WSPR Application.
$ sudo apt install wsjtx -y

After that is finished it's time ....  to configure/setup KA9Q-Radio for our intended purpose.

There are lots of config files and to work through all off them you'll want/need to read the documentation from here however, since I'm going to use the RX888 to do WSPR only as such I've created a new rx888.conf config file. The # and ; a comment markers. You can either modify this file with a text editor like vi or nano.

Before you copy and paste the next configuration item (below, you need to establish what the active network interface is being named! In the rx888.conf file we has a statement starting with iface. This value is system dependent and you need to find that name before you can progress any further.

On a RaPi it is most likely eth0, but on other systems it could be something else. E.g. on my system it is eno1
You'll be able to check using the following:
ip a | grep "mtu 1500" | grep UP | awk '{print $2}'
eno1: <- This is what the NIC is called on my system

Whatever the above command output shows, you'll might need to change the iface value in the below script. E.g. if it shows eth0 your iface line should read iface = eth0.

The below will create a backup of the /etc/radio/rx888d.conf file first, before creating a new /etc/radio/rx888d.conf file. 

$ sudo mv /etc/radio/rx888d.conf /etc/radio/rx888d.conf.bck
$ sudo cat << __EOF__ > /etc/radio/rx888d.conf
[rx888-loop]
# VK5HW customized
description = "RX888 40m Delta-Loop"
firmware = SDDC_FX3.img
samprate = 64800000    ;  2^8 * 3^4 * 5^5
iface = eth0               ; replace this with your iface name
status = rx888-status.local
data = rx888-pcm.local
ssrc = 10
;gain = 1.5 ; dB
gain = 10 ;dB - close to the Noise Floor, might have to increase
gainmode = high ; higher gain range
__EOF__

Next we need to configure the virtual receivers. These we do with the radiod@wspr.conf file. 
$ sudo mv /etc/radio/radiod@wspr.conf /etc/radio/radiod@wspr.conf.old
$ sudo cat << __EOF__ > /etc/radio/radiod@wspr.conf
[global]
overlap = 5
blocktime = 20
input = rx888-status.local
samprate = 12000
mode = usb
status = hf.local
fft-threads = 2

[WSPR]
# Bottom of 200 Hz WSPR segments on each band. Center is 1500 Hz higher
# sample rate must be 12 kHz as required by wsprd
data = wspr-pcm.local
freq = "136k000 474k200 1m836600 3m568600 5m287200 7m038600 10m138700 14m095600 18m104600 21m094600 24m924600 28m124600"
__EOF__

That's it folks, we are ready to start KA9Q-Radio! Make sure the RX888 is plug into the correct USB Port and then to be sure to be sure REBOOT the system.
$ sudo reboot

After the reboot, login to the system and start the rx888d(river) using the rx888-loop configuration.
/usr/local/sbin/rx888d rx888-loop &

NOTE: The & indicates that we would like the program (job) to run in the background.

If everything is OK the following output can be seen:
$ Using config file /etc/radio/rx888d.conf
Loading firmware file /usr/local/share/ka9q-radio//SDDC_FX3.img
Firmware already loaded
USB speed: 4
Successfully claimed interface
Samprate 64,800,000, Gain 10.0 dB, Attenuation 0.0 dB, Dithering 0, Randomizer 0, USB Queue depth 16, USB Request size 8 * pktsize 16384 = 131,072 bytes
service 'RX888 40m Delta-Loop._ka9q-ctl._udp' -> rx888-status.local (239.132.105.12) established
service 'RX888 40m Delta-Loop._rtp._udp' -> rx888-pcm.local (239.10.102.92) established
RX888 40m Delta-Loop: iface eno1; status -> 239.132.105.12:5006, data -> 239.10.102.92:5004 (TTL 0, TOS 48, 24576 samples/packet)

If this all looks ok the PC is talking to the SDR and it is time to start the demodulators.
$ /usr/local/sbin/radiod /etc/radio/radiod@wspr.conf &
$ KA9Q Multichannel SDR
Copyright 2018-2022 by Phil Karn, KA9Q; may be used under the terms of the GNU General Public License
Loading config file /etc/radio/radiod@wspr.conf...
Acquired front end control stream rx888-status.local (239.132.105.12)
Acquired front end data stream 239.10.102.92:5004 (239.10.102.92)
Front end sample rate 64,800,000 Hz, real; block time 20.0 ms, 50.0 Hz
fftwf_import_system_wisdom() failed
fftwf_import_wisdom_from_filename(/var/lib/ka9q-radio/wisdom) succeeded
service 'wspr._ka9q-ctl._udp' -> hf.local (239.83.95.156) established
Processing [wspr]
service 'wspr._rtp._udp' -> wspr-pcm.local (239.72.24.12) established
12 demodulators started
12 total demodulators started

Next start start the wspr-decoder:
$ wspr-decoded wspr-pcm.local

And voila we are starting to see decodes:
$ <DecodeFinished>
<DecodeFinished>
<DecodeFinished>
<DecodeFinished>
<DecodeFinished>
<DecodeFinished>
1518 -19  0.7   0.475683  0  VK6LX OF88 30
<DecodeFinished>
<DecodeFinished>
<DecodeFinished>
1518 -17  0.3   7.040113  0  RU0LL PN53 33
<DecodeFinished>
1518 -27  0.4  14.096975  0  WS5L EM13 37
1518 -12  0.2  14.096984  0  WB7AJP CN87 33
1518 -23  0.3  14.097017  0  <KR6RG> DM13EM 23
<DecodeFinished>
<DecodeFinished>

Looking at our home directory we can see that we have a few new directories. These are the directories of the individual virtual receivers where all the WSPR files go.
$ ls -l
total 104K
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 10138700
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 136000
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 14095600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 18104600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 1836600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 21094600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 24924600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 28124600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 3568600
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 474200
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 5287200
drwxr-xr-x 2 hw hw 4.0K May 29 00:54 7038600

Lets have a look what's inside these directories:
$ ls -l 5287200
total 8.7M
-rwxr-xr-x 1 hw hw 2.1M May 28 00:01 230527_1430.wav
-rwxr-xr-x 1 hw hw 1.9M May 28 01:17 230527_1546.wav
-rwxr-xr-x 1 hw hw 1.4M May 28 09:05 230527_2334.wav
-rwxr-xr-x 1 hw hw 2.6M May 29 00:47 230528_1516.wav
-rwxr-xr-x 1 hw hw 2.1M May 29 00:57 230528_1526.wav
-rw-r--r-- 1 hw hw    0 May 28 00:33 ALL_WSPR.TXT
-rw-r--r-- 1 hw hw    0 May 29 00:55 hashtable.txt
-rw-r--r-- 1 hw hw    0 May 29 00:55 wspr_spots.txt
-rw-r--r-- 1 hw hw  452 May 29 00:55 wspr_timer.out
-rw-r--r-- 1 hw hw 2.0K May 29 00:55 wspr_wisdom.dat
$ ls -l 14095600
total 8.8M
-rwxr-xr-x 1 hw hw 2.1M May 28 00:01 230527_1430.wav
-rwxr-xr-x 1 hw hw 1.9M May 28 01:17 230527_1546.wav
-rwxr-xr-x 1 hw hw 1.4M May 28 09:05 230527_2334.wav
-rwxr-xr-x 1 hw hw 2.6M May 29 00:47 230528_1516.wav
-rwxr-xr-x 1 hw hw 2.1M May 29 00:59 230528_1528.wav
-rw-r--r-- 1 hw hw  36K May 28 23:34 all_wspr.bck
-rw-r--r-- 1 hw hw 3.0K May 29 00:57 ALL_WSPR.TXT
-rw-r--r-- 1 hw hw 3.6K May 29 00:57 hashtable.txt
-rw-r--r-- 1 hw hw  45K May 28 23:34 upload.log
-rw-r--r-- 1 hw hw   74 May 29 00:57 wspr_spots.txt
-rw-r--r-- 1 hw hw  452 May 29 00:57 wspr_timer.out
-rw-r--r-- 1 hw hw 2.0K May 29 00:57 wspr_wisdom.dat

In the 14095600 directory we find two additional files, all_wspr.bck and upload.log. These are files that my upload script is producing. The .bck file is an archive of ALL_WSPR.TXT and the .log file is for error checking.

And here is a snapshot view of a decoded dataset:

$ cat 14095600/ALL_WSPR.TXT
230528 1508 -18 -0.91  14.0969794  DP0POL JQ26 37          0  0.12  3  1    0  0  34    33  -120
230528 1508 -15  0.19  14.0969838  WB7AJP CN87 33          1  0.28  1  1    0  0  39    20    16

As it stands you now have a MULTI BAND WSPR DECODING SYSTEM

And now to upload the results to WSPRNet, that is also quite easy. It is  done with a one-liner:

$ curl -F allmept=@ALL_WSPR.TXT  -F call=<your call>  -F grid=<your grid>  http://wsprnet.org/meptspots.php

There is a very similar site, PSKREPORTER which not only has a database for WSPR but for a lot of other digital modes. However, I've not (yet) found a way how to upload my results to that repository.

I have automated this on my system using the *nix cron facility. I first created a script to archive the reports and create a log file for error checking. If you like to use the script, it can be found here

And here is my crontab: (copy the below to your crontab)
1,7,13,19,25,31,37,43,49,55 * * * * ~/scripts/upload_wspr_data.sh VK5HW PF94hk

It basically runs every 6 minutes, a minute after or before a WSPR decode.

Oh, and if you like to see if I received you go to WSPR rocks, which is an excellent tool for mapping, charting and other visualisation. 

So that's basically it. 
PLEASE NOTE, that this is NOT a how to use KA9Q-Radio, rather a quick way to show how easy it is to setup a multiple frequency WSPR receiving system using parts of the KA9Q-Radio suite. 
There are other modes that can be setup and monitored,  if you like to use other modes or even would like to manually tune through the bands and listen you'd need either a sound card or understand how to use "MULTICAST" streaming. The options are not quite endless but ...

Next on the list, get some horizontal antenna for a 2m/70cm/23cm installed and setup a WSPR VHF/UHF receive system. 

Oh and a little bragging ...





Appendix: