-
Notifications
You must be signed in to change notification settings - Fork 9
refactoring with desperado #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
80c1772 to
45a3489
Compare
|
|
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 |
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
- 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.
|
@abc8747 I think this current state is not too bad, any further comment? |
|
@abc8747 I merged, easier to move on, but just comment if needed and we can open issues |
|
Sure I will take a look at it later today |
|
@xoolive I've just tested and it works well, just a minor point: fb9bb79#diff-c914f1f4fdad905d05b49772bb8a20de37a17f0e7f81e90fe0f5599034e3ac6bL118-L122 removed the Lines 13 to 24 in 77b7193
|
This PR is similar to the effort made in xoolive/ship162#17
So now, we have three different features:
rtlsdr,soapyandpluto.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=0rtlsdr://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) orpluto://usb:1.27.5,note that this is not valid url syntax, maybe consider
plutoip://andplutousb://with in the configuration file:
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:
config.rsindesperadocould contain the proper struct with From/Into traits implemented could make sensecenter_freqneed to be different across projects.Other open questions/work:
rtlsdrfeature default? It's a pure Rust crate after all, although rtl-sdr-rs depends on libusb in the end.jet1090release process should include it anyway, that would simplify installation in Windowssoapymakes 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 onlibiio.cc @abc8747