GithubHelp home page GithubHelp logo

kc3pib / wsjtxutils.searchlight Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 0.0 69 KB

A .NET 6 console application that highlights callsigns within WSJT-X based on reception reports from PSK Reporter.

License: MIT License

C# 100.00%
ham-radio amateur-radio wspr jt65 wsjtx wsjt-x ft4 ft8 hamradio amateurradio

wsjtxutils.searchlight's Introduction

WsjtxUtils.Searchlight

A .NET 6 console application that highlights callsigns within WSJT-X based on reception reports from PSK Reporter.

WjtxUtils.Searchlight will download reception reports from PSK Reporter for the callsigns of any connected WSJT-X client. These reception reports are then correlated with recent decodes and highlighted within WSJT-X. The background color of the highlighted callsign is mapped to the range of received reception report SNR values and used to indicate the relative strength of the received signal.

When a logged QSO occurs, that callsign will be highlighted for the duration of the application and can be optionally logged to a file to allow for tracking logged QSOs between sessions.

There is a countdown period when the application starts until requesting the first reception report, which defaults to 5 minutes. This period is an excellent time to call CQ for a while to seed the initial reception report.

NOTE: To use 3rd party software (GridTracker) or multiple WSJT-X instances (SO2R), you must configure WSJT-X, searchlight, and any 3rd party software to use a multicast address.

Requirements

For pre-compiled releases:

To compile from source:

Quickstart

For pre-compiled releases (win-x64, linux-x64, osx-x64):

  • Ensure that you have the .NET 6 runtime installed
  • Download the package for your OS
  • Extract the archive to your desired location
  • Run the executable file
    • Windows WjtxUtils.Searchlight.Console.exe
    • Linux & OSX WsjtxUtils.Searchlight.Console
  • CTRL-C in the console to exit
  • Edit the config.json file to customize available options

To compile from source:

  • Ensure that you have the .NET 6 SDK installed
  • Clone or download the source code
  • dotnet publish -c release src/WsjtxUtils.Searchlight.Console/WsjtxUtils.Searchlight.Console.csproj --output <OUTPUT_DIRECTORY>

Configuration

Options can be configured by editing the config.json file or by overriding specific parameters by command-line. These options include WSJT-X server IP address and port, the colors used for highlighted callsigns, reception report window/request period, and logging options.

To change the UDP server IP Address or port to listen for messages from WSJT-X

"Server": {
    "Address": "127.0.0.1",
    "Port": 2237
  }

To use 3rd party software (GridTracker) or operate more than one WSJT-X instance (SO2R) use a multicast address.

"Server": {
    "Address": "224.0.0.1",
    "Port": 2237
  }

The color options used for reception reports and logged QSOs are altered through the Palette section. ReceptionReportBackgroundColors is a list of colors, a gradient, used as the background color for reception reports. The first color in the list represents the weakest SNR report values and the last the strongest SNR values. ReceptionReportForegroundColor controls the color used for highlighted text (callsigns). Both ContactedBackgroundColor and ContactedForegroundColor are used for logged QSOs. HighlightCallsignsPeriodSeconds is the period at which callsigns will be correlated and highlighted based on the current reception report.

"Palette": {
    "ReceptionReportBackgroundColors": [ "#114397", "#453f99", "#653897", "#812e91", "#991f87", "#ae027a", "#be006a", "#cb0058", "#d30044", "#d7002e" ],
    "ReceptionReportForegroundColor": "#ffff00",
    "ContactedBackgroundColor": "#000000",
    "ContactedForegroundColor": "#ffff00",
    "HighlightCallsignsPeriodSeconds": 5
  }

Reception report options are altered through the PskReporter section. ReportWindowSeconds is a negative number in seconds to indicate how much data to retrieve. This value cannot be more than 24 hours and defaults to -900 seconds or the previous 15 minutes, which should be enough data for current band conditions. ReportRetrievalPeriodSeconds controls how often reception reports are retrieved. Philip from PSK Reporter has asked to limit requests to once every five minutes. IMHO Philip does a considerable service to the ham radio community with this data, don't abuse it.

"PskReporter": {
    "ReportWindowSeconds": -900,
    "ReportRetrievalPeriodSeconds": 300
  }

The LoggedQsos section allows adding an optional log file to maintain logged QSOs across searchlight sessions. Set a LogFilePath to enable QSO logging. QsoManagerBehavior controls how logged QSOs are highlighted, once per band or once per band and mode.

"LoggedQsos": {
    "LogFilePath": "qsolog.txt",
    "QsoManagerBehavior": "OncePerBand"
  }

Console and file logging output is controlled through the Serilog section. Please see the Serilog documentation for details.

"Serilog": {
    "MinimumLevel": "Information",
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "theme": "Serilog.Sinks.SystemConsole.Themes.AnsiConsoleTheme::Code, Serilog.Sinks.Console",
          "outputTemplate": "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj} {NewLine}{Exception}"
        }
      }
    ]
  }

wsjtxutils.searchlight's People

Contributors

dependabot[bot] avatar kc3pib avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

wsjtxutils.searchlight's Issues

Parsing special operating activity messages

WsjtxQsoParser is a useful class that should probably be included in the WsjtxUtils library. However, it fails to parse some Special Operating Activity (such as ARRL Field Day) messages, e.g. VE3NEA VE3RYI R 1D GTA . My current work around is to just look for anything that is a valid callsign or grid square:

var wsjtxQso = WsjtxQsoParser.ParseDecode(message);
if (string.IsNullOrEmpty(wsjtxQso.DECallsign)) ParseSpecialMessage(wsjtxQso);

where

        private void ParseSpecialMessage(WsjtxQso wsjtxQso)
        {
            var parts = wsjtxQso.RawMessage
                .Replace("<", "")
                .Replace(">", "")
                .Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Where(part => part != "?")
                .ToArray();

            if (parts.Any() && parts[0] == MyCall)
                wsjtxQso.DXCallsign = parts[0];

            int idx = FindSenderCallsign(parts);
            if (idx == -1) return;
            wsjtxQso.DECallsign = parts[idx];

            if (++idx < parts.Length && parts[idx] == "R") idx++;
            if (idx < parts.Length && Utils.GridSquareRegex.IsMatch(parts[idx]))
                wsjtxQso.GridSquare = parts[idx];
        }

        private int FindSenderCallsign(string[] parts)
        {
            for (int i = parts.Length - 1; i > 0; i--)
                if (Utils.CallsignRegex.IsMatch(parts[i]))
                    return i;

            return -1;
        }

The regular expressions to match the callsign and grid square are as follows:

    internal static class Utils
    {
        public static Regex CallsignRegex = new Regex(
            // portable prefix
            @"^((?:(?:[A-NPR-Z](?:(?:[A-Z](?:\d[A-Z]?)?)|(?:\d[\dA-Z]?))?)|(?:[2-9][A-Z]{1,2}\d?))\/)?" +
            // prefix
            @"((?:(?:[A-NPR-Z][A-Z]?)|(?:[2-9][A-Z]{1,2}))\d)" +
            // suffix
            @"(\d{0,3}[A-Z]{1,6})" +
            // modifier
            @"(\/[\dA-Z]{1,4})?$",
            RegexOptions.Compiled
        );

        public static Regex GridSquareRegex = new Regex(@"^(?!RR73)[A-R]{2}\d{2}$", RegexOptions.Compiled);
}

It would be nice to add support of Special Activities message formats, and perhaps optionally validate the grid square and callsigns.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.