hmatuschek / qdmr

A GUI application for configuring and programming cheap DMR radios under Linux and MacOS X.
https://dm3mat.darc.de/qdmr/
GNU General Public License v3.0
216 stars 45 forks source link

Anytone D878: Every code-plug read appends to autoRepeaterSettings/offsets in the config. #348

Closed toco closed 1 year ago

toco commented 1 year ago

With each download for the code-plug from my Anytone AT-D878UVII Plus it appends the same offsets to the autoRepeaterSettings. Reproduced with qdmr at a335412 and Anytone firmware 3.02n (this also happened with 3.01 already).

    autoRepeaterSettings:
      directionA: Off
      directionB: Off
      vhfMin: 136 MHz
      vhfMax: 174 MHz
      uhfMin: 400 MHz
      uhfMax: 480 MHz
      vhf: off287
      uhf: off288
      vhf2Min: 136 MHz
      vhf2Max: 0 Hz
      uhf2Min: 400 MHz
      uhf2Max: 480 MHz
      vhf2: off287
      uhf2: off288
      offsets:
        - id: off1
          name: ""
          offset: 600 kHz
        - id: off2
          name: ""
          offset: 5000 kHz
        - id: off3
          name: ""
          offset: 600 kHz
        - id: off4
          name: ""
          offset: 5000 kHz
        - id: off5
          name: ""
          offset: 600 kHz
        - id: off6
          name: ""
          offset: 5000 kHz
        - id: off7
          name: ""
          offset: 600 kHz
        - id: off8
          name: ""
          offset: 5000 kHz
        - id: off9
          name: ""
          offset: 5000 kHz
        - id: off10
          name: ""
          offset: 600 kHz
        - id: off11
          name: ""
          offset: 600 kHz
        - id: off12
          name: ""
          offset: 5000 kHz
        - id: off13
          name: ""
          offset: 600 kHz
        - id: off14
          name: ""
          offset: 5000 kHz
        - id: off15
          name: ""
          offset: 600 kHz
        - id: off16
          name: ""
          offset: 5000 kHz
        - id: off17
          name: ""
          offset: 600 kHz
        - id: off18
          name: ""
          offset: 5000 kHz
        - id: off19
          name: ""
          offset: 600 kHz
        - id: off20
          name: ""
          offset: 5000 kHz
        - id: off21
          name: ""
          offset: 600 kHz
[…]
        - id: off286
          name: ""
          offset: 5000 kHz
        - id: off287
          name: ""
          offset: 600 kHz
        - id: off288
          name: ""
          offset: 5000 kHz
allesand commented 1 year ago

Can confirm: [...]

        - id: off431
          name: ""
          offset: 600 kHz
        - id: off432
          name: ""
          offset: 7600 kHz

These are referenced in

   autoRepeaterSettings:
[...]
      vhf: off431
      uhf: off432
hmatuschek commented 1 year ago

Cannot reproduce it here with a D878UV on 3.02n. However, there might be subtle differences between these firmwares. Could one attach a binary codeplug here, so I reproduce it? Read it from the device using

dmrconf read d878uv2_codeplug.dfu

The filename does not matter, just the file extension.

toco commented 1 year ago

Here you go: d878uv2_codeplug.dfu.zip

hmatuschek commented 1 year ago

Ok, thanks. I know exactly what happens here, but I don't know why yet. So this only happens when one writes the config to the radio. That is, simply reencoding from a YAML codeplug does not trigger it. I.e.,

dmrconf decode --radio=d878uv2 codeplug.dfu codeplug.yaml
dmrconf encode --radio=d878uv2 codeplug.yaml codeplug.dfu
dmrconf decode --radio=d878uv2 codeplug.dfu codeplug.yaml

is fine. At some point in the decoding, the offsets are added once again.

hmatuschek commented 1 year ago

Ok, was a trivial mistake. Should be fixed in 'fix-anytone-repeater-offsets'.

allesand commented 1 year ago

@toco Looking good here. Can you confirm? I was already wondering about the ever growing yaml file - not anymore :-)

hmatuschek commented 1 year ago

In fact, this was an issue affecting all AnyTone devices but only happened in the GUI. The GUI uses a single Config instance throughout the entire runtime. When you open a new codeplug or read one from a device, this instance gets reset. This reset, however, never reached the AnyTone setting extension and consequently, the repeater offset frequency list was never cleared.

toco commented 1 year ago

Verified on 9bde48b, the list no longer grows longer with every download. I had to upload a fixed code-plug to my device to get rid of some older duplicates, but once I did that the list stayed reliably at two entries.

toco commented 1 year ago

Accidentally posted in wrong issue, moved here: https://github.com/hmatuschek/qdmr/issues/349#issuecomment-1641581484

hmatuschek commented 1 year ago

Concerning the first point: You can only define 7 additional FM APRS frequencies in the extension. The first frequency is set by the FM APRS system. That is, within the config:

channels:
  - fm:
    id: aprsChannel
    # ...
    txFrequency: 144.800 MHz   # <- teaser for 0.12.0
    # ...
# ...
positioning:
  - aprs:
    # ...
    revert: aprsChannel  # defines the first APRS frequency implicitly via aprsChannel
    anytone:
     # ...
     frequencies:
       - 144.390 MHz # alternative (second) APRS frequency
hmatuschek commented 1 year ago

BTW, I believe, you wanted to comment on issue #349. This one here is fixed already.