Reboot the entire system
()
| 10919 | needs no radio and is always served (it shows a "no captures yet" state when |
| 10920 | empty). Login is required (not in the auth whitelist). |
| 10921 | """ |
| 10922 | return _no_store(make_response(send_from_directory('demos', 'rf_analyzer.html'))) |
| 10923 | |
| 10924 | |
| 10925 | @app.route('/adsb-radar') |
| 10926 | def adsb_radar_page(): |
| 10927 | """Serve the ADS-B radar screen (live aircraft at 1090 MHz via dump1090). |
| 10928 | |
| 10929 | Served when any SDR is present (so the page can offer its Install-dump1090 |
| 10930 | button even before dump1090 exists), when dump1090 itself is ready, or when |
| 10931 | the RF Waterfall demo toggle (``sdr_demo`` / ``RAGNAR_SDR_DEMO``) is on (the |
| 10932 | page then shows a synthetic sky). 404s otherwise. Login required. |
| 10933 | """ |
| 10934 | env = os.environ.get('RAGNAR_SDR_DEMO', '').strip().lower() |
| 10935 | demo = bool(shared_data.config.get('sdr_demo')) or env in ('1', 'true', 'yes', 'on') |
| 10936 | # Serve whenever an SDR is present (even without dump1090) so the page can |
| 10937 | # show its "Install dump1090" button — gating on dump1090 alone made the page |
| 10938 | # 404 before the user could reach that button. Demo always serves too. |
| 10939 | present = _any_sdr_present() |
| 10940 | if not present: |
| 10941 | try: |
| 10942 | import adsb |
| 10943 | present = bool(adsb.detect().get('available')) |
| 10944 | except Exception: |
| 10945 | present = False |
| 10946 | if not (demo or present): |
| 10947 | return ('Not Found', 404) |
| 10948 | return _no_store(make_response(send_from_directory('demos', 'adsb_radar.html'))) |
| 10949 |