Radio Propagation Service: Difference between revisions

From Maria GDK Wiki
Jump to navigation Jump to search
Asp (talk | contribs)
No edit summary
Asp (talk | contribs)
No edit summary
 
(4 intermediate revisions by 2 users not shown)
Line 100: Line 100:
=== Skywave data ===
=== Skywave data ===


HF skywave calculations use ITU-R P.533/P.372 data files, which are '''not''' included with the binaries. Obtain the required maps and radio-noise files separately from the ITU-R Study Group 3 sources, place them in a readable directory, and set <code>RadioPropagationSettings:Skywave:DataDirectory</code> to its path. Missing files are reported when first used.
HF skywave calculations use ITU-R P.533/P.372 data files, which are '''not''' included with the binaries. Obtain the required maps and radio-noise files separately from the ITU-R Study Group 3 sources, place them in a readable directory, and set <code>RadioPropagationSettings:Skywave:DataDirectory</code> to its path. Missing files are reported when Skywave prediction is requested.


=== Check the service and upgrade safely ===
=== Check the service and upgrade safely ===
Line 113: Line 113:




 
=== Deployment Strategies ===
For deployment strategies, see [[RadioPlan Service Deployment Strategies]]


[[Category:RadioPlan]]
[[Category:RadioPlan]]

Latest revision as of 07:23, 19 October 2026

Radio Propagation Service

RadioPropagationService is a .NET gRPC service for radio-propagation calculations. It provides direct profile and area predictions, HF groundwave using LFMF algorithms, HF skywave frequency scans and area coverage, and queued coverage-file calculations. Map data can come from local MariaGDK files or a GeoServer. Native dependencies include ITM for terrestrial calculations and the ITU-R P.533/P.372 reference engine for skywave predictions.

Installing and running the service

Before you start

Have these ready:

  • A release package for your operating system and architecture. Keep the entire extracted folder, including configuration files and native libraries.
  • Access to map data: a local MariaGDK data folder (preferred for performance) or a reachable GeoServer.
  • The web and gRPC addresses of a reachable AntennaService. These can be different addresses.
  • A writable location for prediction files and logs.
  • An HTTPS certificate for the hostname clients will use, unless a trusted proxy terminates TLS.
  • For HF skywave predictions, separately obtained ITU ionospheric and radio-noise data (about 135 MB). This data is not included in a release.

Install and configure

  1. Extract the whole release package to its intended application directory.
  2. Open appsettings.json and, if present, appsettings.Production.json in the extracted folder. The Production file overrides the shared file when the environment is Production. Replace the sample machine paths, ports, and service addresses. Do not use the sample Development settings on a deployed service.
  3. Choose a map source, configure both AntennaService addresses, and set an output directory. Use the settings reference below.
  4. Configure the listening addresses and HTTPS certificate as described below. The bundled Production example is for local development, not a public deployment.
  5. If you need skywave predictions, provide the separate ITU data files and configure their directory.
  6. Start the executable TPG.RadioPropagationService.Api.exe (or use your normal Windows service/service-hoster deployment), then check /health and /ready.

For a console start on Windows, open PowerShell in the extracted application folder and run:

.\TPG.RadioPropagationService.Api.exe

If you install it as a Windows service, ensure its service account has access to the application files, certificate private key, map data, ITU data, and writable prediction and log directories. Environment-variable settings must be available to the service process, not just your interactive terminal.

Settings reference

These are the settings most installations need to review. The paths and URLs shipped in the sample files are examples, not values to use unchanged.

Setting What to provide
Services:MariaGdkDataFolder Local MariaGDK map-data directory. Used when GeoServerAddress is unset.
Services:GeoServerAddress Optional GeoServer URL; if set, selects GeoServer instead of local map files. Remote raster fetching is generally slower.
Services:AntennaServiceAddressGrpc AntennaService gRPC address for antenna-pattern requests.
Services:AntennaServiceAddressWeb AntennaService web base address used for its /health and /ready checks.
RadioPropagationSettings:PredictionFilesDirectory Writable directory for predictions and coveragepredictions.sqlite. Preserve and back up this directory when upgrading.
RadioPropagationSettings:Skywave:DataDirectory Directory containing the separate ITU data files; see "Skywave data" below.
Kestrel:EndPoints HTTP/HTTPS listening URLs and the HTTPS endpoint certificate; see "HTTPS certificates" below.
Serilog:WriteTo Console/file logging. Change the sample file-log path if needed and ensure it is writable.
MaxReceiveMessageSize Maximum incoming gRPC message size in bytes; the shared sample uses 8 MiB (8388608).
Settings:PathBase Optional URL prefix supplied by a service hoster. Health URLs then become <path-base>/health and <path-base>/ready.

Other RadioPropagationSettings values control the calculation workload and output: NumberOfThreads (nonpositive selects available cores, capped at six for terrestrial calculations), MaxPixelCount, cache size and expiration, CircularPredictionArea, PathLossThreshold, Precision, ParentTileZoomLevels, GeneratePngTiles, CoverageFileVersion, and groundwave ReverseSubsample (at least 1). The sample uses coverage-file version v13; choose a version supported by your clients.

RadioPropagationSettings:TimedConsumeCoverageCalculationServiceSettings:LoopWaitTime is the background job polling interval in milliseconds and must be positive. Geopackage selects GeoPackage output. AllowedHosts controls accepted host names; the shared sample permits all hosts. The sample ErrorUrl is present but is not a substitute for checking startup logs.

Configuration keys can be overridden through environment variables by replacing : with __; for example, Services__AntennaServiceAddressGrpc. Use a protected deployment secret mechanism for passwords rather than storing them in appsettings files.

HTTPS certificates

The sample appsettings.Production.json listens on localhost and selects a localhost certificate from the Windows LocalMachine store with AllowInvalid: true. Replace this for deployment. Use a valid certificate matching the hostname clients connect to, remove AllowInvalid, and ensure clients trust its issuing CA. localhost-only listeners are not reachable from other machines.

For a PFX certificate, replace the HTTPS endpoint's Certificate section in the deployed Production configuration (do not merely add a path to the shared file while the Production certificate settings remain). For example:

{
  "Kestrel": {
    "EndPoints": {
      "Http": { "Url": "http://localhost:26080" },
      "Https": {
        "Url": "https://rps.example.com:26443",
        "Certificate": { "Path": "C:\\certs\\rps.pfx" }
      }
    }
  }
}

Configure ASPNETCORE_Kestrel__EndPoints__Https__Certificate__Password using your deployment's protected secret mechanism in the service process environment. Do not put the password, PFX, or private key in source control or a release archive. The service account needs permission to read the PFX.

Alternatively, select a certificate already installed in the Windows LocalMachine certificate store:

"Certificate": {
  "Subject": "rps.example.com",
  "Location": "LocalMachine"
}

Ensure the certificate has a private key accessible to the service account. If a reverse proxy terminates TLS instead, configure the proxy certificate and maintain gRPC-compatible HTTP/2 connectivity between the client and service. Do not disable certificate validation on clients. The ASP.NET Core development certificate is for local testing, not a deployed service.

Skywave data

HF skywave calculations use ITU-R P.533/P.372 data files, which are not included with the binaries. Obtain the required maps and radio-noise files separately from the ITU-R Study Group 3 sources, place them in a readable directory, and set RadioPropagationSettings:Skywave:DataDirectory to its path. Missing files are reported when Skywave prediction is requested.

Check the service and upgrade safely

Visit https://rps.example.com:26443/health and https://rps.example.com:26443/ready, substituting your configured host and port. Add the configured path base if your service hoster supplies one. /health checks the service and dependencies; /ready checks downstream readiness. Calculations require a gRPC client; visiting / is not a calculation test.

If startup or readiness fails, check the console or configured Serilog file for details. Common causes include an unreadable certificate or private key, a hostname or CA trust mismatch, missing map or ITU data, a wrong AntennaService address, or an unwritable prediction or log directory.

Before installing an updated release, back up the persistent prediction directory (including coveragepredictions.sqlite) and your environment-specific settings. Replace the application package as a whole, not individual binaries, and keep secrets outside the package.

For Maria service-hoster deployments, the release package should include maria-service-manifest.json.


Deployment Strategies

For deployment strategies, see RadioPlan Service Deployment Strategies