Spectral Scan

Spectral scan software scans the spectral band where the LoRa gateway operates. It computes a RSSI histogram on several frequencies that detects occupied bands and get interferer profiles. It then logs the histogram in a .csv file.

This utility program is meant to run on the LoRa gateway reference design SX1301AP2 (with FPGA and additional SX127x).

The background RSSI scan is a diagnostic tool and must be run on top of the gateway activity. Also, the two SX1257 radios have to be configured in RX mode to optimize the matching impedance with SX127x. The 32MHz clock provided to the SX127x is available once SX1301 has enabled the two SX1257 radios, so the background RSSI scan must be launched after the packet forwarder.

Note: If the FPGA running the spectral scan also supports the Listen Before Talk (LBT) feature, then the LBT feature has to be enabled and running before launching util_spectral_scan. For example, if the lora_pkt_fwd runs in background, then it has  to use a global_conf.json file with “lbt_cfg.enable” set to true.

The util_spec_scan utility is found in the /opt/lora/gateway-utils or /opt/lora/gateway-utils-geo directory depending on hardware capabilities.

Command Options for util_spectral_scan

Command Line Options Descriptions
-h Displays a short help
-f start:step:stop Frequency vector to scan in MHz: start:step:stop Valid range: Start>800, step>0.005, stop<1000
-b Channel bandwidth to be used to configure the SX127x radio for scanning in KHz Valid values: [25,50,100,125,200,250,500]
-n Total number of RSSI points. Valid range: [1…65535]
-1 Log file name
-o <int> Offset in dB to be applied to the SX127x RSSI [-128..127]


Note:  For FPGA image that provides LBT support, the spectral scan gets less flexible. The following parameters have constraints.

  • Frequency step: has to be a multiple of 100
  • Channel bandwidth: hardcoded to 200KHz
  • Number of RSSI points: 16641


The format of the log file is as follows: Freq_1, histo_1, …, RSSI_128, histo_128 Freq_2, RSSI_1, …, RSSI_128, histo_128 …

RSSI_n is the nth value of RSSI in dBm

Default setup:

  • freq 863 : 0.2 : 870
  • 65535 RSSI points in total at 32kHz rate
  • 125KHz channel bandwidth
  • -4 dB RSSI offset

Note: Example with frequencies from 865 MHz to 870 MHz, by step of 100KHz, BW 200KHz 10000 RSSI points processed at 10kHz rate, saved in “Log.csv”: ./util_spectral_scan -f 865:0.1:870 -n 10000 -b 200 -l "log"