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.
_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.
LOOP_GUARD now defaults to true: an echo coming back through a transcoding bridge is
dropped unless a system sets log (write a *LoopGuard* line and let it through) or false.
The example yaml explains what the guard catches that stream-ID loop control cannot.
The note on seq_advance and the two tests named one app; the capture on 7302 was from a
different one, and the fix covers any client that resets the sequence on the terminator.
A MASTER without the key now answers a hotspot's TG / ID 4000 with its link status;
TG4000_VOICE: false turns it off. Example yaml and docs (en/es) updated.
DVSwitch Mobile sends the terminator with seq 0 after ..., 28, 29. Since #127 seq_advance
takes it as a late packet and the ingress drops it, so on HBP and OBP the call only ended on
the 5 s stream timeout (5-10 s late on the dashboard) and a TG 4000 reply never fired. Before,
seq 0 skipped the checks. A terminator is now always the next packet; everything else keeps
#127's late/duplicate handling.
_release_legs_nobody_else_holds() checked the statics of the other
hotspots only: a hotspot with TS2=3340 in its OPTIONS that also held
3340 as a dynamic lost the 3340 leg after its own 4000, while the reply
said "linked to 3340". A leg is now kept while any connected hotspot,
the sender included, has the TG on that slot as an OPTIONS or YAML
static, or another one holds it as a dynamic.
The pacing test now gives each frame 5 ms of work, so a schedule that
drifts (next frame at now + 58 ms) fails it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
The follow-up agreed in #132:
- A private call to ID 4000 is answered with a private call from ID 4000
to the caller (pkt_gen(private=True): LC FLCO 3, DMRD unit bit), the
shape hotspot configs map back to the private contact (PCRewrite
...,84000,...,4000,...). A group 4000 keeps the group reply on TG 4000.
send_prompt_to_peer() gates and tracks a private frame as TG 4000 on
its slot, so routed group voice does not start under it.
- "linked to" + the statics the hotspot still has on that slot (its
OPTIONS and the MASTER's TS1/TS2_STATIC, both lists when simplex, up
to four), else "linked to N" with DEFAULT_REFLECTOR, else "not linked".
- The worker thread only loads the words and builds the frames; playback
is paced on the reactor with callLater (1 s after the over, then one
frame per 58 ms from a fixed start, no drift), stopping at the first
refused frame.
- On a shared MASTER, a dynamic leg only the sender held (no other
connected hotspot has that TG on that slot as a dynamic session, an
OPTIONS static or a YAML static) is set IDLE right away instead of
waiting for its timer (release_dynamic_leg / release_dynamic_leg_store,
reflector and static legs never touched).
Tests: 16 in tests/voice/test_tg4000_voice_reply.py, 12 of them fail on
develop. Docs (en/es): special numbers, configuration.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
Users get no feedback after keying TG 4000. With TG4000_VOICE: true on a
MASTER, the terminator of a hotspot's 4000 over (group or private call)
queues one reply to that hotspot only, about a second later:
- The words the disconnected prompt already says, in the system's
ANNOUNCEMENT_LANGUAGE: "not linked", or "linked to N" with a
DEFAULT_REFLECTOR (shared now as _link_status_words).
- A group call from the server voice ID to TG 4000 on the slot the 4000
came in on: the radio is still on that contact.
- Sent frame by frame on the reactor through the new
HBPProtocol.send_prompt_to_peer(): the hotspot did not subscribe to
TG 4000, so the OPTIONS filter does not apply, but its own slot gate
does; the reply stops if it gets busy with another stream on that
slot or leaves. MASTER slot rows are not touched, so nobody else on a
shared MASTER is held off, and it never goes to OpenBridge.
- One reply per over (stream ID); none if the terminator is lost.
Validator: bool, MASTER only. Default false; example yaml and docs
(en/es: configuration, special numbers) show it.
Refs #131.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
The shared MASTER tests now run the real in-band signalling through
build_hbp_repeat_stack and check that the other hotspot's TG 3340 leg
stays ACTIVE (on develop it goes IDLE); a MASTER of its own still sets
it IDLE.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
_apply_tg4000_reset() cleared the sender's UA sessions and stored
dynamic TGs, and then always ran the in-band 4000 signalling for the
whole system. On the proxy target MASTER, whose legs every hotspot
shares, that set every leg on the slot IDLE: the other hotspots stopped
hearing their talkgroups, OBP quenched them, and OPTIONS statics among
them (OFF legs with a timer) only came back after their timeout.
Seen on 2131 at 10:44:27 UTC: one hotspot's TG 4000 on TS2 logged
"clearing dynamic TGs for peer 213003507" and, in the same millisecond,
"[5b] ... (TG 4000 forced deactivation)" for 213, 2131, 3340, 7144,
9140 and 214480 on SYSTEM; 3340/7144/9140 were another hotspot's
OPTIONS statics and got "[7b] timeout timer reset to: 3600.0".
On a shared MASTER (_inject_multi_peer_options_filter) the in-band
signalling no longer runs; the sender's own dynamics are cleared as
before. A MASTER of its own keeps the full reset (in-band signalling +
deactivate all dynamic relays).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
Hotspots on the inject-only MASTER share one RX state per slot. With two
of them talking at once on the same slot:
- the first to end had its terminator dropped as 'already receiving':
the bridge hold its own transmission left was taken for a downlink, so
no END RX was sent and the dashboard kept the call lit;
- a stream that lost its terminator never timed out when another hotspot
keyed the same slot before the timer ran;
- START RX was repeated and END durations were wrong.
Each ingress stream is now tracked on its own (RX_STREAMS: peer, source,
TG, start, last frame): it times out by itself, its END carries its real
duration, and START is not repeated for it. The terminator check ignores
the hold of the hotspot's own transmission. Ingress controls are left as
they were.
With seq_advance a forward jump of 128 or more looked like a late
packet. A mesh stream that paused ~7.7 s or longer and resumed with the
same stream ID (its OBP state is kept for 180 s after the 5 s idle mark)
then had every following frame dropped; a pause over ~15 s could also
land on the same sequence and look like a duplicate.
A late packet arrives within milliseconds of its neighbours. The time of
the last accepted frame is now kept with lastSeq (lastSeqTime, on OBP and
HBP), and after more than SEQ_RESYNC_SILENCE_S (1 s) of silence the frame
is taken as a forward jump of its step (at least 1) and becomes the new
reference. Within that second the checks are unchanged.
Tests: seq_advance with silence (jump 150 after 9 s, a whole lap after
20 s, the same jump with no silence still late); the schedule seq 1..10,
9 s pause, 160..199 forwards all 40 frames and the terminator on OBP
(Max gap 9 s) and on HBP ingress. Both fail on 0caece5.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
expand_inject_proxy_systems deep-copied the whole inject MASTER, all its
peers included, once per virtual master (MAX_PEERS of them) and then
replaced PEERS. Each report to the monitor (every 60 s and on every
hotspot login, logout, RPTO, TG 4000 or dynamic TG change) blocked the
reactor for ~0.2 s with 26 hotspots and MAX_PEERS 200, ~0.75 s with 100;
hotspots hear gaps over MMDVMHost's 360 ms jitter as packet loss. A
shallow copy without PEERS is enough: the report only reads it, and the
dashboard_state and topology it produces are byte-identical.
The 8-bit sequence wraps 255 -> 0, but lastSeq was compared as a plain
number. A packet arriving late right after the wrap (254 after 0..3)
was not seen as out of order: it became lastSeq, so every later frame
of the call (and the terminator) was dropped as out of order. On OBP the
rest of the call never left over that mesh link and no *CALL END* was
logged; on HBP ingress the rest of the hotspot's over was lost. With
the previous commit the late packet would also have added ~250 to Loss.
seq_advance() (routing/helpers.py) gives the step from lastSeq to seq
modulo 256, used by both ingress paths:
- 1 next packet; 2..127 a forward jump, Loss += step - 1;
- 0 the same sequence again: duplicate, dropped;
- behind (128..255): late or out of order, Loss += 1, dropped, lastSeq
kept;
- as before, seq 0 repeated (voice header repeats) and seq 1 behind (a
source restarting its count) are taken as the next packet; seq 0
after 255 now goes through the same checks instead of skipping them.
Tests: seq_advance cases; the schedule ..., 253, 255, 0, 1, 2, 3, late
254, 4 ... 19 on OBP (frames after the late packet forwarded, CALL END
logged, Loss 2) and on HBP ingress (rest of the over forwarded). The HBP
one fails on develop.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
Logs in to a MASTER like a hotspot (RPTL/RPTK/RPTC/RPTO), subscribes to
talkgroups through OPTIONS and never transmits. One CSV row per group
voice stream: start/end UTC, slot, TG, source, stream ID, frames, the
longest silence between two frames, and whether it ended with a
terminator. --summary prints a per-hour/TG table.
Matched by stream ID with the server's *CALL END* (Loss / Max gap), it
tells whether a cut or silence was already in the call when it came in
over the mesh or appeared on the way to the hotspot. On 2131 it is what
found the bridge reset (#123) and the mesh announcement hold (#124).
- Standard library only; password from ADN_PROBE_PASSWORD, never argv.
- A fresh socket per login attempt and a growing back-off, so a server
restart or a refused login cannot turn it into a login flood.
- Tests: the login against a fake master that checks the key with the
server's own _calc_hash, a refused password, stream rows with their
longest silence, private calls ignored.
- Docs (en/es): Monitoring and reports, "What reaches a hotspot".
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
- "Missed packet(s)" added 1 to Loss per sequence jump, however many
packets it skipped: a jump of 93 counted as one, so OBP CALL END lines
read "Loss: 0.00%" over calls with seconds of audio missing.
It now adds every skipped packet.
- Frames held back upstream and released in a burst keep their sequence
numbers, so Loss cannot show them; the hotspot still hears a silence
("network watchdog has expired" on MMDVMHost). CALL END now ends with
"Max gap: N.NNs", the longest time between two frames of the stream.
It goes at the end of the line so parsers of the existing fields keep
working.
Cost: one subtraction and compare per OBP frame; a full OBP frame
through the deterministic harness stays at ~29.5 us either way.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
VoiceUseCases._prompt_frame (on-demand 9991-9999, voice ident, the
disconnected prompt) stamps TX_TYPE / TX_RFS / TX_TIME on TS2 but left
TX_FROM_MESH as the last routed call wrote it. On SYSTEM that is usually
a mesh call, so master_slot_holds_server_broadcast() returned False for
this server's own prompt and mesh voice could interleave with it.
- _prompt_frame writes TX_FROM_MESH = False next to TX_RFS.
- The private call stamp writes it too (True when the call came in over
OpenBridge), and new slots start with it False, so every TX_RFS write
sets it.
- Test: a prompt on a slot whose last TX came from the mesh holds the
slot on every frame (fails without the fix).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
The monitor builds its hotspot table from the OPTIONS text the server
reports, which only carried what the hotspot sent, so TS1_STATIC /
TS2_STATIC from adn-server.yaml never showed although they were routed.
The reported options and ts1/ts2_static now carry the static TGs the
hotspot actually gets (the same list routing uses), yaml ones first.
The hotspot's stored OPTIONS are left as they are.
On the shared inject-only MASTER each hotspot only got the static TGs of
its own OPTIONS, so the TS1_STATIC / TS2_STATIC of adn-server.yaml reached
a hotspot only while it was the sole one connected. The yaml lists are now
kept per MASTER when the config is loaded or reloaded and added to every
hotspot's static TGs on that MASTER, on top of its OPTIONS. A SIGHUP
updates connected hotspots and the MASTER's bridge legs.
Every server announces as 1000001, so master_slot_holds_server_broadcast()
took an announcement relayed over OpenBridge for this server's own and
re-applied the global MASTER slot hold for it. When one server sends two
announcements at once (TG 9140 and TG 7144 at the top of the hour, both
bridged to TS2 of a MASTER with several hotspots), each took the slot
from the other: on 2131 a hotspot heard 52 of the 267 frames of one.
The TX row now records whether its stream came from the mesh
(TX_FROM_MESH, mirrored onto the flat row like the other TX_* keys), and
only this server's own voice holds the slot. Mesh announcements then go
through the per-hotspot checks like any other mesh call.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11
A failed login (REG_ACL / unregistered ID), a callsign mismatch or one
hotspot closing down set _reset on the whole system. With many hotspots
on one MASTER that dropped the next frame routed to it ("disallow
transmission until reset cycle is complete", which also stops a plugin
announcement as "slot taken"), and BRIDGERESET then set every leg of the
system IDLE: calls the other hotspots were listening to stopped and
their dynamic TGs were gone until someone keyed up again.
Seen on 2131 at 20:00:15 UTC: an invalid login from ID 2131 cut the
hourly announcement at packet 113/115, and the reset 5 s later stopped a
TG 21472 over a connected hotspot was receiving (it arrived over OBP
with 0.42 % loss and ran 5 s longer). 64 such resets in 24 h there.
All paths now do what the peer timeout already did: restore the default
OPTIONS and set _reset only when no peer is left.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnjAx7G27d9q88j9PFLj11