mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-12-17 23:28:50 -05:00
Frequency Tracker script updates
This commit is contained in:
parent
30725b9651
commit
06bad02211
@ -10,4 +10,20 @@ pip install -r requirements.txt # Install requirements
|
||||
|
||||
<h2>freqtracking.py</h2>
|
||||
|
||||
This script is used to achieve frequency tracking with the FreqTracker plugin.
|
||||
This script is used to achieve frequency tracking with the FreqTracker plugin. Ideally you would start it before connecting the Frequency Tracker plugin in SDRangel. It works continuously (daemon style) until stop via Ctl-C.
|
||||
|
||||
Options are:
|
||||
|
||||
- `-h` or `--help` show help message and exit
|
||||
- `-A` or `--address` listening address (default `0.0.0.0`)
|
||||
- `-P` or `--port` listening port (default `8888`)
|
||||
- `-a` or `--address-sdr` SDRangel REST API address (defaults to calling address)
|
||||
- `-p` or `--port-sdr` SDRangel REST API port (default `8091`)
|
||||
|
||||
With default options (no parameters) it will listen on all available interfaces including loopback at `127.0.0.1` and at port `8888`. It will identify the SDRangel API address with the first request from SDRangel and connect back at port `8091`.
|
||||
|
||||
Normal sequence of operations:
|
||||
|
||||
- Start `freqtracking.py` in a terminal
|
||||
- In SDRangel connect the Frequency Tracker plugin by clicking on the grey square at the left of the top bar of the Frequency Tracker GUI. It opens the channel settings dialog. Check the 'Reverse API' box. Next to this box is the address and port at which the channel will be connected. If you use the defaults for `freqtracking.py` you may leave it as it is else you have to adjust it to the address and port of `freqtracking.py` (options `-A` and `-P`).
|
||||
- In the same manner connect the channel you want to be controlled by `freqtracking.py`. You may connect any number of channels like this. When a channel is removed `freqtracking.py` will automatically remove it from its list at the first attempt to synchronize that will fail.
|
||||
|
15
scriptsapi/freqtracking.py
Normal file → Executable file
15
scriptsapi/freqtracking.py
Normal file → Executable file
@ -44,7 +44,7 @@ def getInputOptions():
|
||||
if options.addr == None:
|
||||
options.addr = "0.0.0.0"
|
||||
if options.port == None:
|
||||
options.port = 8000
|
||||
options.port = 8888
|
||||
if options.sdrangel_port == None:
|
||||
options.sdrangel_port = 8091
|
||||
|
||||
@ -112,7 +112,16 @@ def adjust_channels(sdrangel_ip, sdrangel_port):
|
||||
if r.status_code / 100 != 2:
|
||||
remove_keys.append(k)
|
||||
for k in remove_keys:
|
||||
TRACKING_DICT.pop(k, None)
|
||||
tracking_item = TRACKING_DICT.pop(k, None)
|
||||
if tracking_item:
|
||||
request_content = tracking_item.get('requestContent')
|
||||
if request_content:
|
||||
channel_type = request_content.get('channelType')
|
||||
else:
|
||||
channel_type = 'Undefined'
|
||||
device_index = k[0]
|
||||
channel_index = k[1]
|
||||
print(f'SDRangel: {sdrangel_ip}:{sdrangel_port} Removed {channel_type} [{device_index}:{channel_index}]')
|
||||
|
||||
|
||||
# ======================================================================
|
||||
@ -158,7 +167,7 @@ def channel_settings(deviceset_index, channel_index):
|
||||
channel_type = content.get('channelType')
|
||||
for freq_offset in gen_dict_extract('inputFrequencyOffset', content):
|
||||
if channel_type == "FreqTracker":
|
||||
print(f'SDRangel: {sdrangel_ip}:{SDRANGEL_API_PORT} Tracker: {freq_offset} Hz')
|
||||
print(f'SDRangel: {sdrangel_ip}:{SDRANGEL_API_PORT} Tracker [{orig_device_index}:{orig_channel_index}] at {freq_offset} Hz')
|
||||
TRACKER_OFFSET = freq_offset
|
||||
TRACKER_DEVICE = orig_device_index
|
||||
adjust_channels(sdrangel_ip, SDRANGEL_API_PORT)
|
||||
|
Loading…
Reference in New Issue
Block a user