WSPR CDK
wspr_cdk provides an abstraction for accessing and analyzing WSPR (Weak Signal Propagation Reporter) real-time spot data. This crate allows you to perform queries and fetch data from the WSPR database with ease.
Prerequisites
When running the application, ensure that the service_account.json file has been set up correctly. This file contains the authentication credentials needed to access the Google Drive API.
- If this file is missing or incorrectly configured, you will encounter an authentication error when attempting to upload files to Google Drive.
Here's a step-by-step guide to ensure proper setup:
-
Create a Service Account:
- Go to the Google Cloud Console.
- Navigate to the IAM & Admin > Service Accounts page.
- Click "Create Service Account".
- Fill out the necessary details and click "Create".
-
Generate a JSON Key:
- After creating the service account, click on the service account you created.
- Go to the "Keys" tab.
- Click "Add Key", then select "Create new key".
- Choose JSON as the key type and click "Create". This will download a JSON file containing your credentials.
-
Provide Necessary Permissions:
- Ensure that the service account has the required permissions to access Google Drive. You can grant the necessary permissions by assigning the appropriate roles to the service account.
-
Configure Environment:
- Place the downloaded
service_account.jsonfile in the appropriate location accessible to your application. Ensure that the file is named exactlyservice_account.json. - If running the application in a Docker container, make sure the
service_account.jsonfile is mounted into the container at runtime.
- Place the downloaded
These steps should ensure that the service_account.json file is correctly set up, thus allowing the server module to authenticate with Google Cloud successfully and avoid encountering the authentication error mentioned.
Usage
- To run the Python server, use:
- To run the Rust server, use:
Features
- Fetch WSPR spot data in various formats (JSON, JSONCompact, JSONEachRow)
- Easy integration with Tokio for asynchronous operations
- Abstractions to manage session state and dispatch actions to the ClickHouse client
- Server component for accessing and sharing real-time data via HTTP
Upcoming Features
- Mutual TLS for secure client-server communications
- SSL (OpenSSL) support for encrypted data transfer
Installation
To use this crate, add wspr_cdk to your Cargo.toml:
[]
= "0.0.9"
Environment Variable
Before using the crate, ensure you set the following environment variable:
Usage
Here are some examples of how to use the wspr_cdk crate:
use NaiveDateTime;
use ;
async
Example Query
Sample Output
Server Component
The server component allows you to access and share real-time WSPR data via HTTP. Below is a snippet of the server component source code:
extern crate rocket;
use Error;
use Status;
use ;
use Json;
use ;
use ;
// Required [modules].
use ;
/// Get all <wspr> spots.
async
async
Sample cURL Request
To fetch WSPR spots using the server component, you can use the following cURL command:
Client-Side Usage Example
You can also fetch WSPR data using client-side JavaScript. Here is a sample implementation:
<!doctype html>
WSPR Spots
WSPR Guidelines
Disclaimer: The dataset contains the raw spot data as reported, saved, and published by wsprnet.org. Therefore, there might be duplicates, false spots, and other errors in the data. Keep this in mind when you see something strange. You are allowed to use the services provided on wspr.live for your own research and projects, as long as the results are accessible free of charge for everyone. You are NOT allowed to use this service for any commercial or profit-oriented use cases. The complete WSPR infrastructure is maintained by volunteers in their spare time, so there are no guarantees on the correctness, availability, or stability of these services.
License
This project is licensed under the BSD License. See the LICENSE file for details.
Contribution
Contributions are welcome! Please submit issues or pull requests as needed. Ensure that your contributions comply with the licensing and guidelines set forth.
Acknowledgments
Special thanks to the WSPR community for providing access to the data and maintaining the infrastructure.
Docker Image
The wspr_cdk is also available as a Docker image:
You can find it on Docker Hub: lexaraprime/wspr_cdk
This documentation is also available as a crate on crates.io