Skip to content

Feature: adsbexchange-stats: add new package#29424

Open
billmcilhargey wants to merge 1 commit into
openwrt:masterfrom
billmcilhargey:add-adsbexchange-stats
Open

Feature: adsbexchange-stats: add new package#29424
billmcilhargey wants to merge 1 commit into
openwrt:masterfrom
billmcilhargey:add-adsbexchange-stats

Conversation

@billmcilhargey
Copy link
Copy Markdown

⚠️ Depends on #29411 (readsb-wiedehopf: new package).
Filed as a Draft until #29411 merges. CI failures on this PR until then are
expected — +readsb-wiedehopf is unresolved in the feed without it.

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.

📦 Package Details

Maintainer: @billmcilhargey

Description:
New leaf package utils/adsbexchange-stats. Procd-supervised bash
uploader that talks to ADSBexchange.com's per-station ranking endpoint.
Pure shell payload, 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.

Files added:

Path Purpose
utils/adsbexchange-stats/Makefile Package metadata, install rules, postinst/prerm/postrm
utils/adsbexchange-stats/files/adsbexchange-stats.config UCI defaults (declarative-only, see README)
utils/adsbexchange-stats/files/adsbexchange-stats.init procd init script (extra actions: showurl, info)
utils/adsbexchange-stats/files/adsbexchange-stats.functions.sh Shared sh helpers (UUID, JSON path resolution, logging)
utils/adsbexchange-stats/files/adsbexchange-stats.json-status-helpers.sh curl wrapper + per-cycle/summary metrics
utils/adsbexchange-stats/patches/010-openwrt-paths.patch Five minimal hooks on upstream json-status (paths, env file, scratch dir, perl-version gate, metrics)
utils/adsbexchange-stats/README.md Full operator documentation

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

Dependency chain

This PR consumes three artifacts shipped by #29411:

  • readsb.main.uuid — shared station identity
  • readsb-uuid CLI — manages the UUID for both packages
  • /usr/lib/readsb/functions.sh — provides readsb_is_uuid (8-4-4-4-12 hex validator)

DEPENDS:=+bash +jq +curl +coreutils-stat +readsb-wiedehopf


🧪 Run Testing Details

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

Build verification (snapshot SDK, aarch64_cortex-a53):

./scripts/feeds update -a
./scripts/feeds install -a -p packages
make package/adsbexchange-stats/{clean,download,prepare,compile} V=s

Runtime verification on the GL-AXT1800:

opkg install adsbexchange-stats_*.ipk
readsb-uuid                                  # set the shared station UUID
service adsbexchange-stats enable
service adsbexchange-stats start
service adsbexchange-stats showurl           # public per-station stats URL
logread -e adsbexchange-stats                # confirm uploads at log_level=1

Tested behavior:

  • postinst auto-start path: with readsb.main.uuid already set → service starts; without UUID → banner printed, service stays stopped (verified both).
  • service adsbexchange-stats {start,stop,restart,reload,status,enable,disable,showurl,info} — all return expected output.
  • Reload trigger fires correctly on uci commit adsbexchange-stats and on uci commit readsb (UUID / write_json changes propagate without manual restart).
  • log_level 0 / 1 / 2 / 3 — error-only / +summary / +per-cycle / +curl-v all observed in logread.
  • dns_cache=0 (default) and dns_cache=1 with a non-loopback resolver — both function; 127.0.0.0/8 resolver auto-disables the cache as documented.
  • json_paths_override empty (derived from readsb.main.write_json=/var/run/readsb) and explicit override both resolve correctly; unsafe-token rejection logs at warn.
  • prerm / postrm clean removal: /var/run/adsbexchange-stats cleared, /etc/config/adsbexchange-stats preserved (conffile), readsb.main.uuid untouched.
  • Uptime at submission: 1d 0h 29m 55s, load 0.19/0.21/0.27 — uploader stable across the window with no procd respawns.

✅ 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/adsbexchange-stats/refresh V=s
  • It is structured in a way that it is potentially upstreamable
    (the patch only adds OpenWrt-specific defaults and an opt-in
    $ADSBX_ENV_FILE source hook; both are no-ops when the env file is
    unset, so the change is upstream-friendly).

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 BKPepe force-pushed the add-adsbexchange-stats branch from 636fcfa to 983abb9 Compare May 13, 2026 11:40
@billmcilhargey billmcilhargey marked this pull request as ready for review May 16, 2026 11:43
@billmcilhargey
Copy link
Copy Markdown
Author

Marked as ready for review, I was waiting for the main one to be reviewed and approved first as I was not sure the process but in case this one was holding the main one up, I marked this as ready for review too

Appreciate it again!

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

2 participants