Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion radios/baofeng_dm32_radiofoundry/capabilities.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@
"regions": "codeplug",
"offset": "0x700000"
},
"notes": "Baofeng DM-32UV after installing RadioFoundry, the MIT-licensed multi-mode firmware (radiofoundry.org, board dm32). This is a different radio from baofeng_dm32 (OEM): RadioFoundry drops the OEM codeplug format and keeps the codeplug in the open-firmware (OpenGD77/qdmr) layout, so the limits here are qdmr's OpenGD77Limits, not the OEM 4000-channel figures, and every profile has to be rebuilt against this entry. There is deliberately NO dmrconf block, so codeplugger exports qdmr YAML and refuses to program the radio: the DM-32UV has no USB of its own, its HR_C7000 platform exposes the CPS protocol only on the UART programming cable, and RadioFoundry places the open-firmware image 7 MB into the data flash. qdmr's driver neither finds a generic USB-serial cable (it matches VID 0x1FC9 PID 0x0094 only) nor adds that offset, so its writes would land in the stock area where RadioFoundry refuses them. RadioFoundry's documented route (docs/user/23-radios.md, Programming) is: edit or generate the codeplug as qdmr YAML, then write it with RadioFoundry's own tools/dm32_migrate.py restore --yaml FILE over the programming cable, which adds the offset; or open the YAML in the browser Codeplug Editor at radiofoundry.org/codeplug and write from there. The YAML this exporter produces is the file those tools take; 'dmrconf verify --radio=opengd77' (the limit-identical stand-in for openuv380) still checks it offline without hardware. Limits: 1024 channels, 68 zones of 80, 1024 contacts, 76 RX group lists of 32, 16-character names, matching RadioFoundry's own description of what the radio reads from the codeplug. max_scan_lists is 0 because RadioFoundry drops qdmr scanLists on import and scans by zone. The UHF ceiling is 470 MHz because qdmr's OpenGD77Limits rejects above it when the YAML is encoded, although the hardware and RadioFoundry both cover 400-480. Modes are FM and DMR only: RadioFoundry's airband AM and broadcast FM receive on this radio have no channel class in the OpenGD77 limits, and its P25/NXDN/Tier III channels travel in a radioFoundry YAML block that qdmr ignores and this exporter does not write. The radio reports open-firmware radio type 6 for now, per RadioFoundry; if a future release gives qdmr a working offset-aware driver, add a dmrconf block then, not before. NOT BENCH-VERIFIED: as of 2026-11-30 no DM-32UV here runs RadioFoundry; the site row carries no hw flag. Sources: RadioFoundry docs at commit 62db1bae."
"notes": "Baofeng DM-32UV after installing RadioFoundry, the MIT-licensed multi-mode firmware (radiofoundry.org, board dm32). This is a different radio from baofeng_dm32 (OEM): RadioFoundry drops the OEM codeplug format and keeps the codeplug in the open-firmware (OpenGD77/qdmr) layout, so the limits here are qdmr's OpenGD77Limits, not the OEM 4000-channel figures, and every profile has to be rebuilt against this entry. There is deliberately NO dmrconf block. qdmr cannot reach this radio: the DM-32UV has no USB of its own, its HR_C7000 platform exposes the CPS protocol only on the UART programming cable, and RadioFoundry places the open-firmware image 7 MB into the data flash, while qdmr's driver neither finds a generic USB-serial cable (it matches VID 0x1FC9 PID 0x0094 only) nor adds that offset, so its writes would land in the stock area where RadioFoundry refuses them. The radiofoundry_cps block above is the write path instead: codeplugger renders the codeplug with dmrconf against the limit-identical openuv380/opengd77 layout, then moves the image over RadioFoundry's own CPS link at offset 0x700000, which is where the open firmware actually reads it. 'dmrconf verify --radio=opengd77' still checks the YAML offline without hardware. RadioFoundry's manual routes remain available and produce the same file: tools/dm32_migrate.py restore --yaml FILE over the programming cable, or the browser Codeplug Editor at radiofoundry.org/codeplug (docs/user/23-radios.md, Programming). Limits: 1024 channels, 68 zones of 80, 1024 contacts, 76 RX group lists of 32, 16-character names, matching RadioFoundry's own description of what the radio reads from the codeplug. max_scan_lists is 0 because RadioFoundry drops qdmr scanLists on import and scans by zone. The UHF ceiling is 470 MHz because qdmr's OpenGD77Limits rejects above it when the YAML is encoded, although the hardware and RadioFoundry both cover 400-480. Modes are FM and DMR only: RadioFoundry's airband AM and broadcast FM receive on this radio have no channel class in the OpenGD77 limits, and its P25/NXDN/Tier III channels travel in a radioFoundry YAML block that qdmr ignores and this exporter does not write. The radio reports open-firmware radio type 6, which means 'the board declared no radio type', not an identity; the CPS backend accepts it rather than treating it as a model mismatch. If a future release gives qdmr a working offset-aware driver, add a dmrconf block then, not before. BENCH-VERIFIED 2026-12-01 on a clear-case DM-32UV running RadioFoundry (git 62db1bae): full write over the CPS link, then a read-back decoded and compared, identical to the codeplug sent. Verification is semantic, not byte-for-byte, because a correct write still differs in padding clusters and the VFO_A scratch area. Sources: RadioFoundry docs at commit 62db1bae."
}
6 changes: 3 additions & 3 deletions site/es/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ <h2>Radios compatibles</h2>
<td class="yes"><span aria-hidden="true">✓</span><span class="sr">Compatible</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">No compatible</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">No compatible</span></td>
<td class="yes"><span aria-hidden="true">✓</span> dmrconf</td>
<td class="yes"><span aria-hidden="true">✓</span> radiofoundry-cps</td>
</tr>
<tr>
<th scope="row">Baofeng DM-1701 (RadioFoundry) <span class="vendor">MD-UV380 family, RadioFoundry</span></th>
Expand All @@ -250,7 +250,7 @@ <h2>Radios compatibles</h2>
<td class="yes"><span aria-hidden="true">✓</span><span class="sr">Compatible</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">No compatible</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">No compatible</span></td>
<td class="yes"><span aria-hidden="true">✓</span> dmrconf<span class="hw" title="Verificado en una radio física">hw</span></td>
<td class="yes"><span aria-hidden="true">✓</span> radiofoundry-cps<span class="hw" title="Verificado en una radio física">hw</span></td>
</tr>
<tr>
<th scope="row">Baofeng DM-32UV (RadioFoundry) <span class="vendor">DM-32UV, RadioFoundry</span></th>
Expand All @@ -259,7 +259,7 @@ <h2>Radios compatibles</h2>
<td class="yes"><span aria-hidden="true">✓</span><span class="sr">Compatible</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">No compatible</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">No compatible</span></td>
<td class="no"><span aria-hidden="true">—</span> no USB; write the YAML with RadioFoundry's dm32_migrate.py</td>
<td class="yes"><span aria-hidden="true">✓</span> radiofoundry-cps<span class="hw" title="Verificado en una radio física">hw</span></td>
</tr>
<tr>
<th scope="row">Vero VR-N76 <span class="vendor">Dual-band, Bluetooth</span></th>
Expand Down
6 changes: 3 additions & 3 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ <h2>Supported radios</h2>
<td class="yes"><span aria-hidden="true">✓</span><span class="sr">Supported</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">Not supported</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">Not supported</span></td>
<td class="yes"><span aria-hidden="true">✓</span> dmrconf</td>
<td class="yes"><span aria-hidden="true">✓</span> radiofoundry-cps</td>
</tr>
<tr>
<th scope="row">Baofeng DM-1701 (RadioFoundry) <span class="vendor">MD-UV380 family, RadioFoundry</span></th>
Expand All @@ -247,7 +247,7 @@ <h2>Supported radios</h2>
<td class="yes"><span aria-hidden="true">✓</span><span class="sr">Supported</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">Not supported</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">Not supported</span></td>
<td class="yes"><span aria-hidden="true">✓</span> dmrconf<span class="hw" title="Verified on a physical radio">hw</span></td>
<td class="yes"><span aria-hidden="true">✓</span> radiofoundry-cps<span class="hw" title="Verified on a physical radio">hw</span></td>
</tr>
<tr>
<th scope="row">Baofeng DM-32UV (RadioFoundry) <span class="vendor">DM-32UV, RadioFoundry</span></th>
Expand All @@ -256,7 +256,7 @@ <h2>Supported radios</h2>
<td class="yes"><span aria-hidden="true">✓</span><span class="sr">Supported</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">Not supported</span></td>
<td class="no"><span aria-hidden="true">—</span><span class="sr">Not supported</span></td>
<td class="no"><span aria-hidden="true">—</span> no USB; write the YAML with RadioFoundry's dm32_migrate.py</td>
<td class="yes"><span aria-hidden="true">✓</span> radiofoundry-cps<span class="hw" title="Verified on a physical radio">hw</span></td>
</tr>
<tr>
<th scope="row">Vero VR-N76 <span class="vendor">Dual-band, Bluetooth</span></th>
Expand Down
9 changes: 5 additions & 4 deletions site/radios.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@
"oem_cps": false,
"headless": {
"supported": true,
"backend": "dmrconf"
"backend": "radiofoundry-cps"
}
},
{
Expand All @@ -190,7 +190,7 @@
"oem_cps": false,
"headless": {
"supported": true,
"backend": "dmrconf",
"backend": "radiofoundry-cps",
"hw": true
}
},
Expand All @@ -202,8 +202,9 @@
"p64_toml": false,
"oem_cps": false,
"headless": {
"supported": false,
"note": "no USB; write the YAML with RadioFoundry's dm32_migrate.py"
"supported": true,
"backend": "radiofoundry-cps",
"hw": true
}
},
{
Expand Down
62 changes: 62 additions & 0 deletions tests/test_site_radio_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,68 @@ def test_backend_without_capabilities_block_is_an_error():
gen.derive_backend(cap, "chirp-writer")


def test_a_radiofoundry_block_is_a_programmable_radio():
"""The DM-32UV RadioFoundry row was published as unprogrammable.

Its only write block is radiofoundry_cps, which the table generator knew
nothing about, so the row told readers codeplugger could not write the
radio while codeplugger was in fact writing it.
"""
cap = {
"id": "test",
"name": "Test",
"modes": ["DMR"],
"radiofoundry_cps": {"dmrconf_radio_key": "openuv380"},
}
assert gen.derive_backend(cap, None) == "radiofoundry-cps"


def test_radiofoundry_cps_outranks_dmrconf():
"""Precedence has to match codeplugger.catalog, not a local guess.

The DM-1701 and RT3S RadioFoundry entries carry both blocks. The resolver
picks radiofoundry-cps, so the table has to say radiofoundry-cps.
"""
cap = {
"id": "test",
"name": "Test",
"modes": ["DMR"],
"dmrconf": {"radio_key": "openuv380"},
"radiofoundry_cps": {"dmrconf_radio_key": "openuv380"},
}
assert gen.derive_backend(cap, None) == "radiofoundry-cps"


def test_no_writable_radio_is_published_as_unsupported():
"""The exact shape of the DM-32UV bug, guarded for every shipped radio.

A row is allowed to omit the backend name, and most do. What it is not
allowed to do is say "supported": false about a radio the resolver has a
backend for. That is what the site said for a month.
"""
from codeplugger.catalog import programming_path

rows = {r["id"]: r for r in gen.load_rows()}
for radio_id, cap in gen.load_capabilities().items():
backend = programming_path(cap).backend
if backend is None:
continue
headless = rows[radio_id].get("headless", {})
assert headless.get("supported") is True, f"{radio_id} writes via {backend}"


def test_declared_backends_match_the_resolver():
"""Where a row does name a backend, it has to be the real one."""
from codeplugger.catalog import programming_path

rows = {r["id"]: r for r in gen.load_rows()}
for radio_id, cap in gen.load_capabilities().items():
declared = rows[radio_id].get("headless", {}).get("backend")
if declared is None:
continue
assert declared == programming_path(cap).backend, radio_id


AIRBAND = {"name": "Airband", "min_mhz": 108.0, "max_mhz": 136.0, "rx_only": True}


Expand Down
52 changes: 32 additions & 20 deletions tools/gen_radio_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,19 @@ def hw_badge(lang: str = "en") -> str:

HW_BADGE = hw_badge("en")

# Backends that a capabilities block implies. If a radio declares one of these
# blocks it is the backend, and site/radios.json is not allowed to disagree.
BLOCK_BACKENDS = {
"chirp": "chirp-writer",
"benlink": "benlink",
"dmrconf": "dmrconf",
"p64tool": "p64tool",
}
# Every backend codeplugger can name. Used only to tell "site/radios.json
# invented a backend" apart from "site/radios.json wrote a free-text note":
# which backend a given radio actually gets is answered by the resolver in
# codeplugger.catalog, never by a list kept here. See derive_backend().
KNOWN_BACKENDS = frozenset(
{
"chirp-writer",
"benlink",
"dmrconf",
"p64tool",
"radiofoundry-cps",
}
)

ARTIFACT_COLUMNS = ("chirp_csv", "qdmr_yaml", "p64_toml", "oem_cps")

Expand Down Expand Up @@ -187,26 +192,33 @@ def derive_modes(cap: dict) -> str:


def derive_backend(cap: dict, declared: str | None) -> str | None:
"""Resolve the headless-write backend, cross-checking capabilities."""
implied = [
backend for block, backend in BLOCK_BACKENDS.items() if block in cap
]
if len(implied) > 1:
raise GenError(
f"{cap['id']}: declares multiple write blocks {implied}; the table "
"has one Headless write column"
)
"""Resolve the headless-write backend, cross-checking capabilities.

The backend is not re-derived here. It is whatever "codeplugger program"
would actually reach for, asked straight from the resolver, so the
published table cannot drift away from the tool it documents.

It used to be re-derived, from a block-to-backend map kept in this file,
and it drifted exactly as you would expect: the radiofoundry_cps block
landed in capabilities.json without landing here, so the site went on
crediting the DM-1701 and RT3S RadioFoundry rows to dmrconf after the
resolver had already moved them to radiofoundry-cps, and the DM-32UV row,
whose only write block is radiofoundry_cps, was published as a radio
codeplugger refuses to program. A write block this file has never heard
of is now a silent no-op instead of a confident wrong answer.
"""
from codeplugger.catalog import programming_path

if implied:
backend = implied[0]
backend = programming_path(cap).backend
if backend is not None:
if declared is not None and declared != backend:
raise GenError(
f"{cap['id']}: site/radios.json says backend {declared!r} but "
f"capabilities.json implies {backend!r}"
)
return backend

if declared in BLOCK_BACKENDS.values():
if declared in KNOWN_BACKENDS:
raise GenError(
f"{cap['id']}: site/radios.json claims backend {declared!r} but "
"capabilities.json has no matching block"
Expand Down
Loading