An empty server list means its download failed; refusing every 4-5 digit source server on it cut off the whole mesh. A loaded list still refuses unknown servers.
The published checksum was written to disk before the lists were downloaded, so a list whose download failed no longer matched it and was refused at load, leaving it empty without a .bak. The checksum file on disk now describes the lists on disk; corrupt lists are still refused. The empty-tables warning also counts the fixed D-APRS and SC entries as empty.
Without cp_reconnect, adbapi keeps reusing connections closed by a MariaDB restart, so self-service send_opts failed with 2006 every 10 s until adn-server was restarted.
Alias lists, checksums, the security server's key and passwords, and
the panel report all send adn-server/<version>, read from pyproject.toml
(set by each release).
- A silent stream is not resumed on its terminator: it stays silent, so
no END RX for a start the monitor never saw and no START/END TX pair on
every target just to carry one terminator (test from the review).
- One _emit_group_voice_rx_start() for the VHEAD and the resume paths, so
the peer id is resolved the same way in both.
- _obp_grp already implies source_is_obp; shorter comments.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hi9GtvT6gMy8uqjNwYrW84
Send Accept-Encoding: gzip and decompress before the blake2b check, so
the 44MB subscriber list travels as ~6.6MB and the file on disk stays
plain JSON. In age mode, send If-Modified-Since and touch the file on a
304.
A TX onto a TG with an active QSO is activated silently: the peer gets the
downlink and its uplink is not forwarded. That decision was taken on the
first frame and held to the terminator. A reply keyed a fraction of a
second after the other station's last frame (still inside STREAM_TO on
some leg) was therefore muted for its whole length: nobody heard it, the
sender saw a normal transmission and found the other station talking when
it released PTT.
On every frame of a silent stream, check again whether the TG is still
held (tg_has_active_conversation, plus the other caller's leg on the same
slot, which RX_STREAM_ID no longer points to). When it is free, clear the
suppression, report the call START and open it on every target like a
late entry (LC, TX state), so it is forwarded from that frame on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hi9GtwUEB6mDD5pfhaJoKB
With SUBSCRIBERS_FILE empty, as in the example, the gateway sends the RPTC
with no callsign and a MASTER with ALLOW_UNREG_ID: false refuses every
terminal with MSTNAK. The example now points SUBSCRIBERS_FILE at
subscriber_ids.json, the docs say it is required in that case (local and
peer IDs are not resolved), the gateway warns at startup when the file is
missing, and the refusal log says the ID has no callsign in it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hi9GtwTdD7JhnkuDpZmGw8
- ENDPOINT must be https:// (http only for localhost); a 3xx is a
failure and is never followed, so the bearer token cannot travel in
cleartext or reach another host.
- The loop follows REPORT_INTERVAL after a config reload (the
LoopingCall's interval is updated on each tick).
- adn-server.example.yaml: the section, commented out, with
placeholders.
- Without the integrated proxy, hbp_ports skips MASTERs bound to
loopback (internal, e.g. a local gateway's master).
- Tests: reload (new token and interval, removing the section stops the
reports), https rule, redirect not followed, loopback masters, peers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
Optional section ADN_PANEL in adn-server.yaml, added by hand by the
sysop with the token generated for the server in the ADN panel; it is
not part of the config template. Without ENDPOINT and TOKEN nothing is
sent.
Every REPORT_INTERVAL (default 300 s, minimum 60; first one a minute
after start) the server POSTs to <ENDPOINT>/ingest/server-report:
version, server ID, uptime, the HBP port hotspots connect to, the ODTP
port (ODTP_PORT, since the gateway is its own service), the OBP proxy
port, connected peers, OpenBridge links with their keepalive state and
the plugins loaded. No IP addresses, passphrases or user IDs.
- The payload is built on the reactor from the dashboard state; the
POST runs in a thread with a 10 s timeout, so a slow or unreachable
panel never delays traffic.
- A failure is logged once (401/403 hint at the token) and again when
it recovers; the token is never logged.
- Settings are read on every tick and ADN_PANEL follows config reloads,
so a new token or removing the section applies without a restart.
- Config validation for the section; docs in en/es (monitoring guide).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
glibc gives every thread its own malloc arena; reloads spread over the
reactor pool left each arena holding the fragmented peak of one reload,
so the RSS climbed with every list change. A tick that finds a reload
still running is skipped (the superseded-generation logic is gone). The
thread starts with the reactor and stops before shutdown.
Closes#167
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
Each terminal logs in to the MASTER as one HBP peer with OPTIONS TERMINAL=1,
relaying the MASTER's salt as its challenge. Voice, embedded data, text
messages and locations go both ways; a call without a terminator ends 1 s
after its last frame, on its own timer. A terminal always talks as its
session's DMR ID (a 9-digit login as login // 100). Sessions are capped in
total, per IP and per minute; only a login that opens a MASTER link counts.
Tests run against a real HBPProtocol MASTER.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
A peer whose OPTIONS carry TERMINAL=1 (an app behind the ODTP gateway) gets
only the statics in its own OPTIONS, never the MASTER's TS1/TS2_STATIC. A
radio behind a hotspot mutes the MASTER's statics with its RX group list; an
app has none and plays everything it receives, so a user on TG 666 heard the
TG 214 beacon of a MASTER with TS2_STATIC 666,214.
cached_peer_static_tgs is the one place the downlink gate, the downlink index
and the reports read a peer's statics from, so the flag is checked there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
Data header, rate 1/2 and rate 3/4 blocks (trellis with hard-decision
Viterbi), CSBK preambles, the packet CRCs (CRC-16 header/CSBK, CRC-32,
CRC-9), IPv4/UDP with MOTOTRBO TMS and "DMR standard" SMS, and Hytera
HDAP/TMP, next to bptc, crc and rs129. bptc gains decode_19696 (the 96
data bits, beside encode_19696); the slot types come from const. DMRD
framing is one dmrd_frame() in frames.py, shared with DmrdStream.
Tested against on-air Hytera captures (location report, registration,
SACK) as well as round trips.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
The Talker Alias path reassembled the embedded LC of bursts B-E inline.
collect_embedded_lc() (domain/dmr/embedded_lc.py) does it for any LC,
with the same fragments, decode and errors, and the Talker Alias uses it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
pkt_gen built the header, the A-F bursts and the terminator in one
generator. DmrdStream (domain/dmr/frames.py) builds them one at a time
and pkt_gen now uses it; its output is byte for byte the same
(test_pkt_gen_golden pins the old digest). voice_bits() takes the 216
voice bits of a burst, as the recorder did inline.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
Moves the RPTL/RPTK/RPTC/RPTO exchange and the RPTPING keepalive out of
the PEER mode of HBPProtocol into application/hbp_peer_login.py, with
the same states, stats and log lines. The MASTER's salt goes to an
on_salt hook, so a caller can relay it and send_key() later. The PEER
mode builds its PeerLogin with the system, and again on a hot reload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
On the inject-only proxy MASTER (or any MASTER with MAX_PEERS > 1) the hourly
voice ident never played. Now VOICE_IDENT in the YAML allows it and each
hotspot that asks with VOICE=1 (or IDENT=1) in its OPTIONS gets its own ident
on TS2, sent to that hotspot only, with its callsign, LANG and VOICETG/IDENTTG,
once it has been quiet for 30 s. On a shared MASTER a hotspot's OPTIONS no
longer change VOICE_IDENT or the ident TG for the others. An empty
OVERRIDE_IDENT_TG now means all-call instead of failing the ident.
The bootstrap's LoopingCall errback got its arguments reversed, so it raised
itself and the loop died without a proper log; the HBP maintenance, OBP
keepalive/DNS and self-service loops had no restart at all. A dead
maintenance or stream trimmer loop leaves peers and streams that never time
out. Every periodic task now goes through start_loop: the error is logged
with its traceback and the loop is scheduled again at its interval.
peer_matches_rf_source() runs for every hotspot on every group voice frame
(_peer_should_receive_dmrd). It matched every peer of the MASTER against the
source with _fuzzy_peer_matches() and then looked for this peer in the list:
O(peers) per hotspot, O(peers^2) per frame, each step converting a key to int
and str. The answer only depends on this peer's own ID, so it is now checked
directly with the same rule (_peer_id_matches, shared with
_fuzzy_peer_matches). Peers stored with int/str keys keep the scan, which
normalises them.
Measured with tests/support/hbp_repeat_stack (REPEAT MASTER, group voice on a
static TG, 2,880 frames x 3 runs, Raspberry Pi 5), µs per frame:
peers 1: 143 -> 146
peers 5: 600 -> 572
peers 20: 2711 -> 2079 (-23 %)
peers 50: 8792 -> 5126 (-42 %)
Tests: direct cases (suffix, own ID, 5-digit prefix rule) and 300 randomised
peer tables (bytes, int and str keys) checked against the previous
implementation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013jYm3g9skKGroRdrfwJsCG
Slot RX_TYPE/TX_TYPE stored the frame's raw dtype/vseq, so voice burst C
(vseq 2) looked like HBPF_SLT_VTERM. Record voice bursts as
SLOT_TYPE_VOICE | vseq via domain slot_frame_type at every write site.
_pvt_call_received kept a private call's targets (_pvt_targets,
_pvt_target_peer_ids, _pvt_same_system_dst_peer_id) on the
RoutingUseCases instance, so every private call on the server shared
them. When two private calls overlapped on different systems, the
second call's header re-targeted the first call's frames to the second
call's destination, and the second call's terminator emptied the
targets, so the rest of the first call reached nobody.
Keep them in the source slot's state, which already holds the rest of
the call's RX state. They are written and read at the same points as
before, including the clear on the terminator.
A per-stream bridge TX leg on a MASTER slot is popped by its terminator, so a leg still there after 5 s lost it. The trimmer also required TX_TYPE != VTERM, but TX_TYPE holds the frame's dtype_vseq and voice burst C carries 2, the terminator's value: a call that lost its terminator right after burst C kept its leg forever and never got its END TX.
Loss divided the skipped frames by the frames received, so a stream resuming after a
pause (a jump of 150 with 51 frames received) logged 292 %. It also counted repeated,
late and out-of-order frames as lost, and a late frame twice: once in the jump it fell
into and once when dropped. Those now go to their own "dropped" counter, and Loss is
skipped / (received - dropped + skipped).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LweTug2oJgREHKxEUuE38Q
_send_data_to_hbp rebuilt each frame as header + burst and dropped the two
BER/RSSI octets, so every unit-data frame went out 53 bytes long. DMRGateway
only accepts DMRD frames of exactly 55 bytes (g4klx/DMRGateway DMRNetwork.cpp,
HOMEBREW_DATA_PACKET_LENGTH), so these frames never reached the radio.
It went unnoticed because a peer-originated data stream also reached the
hotspot through the private-call path in full. Frames sent by a plugin
(ServerContext.send_dmrd) only take the unit-data path: a D-APRS plugin's
answers reached the hotspot but the Hytera/MOTOTRBO radio never heard them
(seen on air 24-oct-2026: same bytes accepted at 55, ignored at 53).
Keep the received BER/RSSI octets (zero when absent).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LweTug2oJgREHKxEUuE38Q
The MASTER local REPEAT (_pvt_repeat_targets) already delivers a private
unit-data frame to the destination hotspot when both are on the same MASTER;
the SUB_MAP lookup in RoutingUseCases sent it a second time through
_send_data_to_hbp. The hotspot got every CSBK/header/block twice, which
breaks unconfirmed (rate 1/2) SMS reassembly on the radio. Same rule as
private voice. Plugin frames still go out through routing.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LweTug2oJgREHKxEUuE38Q
The config normalizer, the settings lookup and the HBP embedded-LC buffer
all defaulted a missing key to false. Default it to true, matching the
example config; an explicit false still disables it.
With ALLOW_UNREG_ID off, the master compared the RPTC callsign with the
subscriber DB byte for byte. Older IPSC2HBP builds send it lower case
("hp3icc"), so after a good RPTL/RPTK the master answered MSTNAK
("Callsign does not match subscriber database: Sent Call: hp3icc, DB
call HP3ICC") on every attempt, while BM, XLX and other masters accepted
the same repeater.
Callsigns are case-insensitive: compare both sides upper-cased. An
unknown ID (validate_id() returns False) is still rejected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ma9qC57Hrw7b4dZWoErMp4
An empty SUB_MAP_FILE already loaded sub_map.pkl, but the periodic save,
SIGHUP, kill switch and shutdown all skipped writing, so routes learned
since startup were lost on restart. Write to the same path the map is
loaded from; docs now say empty means sub_map.pkl.
Unit data was recognised by data type 6, 7 and 8 only. An SMS sent as rate 1
blocks (data type 10) went down the private voice path instead: repeated to
every hotspot of a shared MASTER and sent over slots playing voice, the same
crackle #144 removed for rate 1/2 and 3/4 data. One UNIT_DATA_DTYPES set now
drives the dispatch, the unit data checks and the local REPEAT.
The shared-MASTER handling only applied to the proxy target. A MASTER with
MAX_PEERS > 1 that hotspots reach on its own port still ran the in-band 4000
signalling and deactivated every dynamic bridge, so one hotspot's 4000 cut the
talkgroups every other hotspot on it was listening to.
A radio's GPS/ARS to an ID never heard on the shared MASTER was repeated to
every hotspot on it, and MMDVMHost drops the network voice it is playing when
a CSBK or data header lands on that slot: everyone heard a crackle every few
minutes. Unit data now goes only to its destination's hotspot, never as a
broadcast on a shared MASTER, and not while that hotspot carries voice on the
slot (any slot when simplex).
Review of #141:
- A live over sharing a slot with another TG: on the shared SYSTEM the
slot's flat RX fields only hold the last frame, so with hotspot A on
TG 213 and hotspot B on TG 91 talking on the same slot (B's frame
last) tg_quiet_for(213) counted time while A was on air.
tg_quiet_for now also reads each slot's RX_STREAMS (#129): a stream on
the TG with its last frame within STREAM_TO is live.
- An over that ends without a terminator left the record at its start:
the stream trimmer now notes the TG at the stream's last frame when a
hotspot stream (RX_STREAMS) or an OpenBridge ingress stream times out.
_note_tg_heard never moves the record back.
- Tests: your interleaved A/B case, a hotspot over and a mesh over that
lose their terminator (quiet from the last frame, not the start), and
a core announcement (synthetic, no plugin origin) not counted. Each
fails when its fix is removed. The deterministic harness now keeps
RX_STREAMS on HBP ingress, as udp_hbp does.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
Review of #141:
- The quiet window is a voice-announcements option, tg_quiet_s
(config.yaml, default 3 s; 0 turns it off), not the MASTER's
GROUP_HANGTIME, which is 15 s in the example yaml and would have kept
announcements retrying through normal pauses until they were dropped.
- Routing keeps a per-TG record of when an over last started or ended
(_tg_last_heard, written on voice headers and terminators only, from
any ingress but the server's own voice, pruned past 2048 TGs / 600 s).
On the shared SYSTEM the slot's flat RX_TGID / RX_TIME only remember
the latest stream, so a hotspot keying TG 91 erased the pause of a QSO
on TG 213 on the same slot; the record does not.
- RoutingUseCases.tg_quiet_for(tg): 0.0 while a stream on the TG is live
anywhere (tg_has_active_conversation), else seconds since the record,
inf if never heard. Offered to plugins as ServerContext.tg_quiet_for
(PluginDmrdSender: granted talkgroups only), next to voice_slot_for_tg,
which is back to develop's.
- The announcer waits before choosing a slot while quiet < tg_quiet_s:
every 5 s while voice is live, else right when it has been quiet long
enough. tg_voice_heard_within and the own-stream list are gone.
Tests: routing (never heard, from the end of a mesh over, live, another
MASTER, TG 91 on the same slot keeps the 213 trace, own voice not
counted), sender (granted TGs only), announcer (waits through a QSO,
a short pause keeps it waiting, 0 turns it off, no tg_quiet_for = as
before). 10 fail on develop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
start_utc / end_utc were HH:MM:SS.s only. A probe runs for days, so a
filter or a --summary by hour mixed the same hour of different days: on
2131 an on-air A/B test picked up yesterday's announcement at the same
time and looked like two TG 213 streams reaching the hotspot at once.
- Rows now carry YYYY-MM-DDTHH:MM:SS.s (UTC).
- --summary groups by date and hour (YYYY-MM-DDTHH); rows written before
this change (no date) still group by HH.
- Tests: a row carries its date; the summary keeps the same hour of two
days apart and still reads old rows. Both fail without the change.
- Docs (en/es) give the format.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
voice_slot_for_tg() only looked at the announcement MASTER's own slot.
A QSO on the same talkgroup coming in over the mesh (or from another
MASTER) rides the slot's TX leg, which no longer counts as busy since
#121, and between two overs there is no live stream at all. So a
scheduled announcement could start in the pause between overs: the
hotspots that then picked it up dropped the next over (same TG, other
stream) for the length of the announcement.
tg_voice_heard_within() (routing/helpers.py) tells whether a talkgroup
carried group voice in the last N seconds on any MASTER/PEER slot (RX or
TX leg) or OpenBridge stream, ignoring given stream IDs.
voice_slot_for_tg() returns None while the TG was heard within the
announcement MASTER's GROUP_HANGTIME (TG_QUIET_DEFAULT_S = 5 s when
unset), so the announcer retries every 5 s as for a busy slot. The
plugin's own streams of the last minute are ignored, so its previous
announcement does not hold the next one.
Tests: a mesh QSO's pause holds it and the window then frees it; the
window follows GROUP_HANGTIME; an over from a hotspot on another MASTER
holds it; another TG does not; the plugin's own last announcement does
not. The first three fail on develop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
The server emits both on every logged-in hotspot (options once it has OPTIONS), but the
topology peer schema has additionalProperties false, so a real topology failed to
validate. ts1_static/ts2_static descriptions now say they include the MASTER's statics.
merge_top_level_config never copied OBP_PROXY, so a reload kept DEBUG as at start and the
'bind change ignored' warning could never fire. DEBUG now applies on SIGHUP; LISTEN_PORT,
LISTEN_IP and BIND_LEGACY_PORTS still need a restart and log the warning. Docs updated.