Updated to make the frequency read out correctly (positive numbers). Notes:
- Rig-to-GQRX seems to work. - GQRX-to-Rig seems to work. - Frequency scale increases left to right. - Frequency scale uses positive numbers. So, seems to be functioning, but needs more extensive testing.
This commit is contained in:
parent
4948c79d84
commit
27aa7edcc0
@ -35,8 +35,8 @@ GQRX_WAIT = 4
|
||||
delay_secs = 0.5
|
||||
timeout = 0.0
|
||||
|
||||
usb_if_offset = -2250
|
||||
lsb_if_offset = 0
|
||||
usb_if_offset = 0 #-2250
|
||||
lsb_if_offset = -1000 #0
|
||||
|
||||
rs = 0
|
||||
gs = 0
|
||||
@ -48,11 +48,13 @@ def calc_lnb_lo(freq, ifreq, isusb=True):
|
||||
if isusb:
|
||||
if DEBUG:
|
||||
print('USB IF: ' + str(ifreq + usb_if_offset))
|
||||
return - freq - (ifreq - usb_if_offset)
|
||||
#return - freq - (ifreq - usb_if_offset)
|
||||
return freq + usb_if_offset - ifreq
|
||||
else:
|
||||
if DEBUG:
|
||||
print('LSB IF: ' + str(ifreq + lsb_if_offset))
|
||||
return - freq - (ifreq + lsb_if_offset)
|
||||
#return - freq - (ifreq + lsb_if_offset)
|
||||
return freq + lsb_if_offset - ifreq
|
||||
|
||||
def get_rig_freq(rs):
|
||||
rs.send(b'm\n')
|
||||
@ -77,13 +79,13 @@ def set_rig_freq(rs, gs, freq, ifreq, isusb):
|
||||
if DEBUG:
|
||||
print('Set GQRX Freq: {}'.format(freq).encode())
|
||||
|
||||
gs.send('F {}'.format(-1 * freq).encode())
|
||||
gs.send('F {}'.format(freq).encode())
|
||||
gs.recv(1024)
|
||||
|
||||
|
||||
def get_gqrx_freq(gs):
|
||||
gs.send(b'f\n')
|
||||
return int(gs.recv(1024)) * -1
|
||||
return int(gs.recv(1024)) #* -1
|
||||
|
||||
def set_gqrx_freq(gs, freq, ifreq, isusb):
|
||||
lnb = calc_lnb_lo(freq, ifreq, isusb)
|
||||
@ -97,7 +99,8 @@ def set_gqrx_freq(gs, freq, ifreq, isusb):
|
||||
if DEBUG:
|
||||
print('Set GQRX Freq: {}'.format(freq).encode())
|
||||
|
||||
gs.send('F {}'.format(-1 * freq).encode())
|
||||
#gs.send('F {}'.format(-1 * freq).encode())
|
||||
gs.send('F {}'.format(freq).encode())
|
||||
gs.recv(1024)
|
||||
|
||||
def main():
|
||||
|
Loading…
Reference in New Issue
Block a user