Skip to content

Add APRS and APRS SDR plugins#1436

Open
Supermagnum wants to merge 58 commits into
navit-gps:trunkfrom
Supermagnum:feature/aprs-clean
Open

Add APRS and APRS SDR plugins#1436
Supermagnum wants to merge 58 commits into
navit-gps:trunkfrom
Supermagnum:feature/aprs-clean

Conversation

@Supermagnum

Copy link
Copy Markdown
Contributor

This PR contains only APRS-related changes, separated from mixed concerns in the original PR.

Changes

  • APRS plugin with modular SDR support
  • APRS SDR plugin for RTL-SDR hardware
  • APRS documentation and test results
  • APRS-specific fixes and enhancements

This is a cleaned version of PR #1418 with only APRS commits.

Made with Cursor

Supermagnum and others added 16 commits February 10, 2026 09:01
- Split APRS functionality into two plugins: aprs (core) and aprs_sdr (optional)
- Core APRS plugin: packet parsing, database, map rendering, NMEA input
- SDR plugin: RTL-SDR hardware interface, Bell 202 demodulation, Android USB support
- Inter-plugin communication via packet registration API
- Bell 202 demodulation based on Direwolf patterns
- Android USB Host API integration for RTL-SDR devices
- Comprehensive documentation and architecture guide
- Support for RTL-SDR Blog V3, V4 R828D, Nooelec, and generic RTL2832U dongles
- Configurable via GUI menu: frequency, timeout, device selection, NMEA settings
- Implement frequency index tracking in aprs_osd.c
- Add aprs_refresh_freq_index command to update menu state
- Update menu XML to show current frequency and highlight selection
- Fix menu navigation by combining refresh and menu() commands in onclick
- Store frequency index in command variable for menu conditional display
Co-authored-by: Cursor <cursoragent@cursor.com>
- Remove unnecessary comment about exporting symbols (implementation detail)
- Simplify APRS_SYMBOLS.md overview (remove AI-style explanation)
- Note: PNG icons in symbols/ directory should eventually be replaced with SVG
  vector graphics to match Navit's icon standards
… status, add future enhancements

Co-authored-by: Cursor <cursoragent@cursor.com>
Add future enhancement suggestions for APRS integration and features.
Added a suggestion to display a pop-up for tuning VFOs when entering the cover area.
Co-authored-by: Cursor <cursoragent@cursor.com>
Remove extra blank line to comply with CI checks

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Christof Schulze <christof.schulze@gmx.net>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Supermagnum and others added 7 commits February 10, 2026 09:14
- Extract helper functions for field parsing (optional string/int/double/char)
- Extract position parsing with direction helper
- Extract checksum validation into separate function
- Extract NMEA field parsing into separate function
- Split sentence type parsers into separate functions (parse_gpwpl, parse_pgrmw, parse_pmgnwpl, parse_pkwdwpl)
- Extract line processing logic from thread function
- Extract data reading logic from thread function
- Extract termios configuration helpers (baud rate, parity, data/stop bits)

This reduces cyclomatic complexity and improves code maintainability.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
- Remove invalid 'data' attribute from osd element in navit_shipped.xml
- Refactor aprs_map_set_attr to reduce cyclomatic complexity
- Refactor aprs_rtlsdr_new to reduce cyclomatic complexity
- Fix shell globbing issue in install_aprs_symbols.sh (SC2035)

Co-authored-by: Cursor <cursoragent@cursor.com>
- Reorder includes (local before system)
- Fix function formatting (braces, spacing)
- Remove trailing whitespace
- Fix comment formatting
- Format symbol arrays with proper spacing

Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix dbg() call formatting in aprs.c
- Fix function parameter indentation in aprs_db.h
- Remove trailing blank lines
- Format symbol arrays with proper spacing
- Fix preprocessor directive formatting
- Format stub functions with proper braces
- Fix comment formatting (remove trailing spaces)
- Format includes and defines in conditional blocks

Co-authored-by: Cursor <cursoragent@cursor.com>
- Fix dbg() call formatting in aprs_nmea.c (single line)
- Fix spacing alignment in aprs_symbols.c alternate_symbols array

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread README.md
Supermagnum and others added 5 commits February 11, 2026 00:43
Co-authored-by: Cursor <cursoragent@cursor.com>
…formatting

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Refine the synthetic Bell 202 IQ generator to reduce complexity while preserving deterministic behaviour, and align APRS SDR integration tests and docs with the stricter end-to-end decode expectations.

Made-with: Cursor
@Supermagnum

Copy link
Copy Markdown
Contributor Author

Currently the tests are failing.
Will push when those is sorted.

…tzel

This was not easy to get passing. The code may not satisfy all static
analysis or codefactor checks, but it is intentionally self-documented:
comments, diagnostics, and the accompanying RST reference explain how
the pipeline works, what bit streams to expect at every stage, and what
the frame callback must deliver.

Be aware that the HDLC/AX.25 bit stream is fragile. Small changes to
bit stuffing, NRZI decode, flag search, or frame assembly ordering will
silently break decoding. The expected_decode.rst documents the exact
values to verify against when debugging.

Key fixes in this commit:
- Replace Goertzel (was fed FM discriminator scalar, not IQ samples)
  with per-bit averaged FM discriminator + threshold (0.23)
- Move flag_pos, in_frame_bit_pos, in_frame_current_byte, bit_stuff_count
  from static locals to struct fields so state resets correctly
- Add preamble flush guard (frame_buffer_pos >= 15) to distinguish
  preamble flags from closing flag inside process_ax25_in_frame
- Do not feed the flag-completing bit into the frame assembler
- Correct prev_valid guard for FM discriminator initialisation

Tests: test_aprs_sdr_if_offset (+100 kHz IF) and
       test_aprs_sdr_dc_centered (0 Hz IF) both pass.
Made-with: Cursor
Supermagnum and others added 12 commits March 19, 2026 17:47
- Replace fixed-window demod with FM DC tracking, bit-timing PLL, per-symbol
  average and mark/space decision at 0.0; keep integration test bit count stable
- Mark unused Goertzel helpers with G_GNUC_UNUSED
- Update APRS SDR documentation for pipeline, tests, and troubleshooting

Made-with: Cursor
- Resolve SANITY_GIT_BASE: origin/trunk, main, master, @{upstream}, else HEAD
- Document SANITY_GIT_BASE and fix misleading checkout warning
- Reformat test_aprs_sdr_integration.c and aprs_sdr_dsp.c for CI clang-format

Made-with: Cursor
- Split aprs_sdr_dsp_new, process_samples, and AX.25 in-frame handling into helpers
- Add config.pll_alpha and PLL read accessors (locked, transition_count, phase)
- Add test_aprs_sdr_pll_preamble_lock with pll_alpha=0.08 on preamble-only IQ
- Refactor integration test logging and expect_success checks into helpers
- Update TEST_RESULTS.rst (18 tests)

Made-with: Cursor
Not needed any more ,- PLL is implemented.
Comment thread CLAUDE.md Outdated
@Supermagnum Supermagnum requested a review from jkoan April 21, 2026 21:03
@Supermagnum

Copy link
Copy Markdown
Contributor Author

Note that the DSP functions in https://github.com/Supermagnum/navit/tree/feature/aprs-clean/navit/plugin/aprs_sdr are very finicky. I will try to get rx working with my libresdr, but that can be difficult because the driver for that is made for Gnuradio.

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