@@ -309,18 +309,28 @@ settings in the environment file:
309
309
310
310
- ADDITIONAL_USER_NAMES: Comma separated list of additional admin usernames.
311
311
- ADDITIONAL_USER_PASSWORD: Password for additional admin users.
312
- - ADMIN_NAME: Username for the admin user.
313
312
- ADMIN_EMAIL: Email used to generate admin user. Change in production.
313
+ - ADMIN_NAME: Username for the admin user.
314
314
- ADMIN_PASSWORD: Password used to generate admin user. Change in production.
315
315
- AUTHENTICATION: Authentication method used for scos-sensor. Supports ` TOKEN` or
316
316
` CERT` .
317
- - BASE_IMAGE: Base docker image used to build the API container.
317
+ - BASE_IMAGE: Base docker image used to build the API container. These docker
318
+ images, combined with any drivers found in the signal analyzer repos, are
319
+ responsible for providing the operating system suitable for the chosen signal
320
+ analyzer. Note, this should be updated when switching signal analyzers.
321
+ By default, this is configured to
322
+ use a version of ` ghcr.io/ntia/scos-tekrsa/tekrsa_usb` to use a Tektronix
323
+ signal analyzer.
318
324
- CALLBACK_AUTHENTICATION: Sets how to authenticate to the callback URL. Supports
319
325
` TOKEN` or ` CERT` .
320
326
- CALLBACK_SSL_VERIFICATION: Set to “true” in production environment. If false, the SSL
321
327
certificate validation will be ignored when posting results to the callback URL.
322
- - CALLBACK_TIMEOUT: The timeout for the requests sent to the callback URL.
328
+ - CALLBACK_TIMEOUT: The timeout for the posts sent to the callback URL when a scheduled
329
+ action is completed.
323
330
- DEBUG: Django debug mode. Set to False in production.
331
+ - DEVICE_MODEL: Optional setting indicating the model of the signal analyzer. The
332
+ TekRSASigan class will use this value to determine which action configs to load.
333
+ See [scos-tekrsa](https://github.com/ntia/scos-tekrsa) for additional details.
324
334
- DOCKER_TAG: Always set to “latest” to install newest version of docker containers.
325
335
- DOMAINS: A space separated list of domain names. Used to generate [ALLOWED_HOSTS](
326
336
< https://docs.djangoproject.com/en/3.0/ref/settings/# allowed-hosts>).
@@ -344,17 +354,36 @@ settings in the environment file:
344
354
- POSTGRES_PASSWORD: Sets password for the Postgres database for the “postgres” user.
345
355
Change in production. The env.template file sets to a randomly generated value.
346
356
- REPO_ROOT: Root folder of the repository. Should be correctly set by default.
347
- - SCOS_SENSOR_GIT_TAG: The scos-sensor branch name.
357
+ - SCOS_SENSOR_GIT_TAG: The scos-sensor branch name. This value may be used in action
358
+ metadata to capture the version of the software that produced the sigmf archive.
348
359
- SECRET_KEY: Used by Django to provide cryptographic signing. Change to a unique,
349
360
unpredictable value. See
350
361
< https://docs.djangoproject.com/en/3.0/ref/settings/# secret-key>. The env.template
351
362
file sets to a randomly generated value.
363
+ - SIGAN_CLASS: The name of the signal analyzer class to use. By default, this is
364
+ set to ` TekRSASigan` to use a Tektronix signal analyzer. This must be changed
365
+ to switch to a different signal analyzer.
366
+ - SIGAN_MODULE: The name of the python module that provides the signal analyzer
367
+ implementation. This defaults to ` scos_tekrsa.hardware.tekrsa_sigan` for the
368
+ Tektronix signal analyzers. This must be changed to switch to a different
369
+ signal analyzer.
370
+ - SIGAN_POWER_CYCLE_STATES: Optional setting to provide the name of the control_state
371
+ in the SIGAN_POWER_SWITCH that will power cycle the signal analyzer.
372
+ - SIGAN_POWER_SWITCH: Optional setting used to indicate the name of a
373
+ [WebRelay](https://github.com/NTIA/Preselector) that may be used to power cycle
374
+ the signal analyzer if necessary. Note: specifics of power cycling behavior
375
+ are implemented within the signal analyzer implementations or actions.
376
+ - SSL_CA_PATH: Path to a CA certificate used to verify scos-sensor client
377
+ certificate(s) when authentication is set to CERT.
352
378
- SSL_CERT_PATH: Path to server SSL certificate. Replace the certificate in the
353
379
scos-sensor repository with a valid certificate in production.
354
380
- SSL_KEY_PATH: Path to server SSL private key. Use the private key for your valid
355
381
certificate in production.
356
- - SSL_CA_PATH: Path to a CA certificate used to verify scos-sensor client
357
- certificate(s) when authentication is set to CERT.
382
+ - USB_DEVICE: Optional string used to search for available USB devices. By default,
383
+ this is set to Tektronix to see if the Tektronix signal analyzer is available. If
384
+ the specified value is not found in the output of lsusb, scos-sensor will attempt
385
+ to restart the api container. If switching to a different signal analyzer, this
386
+ setting should be updated or removed.
358
387
359
388
# ## Sensor Definition File
360
389
@@ -391,6 +420,106 @@ specific to the sensor you are using.
391
420
}
392
421
` ` `
393
422
423
+ # ## Sensor Calibration File
424
+
425
+ By default, scos-sensor will use ` configs/default_calibration.json` as the sensor
426
+ calibration file. However, if` configs/sensor_calibration.json` or
427
+ ` configs/sigan_calibration.json` exist they will be used instead of the default
428
+ calibration file. Sensor calibration files allow scos-sensor to apply a gain based
429
+ on a laboratory calibration of the sensor and may also contain other useful
430
+ metadata that characterizes the sensor performance. For additional
431
+ information on the calibration data, see the
432
+ [NTIA-Sensor SigMF Calibration Object](https://github.com/NTIA/sigmf-ns-ntia/blob/master/ntia-sensor.sigmf-ext.md#08-the-calibration-object).
433
+ The default calibration file is shown below:
434
+
435
+ ` ` ` json
436
+ {
437
+ " calibration_data" :{
438
+ " datetime" : " 1970-01-01T00:00:00.000000Z" ,
439
+ " gain" : 0,
440
+ " noise_figure" : null,
441
+ " 1db_compression_point" : null,
442
+ " enbw" : null,
443
+ " temperature" : 26.85
444
+ },
445
+ " last_calibration_datetime" : " 1970-01-01T00:00:00.000000Z" ,
446
+ " calibration_parameters" : [],
447
+ " clock_rate_lookup_by_sample_rate" : [
448
+ ],
449
+ " sensor_uid" : " DEFAULT CALIBRATION" ,
450
+ " calibration_reference" : " noise source output"
451
+ }
452
+ ` ` `
453
+
454
+ The ` calibration_parameters` key lists the parameters that will be used to obtain
455
+ the calibration data. In the case of the default calibration, there are no
456
+ ` calibration_parameters` so the calibration data is found directly within the
457
+ ` calibration_data` element and by default scos-sensor will not apply any additional
458
+ gain. Typically, a sensor would be calibrated at particular
459
+ sensing parameters. The calibration data for specific parameters should be listed
460
+ within the calibration_data object and accessed by the values of the settings
461
+ listed in the calibration_parameters element. For example, the calibration below
462
+ provides an example of a sensor calibrated at a sample rate of 14000000.0 samples
463
+ per second at several frequencies with a signal analyzer reference level setting of -25.
464
+
465
+ ` ` ` json
466
+ {
467
+ " last_calibration_datetime" : " 2023-10-23T14:39:13.682Z" ,
468
+ " calibration_parameters" : [
469
+ " sample_rate" ,
470
+ " frequency" ,
471
+ " reference_level" ,
472
+ " preamp_enable" ,
473
+ " attenuation"
474
+ ],
475
+ " clock_rate_lookup_by_sample_rate" : [],
476
+ " calibration_data" : {
477
+ " 14000000.0" : {
478
+ " 3545000000.0" : {
479
+ " -25" : {
480
+ " true" : {
481
+ " 0" : {
482
+ " datetime" : " 2023-10-23T14:38:02.882Z" ,
483
+ " gain" : 30.09194805857024,
484
+ " noise_figure" : 4.741521295220736,
485
+ " temperature" : 15.6
486
+ }
487
+ }
488
+ }
489
+ },
490
+ " 3555000000.0" : {
491
+ " -25" : {
492
+ " true" : {
493
+ " 0" : {
494
+ " datetime" : " 2023-10-23T14:38:08.022Z" ,
495
+ " gain" : 30.401008416406599,
496
+ " noise_figure" : 4.394893979804061,
497
+ " temperature" : 15.6
498
+ }
499
+ }
500
+ }
501
+ },
502
+ " 3565000000.0" : {
503
+ " -25" : {
504
+ " true" : {
505
+ " 0" : {
506
+ " datetime" : " 2023-10-23T14:38:11.922Z" ,
507
+ " gain" : 30.848049817892105,
508
+ " noise_figure" : 4.0751785215495819,
509
+ " temperature" : 15.6
510
+ }
511
+ }
512
+ }
513
+ }
514
+ }
515
+ }
516
+ }
517
+ ` ` `
518
+
519
+ When an action is run with the above calibration, SCOS will expect the action to have
520
+ a sample_rate, frequency, and reference_level specified in the action config. The values
521
+ specified for these parameters will then be used to retrieve the calibration data.
522
+
394
523
## Security
395
524
396
525
This section covers authentication, permissions, and certificates used to access the
@@ -661,25 +790,60 @@ repository. The scos-actions repository is intended to be a dependency for every
661
790
as it contains the actions base class and signals needed to interface with scos-sensor.
662
791
These actions use a common but flexible signal analyzer interface that can be
663
792
implemented for new types of hardware. This allows for action re-use by passing the
664
- signal analyzer interface implementation and the required hardware and measurement
665
- parameters to the constructor of these actions. Alternatively, custom actions that
666
- support unique hardware functionality can be added to the plugin.
793
+ measurement parameters to the constructor of these actions and supplying the
794
+ Sensor instance (including the signal analyzer) to the ` __call__` method.
795
+ Alternatively, custom actions that support unique hardware functionality can be
796
+ added to the plugin.
667
797
668
- The scos-actions repository can also be installed as a plugin which uses a mock signal
669
- analyzer.
670
-
671
- scos-sensor uses the following convention to discover actions offered by plugins: if
798
+ Scos-sensor uses the following convention to discover actions offered by plugins: if
672
799
any Python package begins with " scos_" , and contains a dictionary of actions at the
673
800
Python path ` package_name.discover.actions` , these actions will automatically be
674
- available for scheduling.
675
-
676
- The scos-usrp plugin adds support for the Ettus B2xx line of signal analyzers.
677
- It can also be used as an example of a plugin which adds new hardware support and
678
- re-uses the common actions in scos-actions.
801
+ available for scheduling. Similarly, plugins may offer new action types by including
802
+ a dictionary of action classes at the Python path ` package_name.discover.action_classes` .
803
+ Scos-sensor will load all plugin actions and action classes prior to creating actions
804
+ defined in yaml files in ` configs/actions` directory. In this manner, a plugin may add new
805
+ action types to scos-sensor and those new types may be instantiated/parameterized with yaml
806
+ config files.
807
+
808
+ The [scos-usrp](https://github.com/ntia/scos-usrp) plugin adds support for the Ettus B2xx
809
+ line of signal analyzers and [scos-tekrsa](https://github.com/ntia/scos-tekrsa) adss
810
+ support for Tektronix RSA306, RSA306B, RSA503A,
811
+ RSA507A, RSA513A, RSA518A, RSA603A, and RSA607A real-time spectrum analyzers.
812
+ These repositories may also be used as examples of plugins which provide new hardware
813
+ support and re-use the common actions in scos-actions.
679
814
680
815
For more information on adding actions and hardware support, see [scos-actions](
681
816
< https://github.com/ntia/scos-actions#development> ).
682
817
818
+ # ## Switching Signal Analyzers
819
+
820
+ Scos-sensor currently supports Ettus B2xx signal analyzers through
821
+ the [scos-usrp](https://github.com/ntia/scos-usrp) plugin and
822
+ Tektronix RSA306, RSA306B, RSA503A, RSA507A, RSA513A,
823
+ RSA518A, RSA603A, and RSA607A real-time spectrum analyzers through
824
+ the [scos-tekrsa](https://github.com/ntia/scos-tekrsa) plugin. To
825
+ configure scos-sensor for the desired signal analyzer review the
826
+ instructions in the plugin repository. Generally,
827
+ switching signal analyzers involves updating the ` BASE_IMAGE`
828
+ setting, updating the requirements, and updating the ` SIGAN_MODULE` ,
829
+ ` SIGAN_CLASS` , and ` USB_DEVICE` settings. To identify the
830
+ ` BASE_IMAGE` , go to the preferred plugin repository and find
831
+ the latest docker image. For example, see
832
+ [scos-tekrsa base images](https://github.com/NTIA/scos-tekrsa/pkgs/container/scos-tekrsa%2Ftekrsa_usb)
833
+ or
834
+ [scos-usrp base images](https://github.com/NTIA/scos-usrp/pkgs/container/scos-usrp%2Fscos_usrp_uhd).
835
+ Update the ` BASE_IMAGE` setting in env file to the desired base image.
836
+ Then update the ` SIGAN_MODULE` and ` SIGAN_CLASS` settings with
837
+ the appropriate Python module and class that provide
838
+ an implementation of the ` SignalAnalyzerInterface`
839
+ (you will have to look in the plugin repo to identify the correct module and class). Finally,
840
+ update the requirements with the selected plugin repo.
841
+ See [Requirements and Configuration](https://github.com/NTIA/scos-sensor? tab=readme-ov-file#requirements-and-configuration)
842
+ and [Using pip-tools](https://github.com/NTIA/scos-sensor? tab=readme-ov-file#using-pip-tools)
843
+ for additional information. Be sure to re-source the environment file, update the
844
+ requirements files, and prune any existing containers
845
+ before rebuilding scos-sensor.
846
+
683
847
# # Preselector Support
684
848
685
849
Scos-sensor can be configured to support
0 commit comments