Skip to content

Feature: Add package readsb-wiedehopf - #29411

Open
billmcilhargey wants to merge 12 commits into
openwrt:masterfrom
billmcilhargey:add-readsb-wiedehopf
Open

billmcilhargey wants to merge 12 commits into
openwrt:masterfrom
billmcilhargey:add-readsb-wiedehopf

Conversation

@billmcilhargey

@billmcilhargey billmcilhargey commented May 10, 2026 •

Copy link
Copy Markdown

📦 Package Details

Maintainer: @billmcilhargey

Description:
New package readsb-wiedehopf — a Mode-S / ADS-B / TIS decoder for
RTL-SDR and other SDR devices. This is the wiedehopf fork of
readsb
, an actively maintained
alternative to the existing readsb package (which tracks the
now-archived Mictronics upstream).

It adds many features required by modern aggregators:

  • BeastReduce output
  • station UUIDs
  • globe history / heatmap recording
  • JSON / binCraft outputs
  • built-in HTTP API

It is the upstream used by tar1090, adsb.lol, airplanes.live,
adsb.fi and similar projects.

The package:

  • installs /usr/bin/readsb and a companion viewadsb-wiedehopf
    package providing /usr/bin/viewadsb
  • declares PROVIDES:=readsb / CONFLICTS:=readsb (and the same for
    viewadsb) so either fork can satisfy a readsb dependency, but
    not both at once
  • ships a UCI config (/etc/config/readsb), a procd init script,
    USB hotplug glue, and an interactive readsb-setup wizard plus
    readsb-uuid / readsb-geoip / readsb-feeder helpers under
    /usr/sbin/

The existing readsb package and its maintainer are not touched.


🧪 Run Testing Details

  • OpenWrt Version: 23.05-SNAPSHOT (git-25.163.46318-26086b5, kernel 5.4.164)
  • OpenWrt Target/Subtarget: ipq60xx/generic
  • OpenWrt Device: GL.iNet GL-AXT1800 (Slate AX, ARMv8 / Qualcomm IPQ6018)

Build verified with make package/readsb-wiedehopf/{clean,compile} V=s
against the 23.05 SDK for ipq60xx/generic.

Runtime verified on a GL-AXT1800 (GL Technologies, Inc. AXT1800,
hostname GL-AXT1800, uptime 1d 0h at time of test): the daemon is
enabled and started by procd via /etc/init.d/readsb, decodes Mode-S
frames from an attached RTL-SDR over USB (hotplug binds correctly),
JSON output is served on the configured port, and readsb-setup
walks through location / UUID / SDR / feeder configuration without
errors. viewadsb-wiedehopf connects to the local daemon and renders
the live aircraft list.


✅ Formalities

  • I have reviewed the CONTRIBUTING.md file for detailed contributing guidelines.

If your PR contains a patch:

  • It can be applied using git am
  • It has been refreshed to avoid offsets, fuzzes, etc., using
    make package/readsb-wiedehopf/refresh V=s
  • It is structured in a way that it is potentially upstreamable

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a new OpenWrt package readsb-wiedehopf (wiedehopf fork of readsb) including procd integration, UCI configuration, USB hotplug handling, and a suite of operator-focused helper CLIs for setup, feeder management, UUID handling, and geoip location.

Changes:

  • Introduces the readsb-wiedehopf and viewadsb-wiedehopf packages with build/install rules and postinst/prerm hooks.
  • Adds procd init script + USB hotplug logic and ships a default /etc/config/readsb UCI config.
  • Adds helper tools (readsb-setup, readsb-feeder, readsb-uuid, readsb-geoip) plus shared shell helper library and README documentation.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
utils/readsb-wiedehopf/Makefile Defines the new packages, build flags, dependencies, and install/postinst hooks
utils/readsb-wiedehopf/README.md Documents configuration model, wizard/CLI usage, hotplug behavior, and feeders
utils/readsb-wiedehopf/files/readsb.config Ships default UCI config for the readsb main section
utils/readsb-wiedehopf/files/readsb.init Adds procd init script wiring UCI → daemon flags + boot-time waits/reconciliation
utils/readsb-wiedehopf/files/readsb.hotplug Adds USB hotplug handler to pin/unpin RTL-SDR devices and restart service
utils/readsb-wiedehopf/files/readsb.functions.sh Shared shell library for logging, presets, health/stats parsing, and wizard helpers
utils/readsb-wiedehopf/files/readsb.setup Adds a guided setup wizard plus --status/--health/--stats/--config modes
utils/readsb-wiedehopf/files/readsb.feeder Adds feeder management CLI (add/set/enable/disable/remove/probe/health/url)
utils/readsb-wiedehopf/files/readsb.uuid Adds UUID inspection/generation CLI with interactive and non-interactive modes
utils/readsb-wiedehopf/files/readsb.geoip Adds geoip-based best-effort lat/lon population + self-test

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread utils/readsb-wiedehopf/files/readsb.geoip Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.geoip Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.init
Comment thread utils/readsb-wiedehopf/files/readsb.setup Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.feeder Outdated
billmcilhargey added a commit to billmcilhargey/packages that referenced this pull request May 11, 2026
ADSBexchange.com statistics uploader for OpenWrt.

Periodically reads aircraft.json from readsb (via readsb-wiedehopf),
aggregates per-aircraft RSSI and counts, and POSTs the result to
https://adsbexchange.com identified by the station UUID stored at
readsb.main.uuid -- shared with readsb's BEAST connectors so a single
`readsb-uuid` configures both.

Procd-supervised bash uploader with no compile step. Configuration is
UCI-only (/etc/config/adsbexchange-stats); the station UUID is shared
with readsb-wiedehopf via readsb.main.uuid so a single identity is
used by the BEAST feed connector and this uploader. Logging goes to
syslog under the `adsbexchange-stats` tag at user-selectable verbosity.

Hard-depends on readsb-wiedehopf (PR openwrt#29411) for the shared UUID,
the readsb-uuid CLI, and /usr/lib/readsb/functions.sh.

Upstream: https://github.com/ADSBexchange/adsbexchange-stats pinned
at commit 11647f27. Upstream license preserved as MIT; OpenWrt
packaging files are GPL-2.0-only.

Signed-off-by: Dr Bill Mcilhargey <contributor@mcilhargey.com>
BKPepe pushed a commit to billmcilhargey/packages that referenced this pull request May 13, 2026
ADSBexchange.com statistics uploader for OpenWrt.

Periodically reads aircraft.json from readsb (via readsb-wiedehopf),
aggregates per-aircraft RSSI and counts, and POSTs the result to
https://adsbexchange.com identified by the station UUID stored at
readsb.main.uuid -- shared with readsb's BEAST connectors so a single
`readsb-uuid` configures both.

Procd-supervised bash uploader with no compile step. Configuration is
UCI-only (/etc/config/adsbexchange-stats); the station UUID is shared
with readsb-wiedehopf via readsb.main.uuid so a single identity is
used by the BEAST feed connector and this uploader. Logging goes to
syslog under the `adsbexchange-stats` tag at user-selectable verbosity.

Hard-depends on readsb-wiedehopf (PR openwrt#29411) for the shared UUID,
the readsb-uuid CLI, and /usr/lib/readsb/functions.sh.

Upstream: https://github.com/ADSBexchange/adsbexchange-stats pinned
at commit 11647f27. Upstream license preserved as MIT; OpenWrt
packaging files are GPL-2.0-only.

Signed-off-by: Dr Bill Mcilhargey <contributor@mcilhargey.com>
@billmcilhargey

Copy link
Copy Markdown
Author

Marked the other package as ready for review, I was not sure if it should be left in draft stage or not, so shifted it to Ready for Review stage in case it was holding this package up

Appreciate the time too!

@billmcilhargey
billmcilhargey force-pushed the add-readsb-wiedehopf branch from c4c33df to 76e5f22 Compare May 21, 2026 22:56
Comment thread utils/readsb-wiedehopf/Makefile Outdated
@billmcilhargey

Copy link
Copy Markdown
Author

Implemented recommended change by @Yang-Wei-Ting

--update readsb-wiedehopf Makefile to set PKG_FORTIFY_SOURCE and adjust optimization flags

Thank you!

Ready for continued review

@billmcilhargey

billmcilhargey commented Jun 11, 2026 •

Copy link
Copy Markdown
Author

@Yang-Wei-Ting - Just to follow-up this is ready for re-review and let me know if anything else is needed and appreciate it again!

Also having copilot run one more review considering the changes I committed to give it one more review in the meantime in case anyone had any concerns

Thank you again!

@billmcilhargey
billmcilhargey requested a review from Copilot June 11, 2026 14:32

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread utils/readsb-wiedehopf/files/readsb.hotplug Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.init
Comment thread utils/readsb-wiedehopf/files/readsb-setup
@billmcilhargey

Copy link
Copy Markdown
Author

Resolved GitHub Copilot review requests and all ready for any final reviews and approvals! Thank you again

FYI @Yang-Wei-Ting

@openwrt

openwrt Bot commented Jul 14, 2026

Copy link
Copy Markdown

This PR is stale because it has been inactive for 14 days and has the "not following guidelines" label.
It will be closed if no further activity occurs within 14 days.

@openwrt openwrt Bot added the stale label Jul 14, 2026

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fresh review of the full PR at 1e99d57. The package is written very defensively — input validation/sanitization in the helpers is thorough and error paths are handled well. No commit-message/diff mismatches (the empty commit bodies on 254f386 and 1e99d57 are already flagged by the openwrt formality check). Two inline notes below on packaging and on the automatic third-party geoip lookup.


Generated by Claude Code

Comment thread utils/readsb-wiedehopf/Makefile Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.init
@openwrt openwrt Bot removed the stale label Jul 15, 2026
@openwrt openwrt Bot added the stale label Jul 29, 2026
@openwrt

openwrt Bot commented Jul 29, 2026

Copy link
Copy Markdown

This PR is stale because it has been inactive for 14 days and has the "not following guidelines" label.
It will be closed if no further activity occurs within 14 days.

@billmcilhargey

Copy link
Copy Markdown
Author

Finally catching up here and let me review the work here requested and work to implement! Thank you!

@openwrt openwrt Bot removed the stale label Jul 31, 2026
@billmcilhargey
billmcilhargey force-pushed the add-readsb-wiedehopf branch 3 times, most recently from 7d52735 to 66066b0 Compare August 5, 2026 13:34
Copilot AI balanced review requested due to automatic review settings October 4, 2026 18:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread utils/readsb-wiedehopf/files/readsb-feeder Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.init Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.functions.sh
Comment thread utils/readsb-wiedehopf/files/readsb.hotplug Outdated
Reconcile missing SDRs through checked private UCI updates, aborting
startup on failed writes or commits without committing operator edits.
Quote feeder wizard arguments and preserve successful feeder creation
when optional setup fails.

Support APK companion discovery and installation alongside opkg.
Normalize nonpositive polling timeouts and missing serial diagnostics.
Extend focused regressions, document both package backends, and bump
the package release.

Signed-off-by: Dr Bill Mcilhargey <contributor@mcilhargey.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 05:46
@billmcilhargey

Copy link
Copy Markdown
Author

Addressed the outstanding review recommendations in signed, signed-off commit b9a4935 on add-readsb-wiedehopf. Ready for another review.

  • Missing-SDR reconciliation now uses checked private UCI staging, refuses pending operator changes, and aborts startup on write or commit failure.
  • Feeder wizard arguments are quoted individually and protocols are validated before confirmation. Failed optional companion setup no longer reports a saved feeder as a failed add.
  • Companion discovery, installed-state checks, init-file discovery, and installation support APK as well as opkg; discovery does not refresh indexes automatically.
  • Negative polling timeouts are normalized to zero, and unknown USB serials are logged as none.
  • Updated existing documentation and regression coverage; bumped the package release to 2.

Validation: 306 checks passed across feeder, runtime, companion, and GeoIP suites on LF-normalized Linux copies. Shell syntax checks passed; ShellCheck introduced no new findings versus the pre-change baseline. The real-UCI integration suite could not run because no UCI executable is available in this environment. No full OpenWrt SDK build or device test was performed.

All 11 previously open review threads have been resolved. Thank you for the review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread utils/readsb-wiedehopf/files/readsb.init
Comment thread utils/readsb-wiedehopf/files/readsb.init
Disable pathname expansion while splitting extra_args and restore the
caller shell state afterward. Cover literal wildcard arguments and
the existing first-writer-wins option indirection with regressions.

Retain release 1 for the package initial introduction.

Signed-off-by: Dr Bill Mcilhargey <contributor@mcilhargey.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 07:20
@billmcilhargey

Copy link
Copy Markdown
Author

Additional recommendations addressed in signed, signed-off commit 00782e6 on add-readsb-wiedehopf. Ready for another review.

  • extra_args retains intentional whitespace splitting but no longer expands wildcard characters to filenames. The original shell globbing state is restored after appending arguments.
  • Added regression coverage proving the existing read_first_set indirection is correct and first-writer-wins. The escaped dollar does not expand the PID; explained this tested false positive in its thread.
  • Kept initial PKG_RELEASE at 1, consistent with a package not yet introduced in-tree.

Validation: all 128 runtime checks passed under Linux sh, shell syntax checks passed, and ShellCheck introduced no new findings versus the previous commit. SDK/device validation was not performed. Both new review conversations are resolved. Local unrelated README formatting edits remain uncommitted.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 2 Medium severity

Open (2)
Resolved since last review (2)

Comment thread utils/readsb-wiedehopf/files/readsb-feeder
Comment thread utils/readsb-wiedehopf/tests/uci.sh
Report timeout execution errors as indeterminate instead of treating
them as connectivity failures. Preserve the original UCI test status
when cleanup encounters missing directories or chmod/removal errors.

Extend feeder and runtime regressions for tool-error statuses and
the real cleanup handler without requiring a UCI executable.

Signed-off-by: Dr Bill Mcilhargey <contributor@mcilhargey.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 08:35
@billmcilhargey

Copy link
Copy Markdown
Author

Addressed the latest recommendations in signed, signed-off commit f5a238c. Timeout execution errors (125/126/127) now return indeterminate rather than falsely reporting an unreachable feeder. UCI test cleanup preserves the original exit status despite missing directories or cleanup failures. Validation: 103 feeder checks and 143 runtime checks passed under Linux sh, including the extracted UCI cleanup handler; syntax checks pass and ShellCheck has no new findings. Full real-UCI integration and SDK/device testing were not rerun. Both new review threads are resolved. Ready for another review.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • b9a4935 "readsb-wiedehopf: address startup and companion review feedback" bumps PKG_RELEASE to 2, and 00782e6 "readsb-wiedehopf: keep extra arguments literal at startup" sets it back to 1. That pair cancels out, so squash it away. b9a4935 also adds the wizard's wiz_v_protocol validation, which its message does not mention, and its subject describes the process ("review feedback") rather than the change.

Generated by Claude Code

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 4 Medium severity

Open (4)
Resolved since last review (2)

Comment thread utils/readsb-wiedehopf/Makefile
Comment thread utils/readsb-wiedehopf/Makefile
Comment thread utils/readsb-wiedehopf/files/readsb-feeder Outdated
Comment thread utils/readsb-wiedehopf/files/readsb.hotplug
Share probe exit-status mapping between timeout and netcat, keeping
execution errors indeterminate instead of reporting unreachable hosts.
Avoid checking SDR serial presence when no device is selected during
removal, and add focused regressions for both behaviors.

Retain the required ncurses dependency for the upstream shared binary.

Signed-off-by: Dr Bill Mcilhargey <contributor@mcilhargey.com>
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:02
@billmcilhargey

Copy link
Copy Markdown
Author

Published signed, signed-off commit 5cbce77. Netcat and timeout now share exit-status mapping, so execution errors remain indeterminate rather than false connectivity failures. Hotplug removal skips serial checks for an empty device pin. The ncurses dependency is retained because upstream 3.16.11 builds viewadsb by copying the same fully linked readsb binary; evidence is posted in both duplicate threads. Validation: 106 feeder and 144 runtime checks passed under Linux sh, with no new ShellCheck findings. SDK/device and full real-UCI integration testing were not rerun. All four reviewed threads are resolved. Ready for another review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +88 to +91
# --- command: --list -------------------------------------------------------
cmd_list() {
local main_uuid total=0
main_uuid=$(uci -q get readsb.main.uuid)

# readsb-uuid -- inspect / generate / regenerate the station UUID.
#
# Manages the station UUID stored in readsb.@readsb[0].uuid (i.e.
Copilot AI balanced review requested due to automatic review settings October 5, 2026 11:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

Review effort: Lite
Findings: 1 High severity · 3 Medium severity

Open (4)

Comment on lines +124 to +145
elif [ "$sdr_count" -gt 1 ]; then
# Multi-SDR auto-pin by serial-matches-freq convention.
# Recipe in README.md ("Multi-SDR setup").
config_get freq_cfg "$target" freq
want_serial=$(readsb_freq_to_mhz "$freq_cfg")
device_freq=""
[ -z "$device" ] || device_freq=$(readsb_freq_to_mhz "$device")
match=""
if [ -n "$want_serial" ] \
&& readsb_sdr_serial_present "$want_serial"; then
match=$want_serial
fi
if [ -n "$match" ]; then
pin_device "$match" || exit 1
_debug "hotplug: $sdr_count RTL-SDRs attached; selected device='$match' by serial-matches-freq convention (freq=${freq_cfg:-1090})"
elif [ -n "$device" ] && readsb_sdr_serial_present "$device" \
&& { [ -z "$device_freq" ] || [ "$device_freq" = "$want_serial" ]; }; then
_warn "hotplug: no serial matches freq=${freq_cfg:-1090}; keeping attached automatic serial '$device'"
else
pin_device "" || exit 1
_warn "hotplug: $sdr_count RTL-SDRs attached ($(readsb_list_sdrs | tr '\n' ' ')); no serial matches freq=${freq_cfg:-1090}; staying net-only until a device is selected (tip: 'rtl_eeprom -s 1090' to label by frequency, or set 'option device <serial>')"
fi
}

# --- USB-settle wait -------------------------------------------------------
# Off by default. Honored when at least one section sets `option hotplug 1`.

@openwrt-ai openwrt-ai left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Commit checks

  • 5cbce77 "readsb-wiedehopf: normalize netcat failures and guard empty pins": the paragraph "Retain the required ncurses dependency for the upstream shared binary." describes no change in this commit (the Makefile is untouched). Drop it.

Generated by Claude Code

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants