From 07c57e85a895123401849dd1c1ee3033c602e5de Mon Sep 17 00:00:00 2001 From: mattbk Date: Thu, 13 Nov 2025 21:23:32 -0600 Subject: [PATCH 1/5] Snapshot. --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index 77f1e27..c387f78 100644 --- a/src/main.rs +++ b/src/main.rs @@ -87,6 +87,10 @@ struct Cli { #[arg(short = 'x', long, allow_negative_numbers = true)] my_lon: Option, + /// Filter out spots from these callsign-UUID combinations (self spots, for example), comma-separated + #[arg(short = 't', long, value_delimiter = ',')] + filter: Option, + } /// Convert a byte slice into a hex-dump string for debugging purposes. @@ -450,6 +454,11 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager, loc_st if cli.ui_only && summary != "UI" { return; } + // Ignore frames where source matches one of the filtered strings + TODO finish this + if cli.filter { + return; + } // In non-debug mode, print the session line and any additional lines. if !cli.debug { -- 2.39.5 From 780c4b5884c80832a6818c885c3bf563e4ecae00 Mon Sep 17 00:00:00 2001 From: mattbk Date: Sat, 15 Nov 2025 21:07:23 -0600 Subject: [PATCH 2/5] Add simple filter for text strings in source call-SSID. --- src/main.rs | 64 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/src/main.rs b/src/main.rs index c387f78..b27b54d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,13 +83,13 @@ struct Cli { #[arg(short = 'y', long, allow_negative_numbers = true)] my_lat: Option, - /// Spotter longitude DD.dddd; to send negaitve (W or S), use = e.g. --my-lon=-97.1 + /// Spotter longitude DD.dddd #[arg(short = 'x', long, allow_negative_numbers = true)] my_lon: Option, /// Filter out spots from these callsign-UUID combinations (self spots, for example), comma-separated - #[arg(short = 't', long, value_delimiter = ',')] - filter: Option, + #[arg(short = 't', long, value_delimiter = ',', num_args = 1..,)] + filter: Vec, } @@ -454,12 +454,7 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager, loc_st if cli.ui_only && summary != "UI" { return; } - // Ignore frames where source matches one of the filtered strings - TODO finish this - if cli.filter { - return; - } - + // In non-debug mode, print the session line and any additional lines. if !cli.debug { print_session_line(×tamp, &source, &final_destination, &summary); @@ -493,30 +488,33 @@ fn handle_frame(frame: &AgwFrame, cli: &Cli, buffers: &mut BufferManager, loc_st //println!("Stored location: {} {}", stored_loc[0].clone(), stored_loc[1].clone()); - // If Spothole is enabled - if summary == "UI" && cli.spothole { - // POST JSON - let packet = json!({ - "dx_call": &source_call, - "dx_ssid": &source_ssid, - "de_call": &my_call, - "de_latitude": &my_lat, - "de_longitude": &my_lon, - "freq": &freq, - "comment": &text, - "dx_latitude": &json_lat, - "dx_longitude": &json_lon, - "mode": "PKT", - "mode_type": "DATA", - "mode_source": "SPOT", - "time": SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(), - }); - let client = reqwest::blocking::Client::new(); - let res = client.post(spothole_url) - .json(&packet) - .send(); - println!("sent to {} = {}", spothole_url, packet); - println!("res = {res:?}"); + // If Spothole is enabled and this is a UI frame and the source is not filtered + if summary == "UI" && cli.spothole && !cli.filter.contains(&source){ + // POST JSON + let packet = json!({ + "dx_call": &source_call, + "dx_ssid": &source_ssid, + "de_call": &my_call, + "de_latitude": &my_lat, + "de_longitude": &my_lon, + "freq": &freq, + "comment": &text, + "dx_latitude": &json_lat, + "dx_longitude": &json_lon, + "mode": "PKT", + "mode_type": "DATA", + "mode_source": "SPOT", + "time": SystemTime::now().duration_since(UNIX_EPOCH).unwrap().as_secs(), + }); + let client = reqwest::blocking::Client::new(); + let res = client.post(spothole_url) + .json(&packet) + .send(); + println!("sent to {} = {}", spothole_url, packet); + println!("res = {res:?}"); + // If it's filtered, send a note about that + } else if summary == "UI" && cli.spothole && cli.filter.contains(&source) { + println!("Filter {:?} applied, not spotted", cli.filter) } // Send UDP -- 2.39.5 From c60723b0a5c53ecc877d4bfb87d1ef0919115771 Mon Sep 17 00:00:00 2001 From: mattbk Date: Sat, 15 Nov 2025 21:18:48 -0600 Subject: [PATCH 3/5] Update README. --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 27d70f6..cbb7852 100644 --- a/README.md +++ b/README.md @@ -74,6 +74,15 @@ mwtchahrd -i -p [-c ] [-d] [-u] - `-f, --freq ` Spotting frequency [default: 14105000]. + +- `-y, --my_lat ` + Spotter latitude, DD.dddd. + +- `-x, --my_lon ` + Spotter longitude, DD.dddd. + +- `-t, --filter ` + Filter out spots from these callsign-UUID combinations (self spots, for example), comma-separated. This is not regex, just full matches. - `-h, --help` Print help. -- 2.39.5 From 97e955156dabe6e516a8f2fe61f32f45b567242e Mon Sep 17 00:00:00 2001 From: mattbk Date: Sat, 15 Nov 2025 21:21:41 -0600 Subject: [PATCH 4/5] Update README. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index cbb7852..2d33e86 100644 --- a/README.md +++ b/README.md @@ -75,10 +75,10 @@ mwtchahrd -i -p [-c ] [-d] [-u] - `-f, --freq ` Spotting frequency [default: 14105000]. -- `-y, --my_lat ` +- `-y, --my-lat ` Spotter latitude, DD.dddd. -- `-x, --my_lon ` +- `-x, --my-lon ` Spotter longitude, DD.dddd. - `-t, --filter ` @@ -118,10 +118,10 @@ mwtchahrd -i 127.0.0.1 -p 8000 -u ### Spotting to [Spothole.app](https://spothole.app) API -Sends only UI frames and mode is hardcoded as `PKT`. Spot from callsign `W1CDN` and report fixed frequency 14.105 MHz: +Sends only UI frames and mode is hardcoded as `PKT`. Spot from callsign `W1CDN` and report fixed frequency 14.105 MHz. Report your location as spotter and don't spot your own beacons. ```bash -mwtchahrd --ip 192.168.0.6 --port 8000 --spotter W1CDN --spothole --freq 14105000 +mwtchahrd --ip 192.168.0.6 --port 8000 --spotter W1CDN --spothole --freq 14105000 --my-lat 47.01 --my-lon -97.01 --filter W1CDN-1,W1CDN-7 ``` ## Code Overview -- 2.39.5 From 20fda492a5fe1d7ee5bcefeb4ae40f282c6d4240 Mon Sep 17 00:00:00 2001 From: mattbk Date: Tue, 18 Nov 2025 19:01:12 -0600 Subject: [PATCH 5/5] Clean up. --- Cross.toml | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 Cross.toml diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index 0e8106d..0000000 --- a/Cross.toml +++ /dev/null @@ -1,11 +0,0 @@ -[target.aarch64-unknown-linux-gnu] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge@sha256:168fa652629cedcd9549e85258be8f83fa008625b187c004d6ea439cf16f6a41" - -[target.x86_64-unknown-linux-gnu] -image = "ghcr.io/cross-rs/x86_64-unknown-linux-gnu:edge@sha256:3542b427c3f7d0d2976d7add025c5ba997499411f408b3b26803ccc70fc431da" - -[target.armv7-unknown-linux-gnueabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:edge@sha256:3e1def581eb9c9f11cfff85745802f2de5cf9cdeeb5a8495048f393a0993b99b" - -[target.arm-unknown-linux-gnueabihf] -image = "ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:edge@sha256:28e7aaae8301506f4f1b3394c8bc23f958d1717043e06f816045e7b8df57e173" \ No newline at end of file -- 2.39.5