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

Scanner of channels V2 #95

Open
wants to merge 22 commits into
base: main
Choose a base branch
from

Conversation

redradist
Copy link
Contributor

@redradist redradist commented Jul 27, 2023

Depends on Auto Squelch for channels
Rebased version of Scanner of channels

@redradist redradist force-pushed the feature/channel-scanner-v2 branch from 3a17e3d to 0ef1598 Compare July 27, 2023 17:23
@redradist redradist mentioned this pull request Jul 27, 2023
@redradist redradist force-pushed the feature/channel-scanner-v2 branch 3 times, most recently from 1af834f to 9d1c3c5 Compare August 2, 2023 19:06
@krakenrf
Copy link
Owner

krakenrf commented Aug 3, 2023

Just noting I am planning on looking at these PRs soon, maybe next week though.

@redradist redradist force-pushed the feature/channel-scanner-v2 branch 3 times, most recently from 06e5397 to 611356d Compare August 5, 2023 14:45
@godsic
Copy link
Contributor

godsic commented Sep 13, 2023

@redradist Lets make it happen!

@redradist
Copy link
Contributor Author

@redradist Lets make it happen!

I will rebase it in few days

@redradist redradist force-pushed the feature/channel-scanner-v2 branch from 611356d to 3fbbc81 Compare October 18, 2023 16:21
@redradist
Copy link
Contributor Author

@godsic

@redradist Lets make it happen!

Done

@godsic
Copy link
Contributor

godsic commented Oct 19, 2023

@redradist Could you please move all the scanning functionality into a separate file, i.e., outside _signal_processing/krakenSDR_signal_processor.py ? It would be a bit easier to review and maintain.

@krakenrf
Copy link
Owner

krakenrf commented Nov 7, 2023

@redradist testing this now, but I'm not exactly sure how it works. It seems to put a red VFO box around some strong signals, and then randomly receive some of the weaker signals with a green active VFO box. But several some strong signals are always missed. What is the intended behavior when we have several always active channels in the bandwidth?

We probably also need a way to restrict the number of VFOs it creates for systems like the Pi4.

One part of the algorithm also must be quite slow, because it slows down the Pi4 quite a bit, even though only one signal is actively green.

image

@redradist redradist changed the title Scanner of channels V2 [WIP] Scanner of channels V2 Dec 18, 2023
@redradist redradist force-pushed the feature/channel-scanner-v2 branch from 3fbbc81 to e3b48f6 Compare December 18, 2023 21:50
@redradist redradist changed the title [WIP] Scanner of channels V2 Scanner of channels V2 Dec 18, 2023
@redradist
Copy link
Contributor Author

redradist commented Dec 18, 2023

@redradist testing this now, but I'm not exactly sure how it works. It seems to put a red VFO box around some strong signals, and then randomly receive some of the weaker signals with a green active VFO box. But several some strong signals are always missed. What is the intended behavior when we have several always active channels in the bandwidth?

We probably also need a way to restrict the number of VFOs it creates for systems like the Pi4.

One part of the algorithm also must be quite slow, because it slows down the Pi4 quite a bit, even though only one signal is actively green.

@krakenrf Updated PR, now its behavior more consistent

  • Improved detection of the similar box. It should eliminate extra boxes inside of another big box
  • Renamed center_freq field to pick_freq field because it more describe what does it field mean

@redradist redradist force-pushed the feature/channel-scanner-v2 branch 4 times, most recently from 34d55c2 to b7bdcf6 Compare December 19, 2023 14:10
@krakenrf
Copy link
Owner

Got some conflicts after the last merges, can you please check?

@redradist
Copy link
Contributor Author

Got some conflicts after the last merges, can you please check?

@krakenrf Lets merge #114 and then I will rebase this one

@redradist redradist force-pushed the feature/channel-scanner-v2 branch from b7bdcf6 to d8afad9 Compare December 28, 2023 15:21
@redradist redradist force-pushed the feature/channel-scanner-v2 branch 2 times, most recently from 1566382 to e00ccec Compare February 7, 2024 10:52
Refactor initial implementation to work correct with long sequence of transmition

Hide option Active VFOs in case non Standard VFO Mode

Add display of detected frequencies

Changed print -> self.logger.debug

Add fm demodulation and iq channel writting

Add possibility to block channel for scanning if exceeded timeout

Reset colected information for channel if channel was marked as blocked

Refactoring after main rebase

Added handling params for VFo Scan mode
@redradist redradist force-pushed the feature/channel-scanner-v2 branch 2 times, most recently from 0ba1de7 to 32bc008 Compare February 9, 2024 16:09
@redradist redradist force-pushed the feature/channel-scanner-v2 branch from 32bc008 to 13b891c Compare February 9, 2024 16:12
@krakenrf
Copy link
Owner

krakenrf commented Feb 13, 2024

@redradist testing now thanks.

  1. Noticing a bit of an issue with the all the VFO cards not showing up sometimes. Only showing up after making a change to the VFO config box. Also sometimes some of the settings are not showing up for VFOs scan mode

  2. I'm still confused how the scanner works, can you provide a short tutorial? What is the blocking time used for?

  3. I still see it choosing odd channels, and sometimes all the VFO bars just dissapear.

image
  1. Once when I changed frequency the whole web ui crashed with error in the logs:
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/threading.py", line 973, in _bootstrap_inner
    self.run()
  File "/home/krakenrf/krakensdr_doa/krakensdr_doa/_sdr/_signal_processing/kraken_sdr_signal_processor.py", line 627, in run
    (self.channel_number + (active_vfos * 2 + 1), N),
TypeError: can only concatenate list (not "int") to list
INFO:quart.serving:192.168.87.30:61026 GET /config 1.1 200 665 5417
Traceback for <Task finished name='Task-5772' coro=<Pusher.dispatch() done, defined at /home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py:386> e>
TypeError: object of type 'int' has no len()
Traceback for <Task finished name='Task-5775' coro=<Pusher.dispatch() done, defined at /home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py:386> e>
TypeError: object of type 'int' has no len()
Traceback for <Task finished name='Task-5776' coro=<Pusher.dispatch() done, defined at /home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py:386> e>
TypeError: object of type 'int' has no len()
Traceback for <Task finished name='Task-5777' coro=<Pusher.dispatch() done, defined at /home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py:386> e>
TypeError: object of type 'int' has no len()
update_vfo_params: kwargs_dict["active_vfos"] = []
update_vfo_params: active_vfos = []
update_vfo_params: web_interface.module_signal_processor.active_vfos = []
Traceback for <Task finished name='Task-5794' coro=<Pusher.dispatch() done, defined at /home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py:386> e>
TypeError: object of type 'int' has no len()
update_vfo_params: kwargs_dict["active_vfos"] = []
update_vfo_params: active_vfos = []
update_vfo_params: web_interface.module_signal_processor.active_vfos = []
Traceback for <Task finished name='Task-5803' coro=<Pusher.dispatch() done, defined at /home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py:386> e>
TypeError: object of type 'int' has no len()
[2024-02-13 05:36:40,171] 192.168.87.30:61026 GET /config 1.1 200 665 5417
INFO:quart.serving:192.168.87.30:62040 GET /_push 1.1 101 - 3129
[2024-02-13 05:36:40,256] 192.168.87.30:62040 GET /_push 1.1 101 - 3129
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/quart/ctx.py", line 389, in wrapper
    return await websocket_context.app.ensure_async(func)(*args, **kwargs)
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/dash_devices/pusher.py", line 147, in dispatch
    await func(data['data'], client, data['id'])
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/dash_devices/dash.py", line 1261, in dispatch
    return
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/dash_devices/dash.py", line 1232, in call_callback
    return await loop.run_in_executor(None, runcoro, func(body, response, lock, client))  # %% callback invoked
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/concurrent/futures/thread.py", line 58, in run
    self.future.set_result(result)
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/dash_devices/_utils.py", line 252, in runcoro
    return e.value
  File "/home/krakenrf/miniforge3/envs/kraken/lib/python3.9/site-packages/dash_devices/dash.py", line 1158, in add_context
    lock.release()
  File "/home/krakenrf/krakensdr_doa/krakensdr_doa/_ui/_web_interface/callbacks/display_page.py", line 34, in display_page
    return [generate_config_page_layout(web_interface), "header_active", "header_inactive", "header_inactive"]
  File "/home/krakenrf/krakensdr_doa/krakensdr_doa/_ui/_web_interface/kraken_web_config.py", line 84, in generate_config_page_layout
    vfo_card = get_vfo_card_layout()
  File "/home/krakenrf/krakensdr_doa/krakensdr_doa/_ui/_web_interface/views/vfo_card.py", line 38, in get_vfo_card_layout
    i < web_interface.module_signal_processor.active_vfos
  1. For some frequencies it just seems to select the wrong bandwidth or be offset from the actual signal
image
  1. Often after a few seconds it just stops selecting any channels at all

and the logs show

Number of scanned active_vfos 0
plot_spectrum: module_signal_processor.active_vfos = 0
Number of scanned active_vfos 0
plot_spectrum: module_signal_processor.active_vfos = 0
Number of scanned active_vfos 0
plot_spectrum: module_signal_processor.active_vfos = 0
Number of scanned active_vfos 0
plot_spectrum: module_signal_processor.active_vfos = 0
Number of scanned active_vfos 0
image

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

Successfully merging this pull request may close these issues.

3 participants