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

Problem with proper setting freq. to RX only. #6

Closed
ResqIT opened this issue Dec 22, 2023 · 6 comments
Closed

Problem with proper setting freq. to RX only. #6

ResqIT opened this issue Dec 22, 2023 · 6 comments

Comments

@ResqIT
Copy link

ResqIT commented Dec 22, 2023

In current driver version only " ", "+" and "-" is possible in "Duplex" setting making it impossible to set Channel in RX mode only. Default Quansheng UV-K5 driver (from chirp) has additional off option. When loading configuration from radio, previously configured to be RX only channels have Duplex "-" and offset set to frequency itself. When trying to change anything Error: "Tx freq 0.000000 is out of supported range" is shown

@ResqIT
Copy link
Author

ResqIT commented Dec 22, 2023

in [chirp] (https://github.com/kk7ds/chirp/tree/master/chirp/drivers/uvk5.py):
in line 686:
rf.valid_duplexes = ["", "-", "+", "off"]

lines 730-757:
def validate_memory(self, mem):
msgs = super().validate_memory(mem)

    if mem.duplex == 'off':
        return msgs

    # find tx frequency
    if mem.duplex == '-':
        txfreq = mem.freq - mem.offset
    elif mem.duplex == '+':
        txfreq = mem.freq + mem.offset
    else:
        txfreq = mem.freq

    # find band
    band = _find_band(self._expanded_limits, txfreq)
    if band is False:
        msg = "Transmit frequency %.4f MHz is not supported by this radio"\
               % (txfreq/1000000.0)
        msgs.append(chirp_common.ValidationError(msg))

    band = _find_band(self._expanded_limits, mem.freq)
    if band is False:
        msg = "The frequency %.4f MHz is not supported by this radio" \
               % (mem.freq/1000000.0)
        msgs.append(chirp_common.ValidationError(msg))

    return msgs

in lines 921-934:
if (mem.offset == 0):
mem.duplex = ''
else:
if _mem.shift == FLAGS1_OFFSET_MINUS:
if _mem.freq == _mem.offset:
# fake tx disable by setting tx to 0 MHz
mem.duplex = 'off'
mem.offset = 0
else:
mem.duplex = '-'
elif _mem.shift == FLAGS1_OFFSET_PLUS:
mem.duplex = '+'
else:
mem.duplex = ''

in 1994-2004:
if mem.duplex == "":
_mem.offset = 0
_mem.shift = 0
elif mem.duplex == '-':
_mem.shift = FLAGS1_OFFSET_MINUS
elif mem.duplex == '+':
_mem.shift = FLAGS1_OFFSET_PLUS
elif mem.duplex == 'off':
# we fake tx disable by setting the tx freq to 0 MHz
_mem.shift = FLAGS1_OFFSET_MINUS
_mem.offset = _mem.freq

@egzumer
Copy link
Owner

egzumer commented Dec 22, 2023

I don't like the concept. What duplex has to do with TX disable, and what duplex==OFF mean? I would rather add that to TX power, but that is for another day.

For now I changed it so it will accept offset to 0 MHz.

@egzumer egzumer closed this as completed Dec 22, 2023
@egzumer
Copy link
Owner

egzumer commented Dec 22, 2023

Although is duplex OFF a standard way in CHIRP to disable TX or is it K5 driver creator invention?

@egzumer
Copy link
Owner

egzumer commented Dec 22, 2023

It looks like it is CHIRP standard way...

@ResqIT
Copy link
Author

ResqIT commented Dec 22, 2023

based on https://www.miklor.com/COM/UV_CHIRP_Examples.php and https://chirp.danplanet.com/projects/chirp/wiki/FAQ there were options of "(None)","+","-","split","off" described... I know it might not be the best way to achive tx block, nevertheless thanks very much for taking it into account.

@egzumer
Copy link
Owner

egzumer commented Dec 22, 2023

In case you didn't notice I added what you asked for, if that is how the CHIRP intends to do it then I'm not gonna argue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants