Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data loss bug: QDMR expects channel (and maybe other) IDs to be sequential with no numbers skipped - TYT MD-UV390 #250

Closed
Tyler-2 opened this issue Sep 12, 2022 · 2 comments
Assignees
Labels
bug Something isn't working DM-1701 MD-390 Affects TyT MD-390 devices MD-2017 Affects TyT MD-2017 devices MD-UV390 Affects TYT MD-UV390 and Retevis RT3S devices

Comments

@Tyler-2
Copy link

Tyler-2 commented Sep 12, 2022

Version 0.10.2

I was having a heck of a time with open source tools clobbering my configs and I think I found at least part of the problem... QDMR (and dmrconf) both kind of choke if you the radio skips an index # in a channel list. This would probably also occur if you deleted a channel from the front face of the radio? In the example dmrconfig config below, I added channels 12 and 13, but skipped ID 11. These channels work in the radio as expected.

DMRConfig file
# Table of digital channels.
# 1) Channel number: 1-3000
# 2) Name: up to 16 characters, use '_' instead of space
# 3) Receive frequency in MHz
# 4) Transmit frequency or +/- offset in MHz
# 5) Transmit power: High, Mid, Low
# 6) Scan list: - or index in Scanlist table
# 7) Transmit timeout timer in seconds: 0, 15, 30, 45... 555
# 8) Receive only: -, +
# 9) Admit criteria: -, Free, Color
# 10) Color code: 0, 1, 2, 3... 15
# 11) Time slot: 1 or 2
# 12) Receive group list: - or index in Grouplist table
# 13) Contact for transmit: - or index in Contacts table
#
Digital Name             Receive   Transmit Power Scan TOT RO Admit  Color Slot RxGL TxContact
    1   Channel1         431.125   +0       Low   -    60  -  -      1     1    1    1     # Contact1
    2   Channel2         432.225   +0       High  -    60  -  -      1     1    1    1     # Contact1
    3   Channel3         433.325   +0       High  -    60  -  -      1     1    1    1     # Contact1
    4   Channel4         434.425   +0       High  -    60  -  -      1     1    1    1     # Contact1
    6   Channel6         141.125   +0       High  -    60  -  -      1     1    1    1     # Contact1
    7   Channel7         142.225   +0       High  -    60  -  -      1     1    1    1     # Contact1
    8   Channel8         143.325   +0       High  -    60  -  -      1     1    1    1     # Contact1
    9   Channel9         144.425   +0       High  -    60  -  -      1     1    1    1     # Contact1

# Table of analog channels.
# 1) Channel number: 1-3000
# 2) Name: up to 16 characters, use '_' instead of space
# 3) Receive frequency in MHz
# 4) Transmit frequency or +/- offset in MHz
# 5) Transmit power: High, Mid, Low
# 6) Scan list: - or index
# 7) Transmit timeout timer in seconds: 0, 15, 30, 45... 555
# 8) Receive only: -, +
# 9) Admit criteria: -, Free, Tone
# 10) Squelch level: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
# 11) Guard tone for receive, or '-' to disable
# 12) Guard tone for transmit, or '-' to disable
# 13) Bandwidth in kHz: 12.5, 20, 25
#
Analog  Name             Receive   Transmit Power Scan TOT RO Admit  Sq RxTone TxTone Width
    5   Channel5         435.525   +0       High  -    60  -  -      3  82.5   82.5   12.5
   10   Channel10        145.525   +0       High  -    60  -  -      3  82.5   82.5   12.5
   12   Secret12         145.525   +0       High  -    60  -  -      3  82.5   82.5   12.5
   13   Secret13         145.525   +0       High  -    60  -  -      3  82.5   82.5   12.5

As a result, when dmrconf reads from the radio it chokes with:

ERROR in dfu_libusb.cc@238: Cannot get status: Input/Output Error.
Warning in dm1701_codeplug.cc@515: Cannot link zone extension: Channel index 12 not defined.
ERROR in uv390_codeplug.cc@783: Cannot link zone extension at index 0.
ERROR in tyt_codeplug.cc@2972: Cannot link zones.
ERROR in readcodeplug.cc@57: Cannot decode codeplug: In tyt_codeplug.cc:2972: Cannot link zones.
  In uv390_codeplug.cc:783: Cannot link zone extension at index 0.

and QDMR doesn't choke, it just happily appears to work (though the import status bar shows 99%), but channels past the missing #11 are absent from the channel list, dropped from the Zone list, etc.
Screenshot_2022-09-12_18-01-06

QDMR does however notice that something's afoot; the import status bar stops at 99% (See the screenshot above) and you can find this in the console:

ERROR in dfu_libusb.cc@238: Cannot get status: Input/Output Error.
Debug in tyt_codeplug.cc@1598: Explicitly set default ID to index=0.
Warning in dm1701_codeplug.cc@515: Cannot link zone extension: Channel index 12 not defined.
ERROR in uv390_codeplug.cc@783: Cannot link zone extension at index 0.
ERROR in tyt_codeplug.cc@2972: Cannot link zones.
qt.qpa.xcb: QXcbConnection: XCB error: 3 (BadWindow), sequence: 1183, resource id: 11945537, major code: 40 (TranslateCoords), minor code: 0
Debug in tyt_radio.cc@26: Destructed TyT radio.

I think it should either, you know, work, or fail. It's too easy to think your import went well and then blow away a bunch of config on your radio, only to notice it months later when you go to switch to your "IMPORTANT BUT RARELY USED CHANNELS" zone.

I suspect that this also applies to group IDs.

@Tyler-2 Tyler-2 changed the title Bug: QDMR expects channel (and maybe other) IDs to be sequential with no numbers skipped - TYT MD-UV390 Data loss bug: QDMR expects channel (and maybe other) IDs to be sequential with no numbers skipped - TYT MD-UV390 Sep 12, 2022
@hmatuschek
Copy link
Owner

hmatuschek commented Sep 13, 2022

Thanks for reporting this issue. In contrast to all other codeplugs, the TyT codeplugs do not use bitmaps to indicate which channels/contacts etc. are valid. Instead they use a bit within each list element to indicate if it is valid or not. To my knowledge, the manufacturer CPS does generate sparse lists. Thus, I stopped decoding when hitting the first invalid element in a list. I've never tested it, after deleting a channel using the keypad. This issue was there from the first release and you are the fist who found/reported it. This should be fixed now in the master branch, but I still need to test it.

@hmatuschek hmatuschek self-assigned this Sep 13, 2022
@hmatuschek hmatuschek added bug Something isn't working MD-UV390 Affects TYT MD-UV390 and Retevis RT3S devices MD-2017 Affects TyT MD-2017 devices MD-390 Affects TyT MD-390 devices DM-1701 labels Sep 13, 2022
@hmatuschek
Copy link
Owner

Fixed in 0.10.4 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working DM-1701 MD-390 Affects TyT MD-390 devices MD-2017 Affects TyT MD-2017 devices MD-UV390 Affects TYT MD-UV390 and Retevis RT3S devices
Projects
None yet
Development

No branches or pull requests

2 participants