Skip to content

Conversation

@xoolive
Copy link
Owner

@xoolive xoolive commented Dec 25, 2025

This PR is similar to the effort made in xoolive/ship162#17

So now, we have three different features: rtlsdr, soapy and pluto.

The main part left to deal with would be the support of configuration parameters:

I see following patterns:

  • rtlsdr:// (now means device_id equal 0, but that should be the first available one, in Windows it is often device_id 1)
  • rtlsdr://device_id=0
  • rtlsdr://manufacturer=...&serial=...
    (see ccostes/rtl-sdr-rs@c787722 in feat: device enumeration and sensor API ccostes/rtl-sdr-rs#26)
  • soapy://serial=... (similar to rtlsdr)
  • pluto://ip:192.168.2.1, (pluto://ip:pluto.local) or pluto://usb:1.27.5,
    note that this is not valid url syntax, maybe consider plutoip:// and plutousb://

with in the configuration file:

[[sources.rtlsdr]]
device = 0
gain = 49.6

[[sources.soapy]]
manufacturer = ...
sample_rate = 2_400_000

Note that in the specific case of rtlsdr, it doesn't make sense to have a lower gain, at least for ADS-B

This edit should be the same in ship162, so maybe there's a way to factorize it in desperado. We have the specific config structures like this one that could be made serializable, although:

  • that's probably not the best option since the expected options are slightly different.
  • the option of a config.rs in desperado could contain the proper struct with From/Into traits implemented could make sense
  • but default values for center_freq need to be different across projects.

Other open questions/work:

  • Should we make the rtlsdr feature default? It's a pure Rust crate after all, although rtl-sdr-rs depends on libusb in the end.
  • The jet1090 release process should include it anyway, that would simplify installation in Windows
  • soapy makes sense because it's generic to support many SDR types; I think the point behind other features would be to support more SDR types with full Rust implementations (so that things just work without any extra dependencies), which is not the case for Pluto now, depending on libiio.

cc @abc8747

@abc8747
Copy link
Collaborator

abc8747 commented Dec 26, 2025

  • Can we unify the representation of gain as enum { Auto, Manual(f64) } in desperado and set a consistent default? Right now:

    source desperado dtype jet1090 default ship162 default
    rtlsdr Option<i32> 49.6, cast to Some(i32) later None, should be made configurable, see refactoring with desperado ship162#17 (review)
    soapy Option<f64> Some(49.6) Some(40.0)
    pluto f64 50.0 20.0
  • expanduser in jet1090 and ship162 should use desperado::iqread::expanduser (maybe move it to desperado::utils or just the top level)

  • jet1090/src/source.rs populates config structs immediately, ship162/src/sources/mod.rs stores raw strings and configures later. The Address enums are also duplicated, can we centralise URL parsing in desperado, perhaps impl FromStr for DeviceConfig so it parses rtlsdr:// etc. into a unified config enum?

  • In desperado, should bias tee be made configurable? right now it is hardcoded to be false

  • re whether to keep rtlsdr feature on: tangram_ship162 depends directly on rs162 to deserialise the JSON, so it would be nice if rtlsdr feature is off-by-default. But I am perfectly happy with on-by-default and setting default-features = false in tangram_ship162

@xoolive
Copy link
Owner Author

xoolive commented Dec 28, 2025

Thanks, I agree with all the comments though they mostly refer to desperado here.

Just a point of attention: Gain in i32 is multiplied by 10 for rtlsdr: Some(496) is for a gain of 49.6 (the max value)

Then, this max value should be default in jet1090 + ship162

Let's do that when we can

github-actions bot and others added 21 commits January 19, 2026 17:52
Flake lock file updates:

• Updated input 'advisory-db':
    'github:rustsec/advisory-db/218a772dc1f031aa64e0c575a92c8e04439674d5?narHash=sha256-wEBOgeHURiBQQnzdCKl30IDnSBqbEXw0Sfnm%2Ban0JmE%3D' (2025-10-15)
  → 'github:rustsec/advisory-db/32546e97dfa0ad59baab4166705156d8dd0fbfa8?narHash=sha256-RKBSGK61szhJhcH2tUXlmHJIjLyc7iTvoTtJbe5g1JQ%3D' (2025-10-27)
• Updated input 'fenix':
    'github:nix-community/fenix/b435bfccee71c6591dbce2fcfabe3e17e98c09fa?narHash=sha256-yH1K/WDJpwIIw7e3wKdRgwHAZ38LXgcGE2Ecvk3I6GU%3D' (2025-10-19)
  → 'github:nix-community/fenix/d82a7c64ea441e397914577c9a18f2867e5b364b?narHash=sha256-4OH1CVm2PdjKRqEJ3RLfkQMDSBdn7VId6iyYCwKOK%2BU%3D' (2025-10-27)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/1e20331e42449dfc0b44bce84147a06772d045d7?narHash=sha256-WOt9KquZ1BXjMcVyHpMeliqNRL6BfRvBHFGfRDriDx4%3D' (2025-10-17)
  → 'github:rust-lang/rust-analyzer/049767e6faa84b2d1a951d8f227e6ebd99d728a2?narHash=sha256-syeBTCCU96qPJHcVpwHeCwmPCiLTDHHgYQYhpZ0iwLo%3D' (2025-10-26)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/4e627ac2e1b8f1de7f5090064242de9a259dbbc8?narHash=sha256-lbHQ7FXGzt6/IygWvJ1lCq%2BTxcut3xYYd6VIpF1ojkg%3D' (2025-10-18)
  → 'github:hercules-ci/flake-parts/864599284fc7c0ba6357ed89ed5e2cd5040f0c04?narHash=sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4%3D' (2025-10-20)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/81b927b14b7b3988334d5282ef9cba802e193fe1?narHash=sha256-tdoIhL/NlER290HfSjOkgi4jfmjeqmqrzgnmiMtGepE%3D' (2025-10-17)
  → 'github:nixos/nixpkgs/78e34d1667d32d8a0ffc3eba4591ff256e80576e?narHash=sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8%3D' (2025-10-26)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Flake lock file updates:

• Updated input 'advisory-db':
    'github:rustsec/advisory-db/218a772dc1f031aa64e0c575a92c8e04439674d5?narHash=sha256-wEBOgeHURiBQQnzdCKl30IDnSBqbEXw0Sfnm%2Ban0JmE%3D' (2025-10-15)
  → 'github:rustsec/advisory-db/32546e97dfa0ad59baab4166705156d8dd0fbfa8?narHash=sha256-RKBSGK61szhJhcH2tUXlmHJIjLyc7iTvoTtJbe5g1JQ%3D' (2025-10-27)
• Updated input 'fenix':
    'github:nix-community/fenix/b435bfccee71c6591dbce2fcfabe3e17e98c09fa?narHash=sha256-yH1K/WDJpwIIw7e3wKdRgwHAZ38LXgcGE2Ecvk3I6GU%3D' (2025-10-19)
  → 'github:nix-community/fenix/d82a7c64ea441e397914577c9a18f2867e5b364b?narHash=sha256-4OH1CVm2PdjKRqEJ3RLfkQMDSBdn7VId6iyYCwKOK%2BU%3D' (2025-10-27)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/1e20331e42449dfc0b44bce84147a06772d045d7?narHash=sha256-WOt9KquZ1BXjMcVyHpMeliqNRL6BfRvBHFGfRDriDx4%3D' (2025-10-17)
  → 'github:rust-lang/rust-analyzer/049767e6faa84b2d1a951d8f227e6ebd99d728a2?narHash=sha256-syeBTCCU96qPJHcVpwHeCwmPCiLTDHHgYQYhpZ0iwLo%3D' (2025-10-26)
• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/4e627ac2e1b8f1de7f5090064242de9a259dbbc8?narHash=sha256-lbHQ7FXGzt6/IygWvJ1lCq%2BTxcut3xYYd6VIpF1ojkg%3D' (2025-10-18)
  → 'github:hercules-ci/flake-parts/864599284fc7c0ba6357ed89ed5e2cd5040f0c04?narHash=sha256-TmWcdiUUaWk8J4lpjzu4gCGxWY6/Ok7mOK4fIFfBuU4%3D' (2025-10-20)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/81b927b14b7b3988334d5282ef9cba802e193fe1?narHash=sha256-tdoIhL/NlER290HfSjOkgi4jfmjeqmqrzgnmiMtGepE%3D' (2025-10-17)
  → 'github:nixos/nixpkgs/78e34d1667d32d8a0ffc3eba4591ff256e80576e?narHash=sha256-vY2OLVg5ZTobdroQKQQSipSIkHlxOTrIF1fsMzPh8w8%3D' (2025-10-26)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Flake lock file updates:

• Updated input 'advisory-db':
    'github:rustsec/advisory-db/f2c79ff' (2025-11-22)
  → 'github:rustsec/advisory-db/4ea955a' (2025-11-30)
• Updated input 'fenix':
    'github:nix-community/fenix/a563f05' (2025-11-23)
  → 'github:nix-community/fenix/2e31077' (2025-11-30)
• Updated input 'fenix/rust-analyzer-src':
    'github:rust-lang/rust-analyzer/5062185' (2025-11-22)
  → 'github:rust-lang/rust-analyzer/66c11a2' (2025-11-29)
• Updated input 'nixpkgs':
    'github:nixos/nixpkgs/c58bc7f' (2025-11-20)
  → 'github:nixos/nixpkgs/9a7b80b' (2025-11-28)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
- Update rs1090 and jet1090 to use path dependency: ../../desperado
- Add desperado symlink to .gitignore
- Ignore temporary pr_*.md and rebase_summary.md files
- Cargo.lock updated with local desperado v0.1.2
- All 81 rs1090 tests pass with local desperado
Major changes:
- Remove duplicated expanduser function, use desperado::expanduser
- Replace PlutoConfig and SoapyConfig structs with desperado::DeviceConfig
- Consolidate Address::Rtlsdr, Address::Pluto, Address::Soapy into single Address::Sdr variant
- Update FromStr to parse SDR URLs and delegate to DeviceConfig::from_str()
- Simplify receiver() method to use IqAsyncSource::from_device_config()
- Update serial() method to handle unified Sdr variant
- Update sensor.rs to use new Sdr variant

Benefits:
- Eliminates code duplication between jet1090 and desperado
- Provides consistent URL-based configuration for all SDR devices
- Supports new features like bias_tee, SI suffixes, and auto gain
- All 3 tests pass with rtlsdr, pluto, and soapy features
- Guard Address::Sdr variant with #[cfg(any(...))]
- Add matching guards to FromStr, serial(), and receiver() methods
- Add guard to sensor.rs pattern match
- Guard unused imports and constants when no SDR features enabled
- Ensures clean build with --no-default-features
- All feature combinations now compile and pass tests
- Replace single Sdr variant with specific variants (Rtlsdr, Plutoip, Plutousb, Soapy)
- Add transparent wrapper structs for TOML deserialization
- Enable SDR device configuration via config.toml file
- Update documentation with PlutoSDR and SoapySDR examples
- Add comprehensive tests for TOML deserialization
- All feature combinations tested and working
- Replace Plutoip and Plutousb variants with single Pluto variant
- Support pluto://<ip>, pluto://ip:<ip>, pluto://usb: formats
- Maintain backward compatibility with plutoip:// and plutousb:// CLI schemes
- Simplify TOML configuration to use single 'pluto' field
- Update documentation with cleaner examples
- All tests passing
- Keep only pluto:// scheme for consistency with desperado
- Simplify FromStr implementation
- Update documentation to remove backward compatibility note
- Parse pluto:/// URLs using path component for URIs with colons
- Update FromStr to handle both host and path-based URIs
- Add comprehensive documentation and examples
- Add unit tests for pluto:///usb:1.18.5 format

Fixes issue where pluto://usb:1.18.5 failed to parse because URL parser
interpreted the colon as a host:port separator. Users can now use:
  jet1090 pluto:///usb:1.18.5
Add optional bias_tee parameter to enable power for external LNAs:
- Support in TOML config: bias_tee = true
- Support in CLI URI format: rtlsdr://0?bias_tee=true
- Flexible parsing accepts: true/false, 1/0, yes/no, on/off
- Defaults to false if not specified
- Feature-gated for RTL-SDR devices only
- Includes comprehensive documentation and safety warnings
Extend bias_tee configuration from RTL-SDR-only to both RTL-SDR and SoapySDR:
- Update feature gates from #[cfg(feature = "rtlsdr")] to #[cfg(any(feature = "rtlsdr", feature = "soapy"))]
- Pass bias_tee value to SoapySDR receiver configuration
- Add SoapySDR test cases to bias-tee test suite
- Update documentation with SoapySDR bias-tee examples
- Note: Bias-tee in SoapySDR depends on underlying driver support
xoolive and others added 4 commits January 19, 2026 17:55
- Make desperado optional, only included when sdr feature is enabled
- Add local util::expanduser for general path expansion (config, output)
- Use desperado::expanduser within SDR feature guards
- Allows building jet1090 without SDR dependencies when not needed
The package name with dots was causing cargo-dist to only install
'libusb-1' instead of the full development package. The libusb-dev
metapackage is the standard way to install libusb development files
on Debian/Ubuntu systems.
@xoolive
Copy link
Owner Author

xoolive commented Jan 19, 2026

@abc8747 I think this current state is not too bad, any further comment?
Otherwise I will merge soon

This was referenced Jan 19, 2026
@xoolive xoolive merged commit f2e55aa into master Jan 20, 2026
39 checks passed
@xoolive
Copy link
Owner Author

xoolive commented Jan 20, 2026

@abc8747 I merged, easier to move on, but just comment if needed and we can open issues

@xoolive xoolive deleted the pr-desperado branch January 20, 2026 09:30
xoolive added a commit that referenced this pull request Jan 20, 2026
…(Python types)

Add comprehensive changelog entries for recent merges:
- SDR refactoring with desperado 0.2.0 (#416)
- CPR decoding robustness improvements (#434)
- Python type annotation improvements (#436)

All three PRs merged on 2026-01-20.
@abc8747
Copy link
Collaborator

abc8747 commented Jan 20, 2026

Sure I will take a look at it later today

@abc8747
Copy link
Collaborator

abc8747 commented Jan 21, 2026

@xoolive I've just tested and it works well, just a minor point:

fb9bb79#diff-c914f1f4fdad905d05b49772bb8a20de37a17f0e7f81e90fe0f5599034e3ac6bL118-L122 removed the --discover option but the docs still reference it:

jet1090/docs/sources.md

Lines 13 to 24 in 77b7193

You can check whether `jet1090` detects your dongle:
```sh
$ jet1090 --discover=rtlsdr
Detached kernel driver
Found Rafael Micro R820T tuner
Reattached kernel driver
[INFO] Opening Generic RTL2832U OEM :: 00000001...
Detached kernel driver
Found Rafael Micro R820T tuner
Reattached kernel driver
```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants