uvk5-reverse-engineering icon indicating copy to clipboard operation
uvk5-reverse-engineering copied to clipboard

Incorrect frequencies in BAND definition

Open egzumer opened this issue 1 year ago • 2 comments

Bands are defined as:

BANDS = { 0: [50.0, 76.0], 1: [108.0, 135.9999], 2: [136.0, 199.9990], 3: [200.0, 299.9999], 4: [350.0, 399.9999], 5: [400.0, 469.9999], 6: [470.0, 600.0] }

According to this: https://github.com/amnemonic/Quansheng_UV-K5_Firmware/blob/main/uvmod_kitchen/mod_custom_freq_ranges.py

it should be: BANDS = { 0: [50.0, 76.0], 1: [108.0, 135.9999], 2: [136.0, 173.9990], 3: [174.0, 349.9999], 4: [350.0, 399.9999], 5: [400.0, 469.9999], 6: [470.0, 600.0] }

Also there is definition BANDS_NOLIMITS but _find_band returns hardcoded 1 for frequencies <50MHz (it should return 0 according to BANDS_NOLIMITS).

If band number and frequency doesn't match the radio band plan, the frequency on the radio is replaced with the closest value from the given band. For example: when I add in chirp a channel with frequency of 27.180MHz, the driver assigns band 1. If I then send it to the radio and switch to that channel, the radio tunes itself to 108MHz.

The hardcoded band number of 1 for <50MHz doesn't make any sense it should be deleted.

egzumer avatar Aug 06 '23 22:08 egzumer