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
223 stars 46 forks source link

Roaming zone entries are not read in correctly #319

Closed allesand closed 1 year ago

allesand commented 1 year ago

I have set up four roaming zones that I filled by selecting (sometimes the same!) "Add DMR channel". This fills the "Roaming channel" list automatically. When initially setting up the zones, everything is looks right and is written to the radio ok. But when I read it back in from the radio afterwards, the zones do not contain the right channels and it is written to the radio wrong on the next write. I could not determine yet what exactly is sorted wrong where. Is anybody else experiencing this? Setting up roaming works once, afterwards channels get mixed up. This happens since the introduction of the "roaming channels" tab or shortly afterwards. Is it a problem to add the same DMR channel in different roaming zones? Can I add a DMR channel to a roaming zone just once and then have to pick it as an existing "roaming channel"? Right now the same DMR-Channel ends up with two entries in the "roaming channels" list since I initially added it to two of the four roaming zones since they are "additive". Does that cause a problem on the read from the radio? To clarify: my setup works exactly one time - when building it in qdmr from scratch, is written to the radio ok, but then gets all confused on all subsequent reads - so basically I can not write a configuration to the 878 without messing up the roaming setup. Do I need to change the way I fill the zones?

hmatuschek commented 1 year ago

Romaing channels are somewhat limited DMR channels. They only contain the information of a channel, that might change when you roam from one repeater to another. This is just the frequency, and optionally the color-code and time-slot, if enabled. So the best way to configure roaming is to first generate a set of roaming channels by hand and then assemble the roaming zones. Adding DMR channels to the roaming zone is just a small convenience function. It actually does not add a DMR channel to the zone, but generates a roaming channel with these properties and adds that one to the zone. In the end, however, both methods should work. So, I believe that there is a decoding issue here. When decoding the roaming zone, something gores horribly wrong. If you like, you may test it by generating and then decoding the binary codeplug again. That is

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

The resulting codeplug_decoded.yaml should contain the same roaming settings like the initial codeplug.yaml

allesand commented 1 year ago

Some more testing: added four roaming zones and different DMR channels in each zone. Thus I have a long list of different roaming channels (rch1 to rch80). The zones get written to the radio ok. When reading in the radio, though, for each zone qdmr starts at the very beginning of the roaming channel list! Yup, diff, here the input (diff for codeplug.yaml) of the second zone:

* 4877,4909 **

And here what ends up in the second zone after the conversion with dmrconf encode/decode (diff for codeplug_decoded.yaml): --- 4957,4989 ----

First zone works, but roam2 also starts with "-rch1" instead of "-rch58" or roam3 with "- rch78". The number of entries for each zone is correct, but the roaming channel id is not set correctly/reset to "1" for all zones when building the yaml from the dfu?

hmatuschek commented 1 year ago

Should be fixed in the anyton-roaming-zones branch. If it works for you, the branch will be merged into master and the issue gets closed automatically.

allesand commented 1 year ago

Works for me! Tested the 878 - all four roaming zones are populated with the expected channels now on a read from the radio. Also tested the 868 - no side effects there. All good, thanks a lot!