diff --git a/radios/baofeng_dm32_radiofoundry/capabilities.json b/radios/baofeng_dm32_radiofoundry/capabilities.json index c90fda8..9fb6e21 100644 --- a/radios/baofeng_dm32_radiofoundry/capabilities.json +++ b/radios/baofeng_dm32_radiofoundry/capabilities.json @@ -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." } diff --git a/site/es/index.html b/site/es/index.html index 47c9365..fda1497 100644 --- a/site/es/index.html +++ b/site/es/index.html @@ -241,7 +241,7 @@

Radios compatibles

Compatible No compatible No compatible - dmrconf + radiofoundry-cps Baofeng DM-1701 (RadioFoundry) MD-UV380 family, RadioFoundry @@ -250,7 +250,7 @@

Radios compatibles

Compatible No compatible No compatible - dmrconfhw + radiofoundry-cpshw Baofeng DM-32UV (RadioFoundry) DM-32UV, RadioFoundry @@ -259,7 +259,7 @@

Radios compatibles

Compatible No compatible No compatible - no USB; write the YAML with RadioFoundry's dm32_migrate.py + radiofoundry-cpshw Vero VR-N76 Dual-band, Bluetooth diff --git a/site/index.html b/site/index.html index f23d3e6..b8887b9 100644 --- a/site/index.html +++ b/site/index.html @@ -238,7 +238,7 @@

Supported radios

Supported Not supported Not supported - dmrconf + radiofoundry-cps Baofeng DM-1701 (RadioFoundry) MD-UV380 family, RadioFoundry @@ -247,7 +247,7 @@

Supported radios

Supported Not supported Not supported - dmrconfhw + radiofoundry-cpshw Baofeng DM-32UV (RadioFoundry) DM-32UV, RadioFoundry @@ -256,7 +256,7 @@

Supported radios

Supported Not supported Not supported - no USB; write the YAML with RadioFoundry's dm32_migrate.py + radiofoundry-cpshw Vero VR-N76 Dual-band, Bluetooth diff --git a/site/radios.json b/site/radios.json index be60bb1..4592ea5 100644 --- a/site/radios.json +++ b/site/radios.json @@ -178,7 +178,7 @@ "oem_cps": false, "headless": { "supported": true, - "backend": "dmrconf" + "backend": "radiofoundry-cps" } }, { @@ -190,7 +190,7 @@ "oem_cps": false, "headless": { "supported": true, - "backend": "dmrconf", + "backend": "radiofoundry-cps", "hw": true } }, @@ -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 } }, { diff --git a/tests/test_site_radio_table.py b/tests/test_site_radio_table.py index 51d2157..41d3a61 100644 --- a/tests/test_site_radio_table.py +++ b/tests/test_site_radio_table.py @@ -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} diff --git a/tools/gen_radio_table.py b/tools/gen_radio_table.py index 2dec2c4..adc0723 100644 --- a/tools/gen_radio_table.py +++ b/tools/gen_radio_table.py @@ -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") @@ -187,18 +192,25 @@ 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 " @@ -206,7 +218,7 @@ def derive_backend(cap: dict, declared: str | None) -> str | None: ) 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"