projecthorus / radiosonde_auto_rx

Automatically Track Radiosonde Launches using RTLSDR
GNU General Public License v3.0
498 stars 125 forks source link

Prototype: Run readsb during scan downtime #777

Closed pasky closed 1 year ago

pasky commented 1 year ago

I would like my SDR to track radiosondes as a priority, but receive other interesting things during the downtime - most obviously, contribute ADSB data.

This PR isn't a serious proposal on how to implement that, obviously (though it does work as a minimal PoC...). I'd like to use it more as a discussion ground, whether this kind of functionality would be welcome by you.

Thoughts:

darksidelemm commented 1 year ago

I don't really want to deal with any kind of handling of other software within auto_rx. RTLSDRs are cheap enough now that the simplest solution is to just buy another one rather than trying to time-share. Part of the point of auto_rx was to have something watching the band continuously to look for launches which might not be happening at normal times. Trying to do everything with a single RTLSDR and antenna is just going to result in a compromised system.

BTW independent of this proposal (I noticed it when changing the sleep code) - the sleep of scan_delay always completes to full even if the other thread is just half a second too slow to signal thread stop - this introduces a long delay until actual decoding begins. Is this intentional?

This one i haven't looked too much into, though I think I know the behaviour you mean. I'm guessing some tweaking of those delays would help avoid this?

pasky commented 1 year ago

Sorry for the delayed reply.

In the end it's of course your decision, just to explain my motivation better:

BTW independent of this proposal (I noticed it when changing the sleep code) - the sleep of scan_delay always completes to full even if the other thread is just half a second too slow to signal thread stop - this introduces a long delay until actual decoding begins. Is this intentional?

This one i haven't looked too much into, though I think I know the behaviour you mean. I'm guessing some tweaking of those delays would help avoid this?

I dealt with it like this (the log message usually comes about one second into the scan delay).

-            # Sleep before starting the next scan.
-           time.sleep(self.scan_delay)
...
+                for i in range(self.scan_delay):
+                    time.sleep(1)
+                    if self.sonde_scanner_running == False:
+                        self.log_info("Stopping thread during sleep!")
+                        break
darksidelemm commented 1 year ago

Odd that a 3B doesn't handle 2 RTLSDRs - I've run that configuration up at my prime receive site for a while now, before recently switching to an Airspy Mini configuration.

I'll fix the scan delay issue, but I don't really want to add in any other timesharing code within auto_rx, sorry...