Osmocom source/GNSS-SDR and bladeRF manual gain failure

Having issues with the site, hardware, source code, or any other issues?
Post Reply
uuq184mmx
Posts: 1
Joined: Sat Feb 17, 2024 6:31 pm

Osmocom source/GNSS-SDR and bladeRF manual gain failure

Post by uuq184mmx »

I have an appropriate setup for receiving L1 C/A GNSS-SDR signals using the bladeRF (a working biastee LNA and gps antenna and a working bladeRF conf file), but am receiving a constant loss of lock when tracking satellites, from extensive research I have found several possible issues that stem from the bladeRF's design specifically, but the most glaring issue is the inability to manually set the bladeRF's gain both in GNSS-SDR and in GNURadio using the Osmocom source block. So I am now reaching out to this community for guidance in hopes that you will help me solve this problem. If I can clarify or provide any further specifications that will help you in turn help me solve this issue, please reply on this thread.

Both Osmocom Source and the GNSS-SDR conf file (which uses Osmocom Source) are not able to set manual gains at runtime.

This problem cannot be solved by "setting the gains beforehand" using a bladeRF script because running GNSS-SDR will reboot the bladeRF which resets the gain settings. Here is the following error output when we specify "SignalSource.osmosdr_args=bladerf, biastee=rx,agc_mode=manual,agc=0;' along with desired IF, BB, and RF gains in the SignalSource block:

... output is normal up to this point ...
[bladeRF source] set_agc_mode: DEBUG: Setting gain mode to 1 (manual)
[WARNING @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:588] _rfic_host_set_gainmode: automatic gain control not valid for TX channels
[WARNING @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:557] _rfic_host_set_gainmode: automatic gain control not valid for TX channels
[WARNING @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:557] _rfic_host_set_gainmode: automatic gain control not valid for TX channels
[bladeRF source] bladerf_source_c: RX1 gain mode set to '1'
[WARNING @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:588] _rfic_host_set_gainmode: automatic gain control not valid for TX channels
[WARNING @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:557] _rfic_host_set_gainmode: automatic gain control not valid for TX channels
[WARNING @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:557] _rfic_host_set_gainmode: automatic gain control not valid for TX channels
[bladeRF source] bladerf_source_c: RX2 gain mode set to '1'
[bladeRF source] bladerf_source_c: DEBUG: initialization complete
Actual RX Rate: 4e+06 [SPS]...
Actual RX Freq: 1.57542e+09 [Hz]...
PLL Frequency tune error: -2 [Hz]...
[ERROR @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:717] _rfic_host_get_gain_stage: dev->board->get_gain_stage_range(dev, ch, stage, &range) failed: Invalid operation or parameter
Actual LNA Gain: [bladeRF source] get_gain: Could not get gain for stage 'LNA': Invalid operation or parameter
0 dB...
[ERROR @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:717] _rfic_host_get_gain_stage: dev->board->get_gain_stage_range(dev, ch, stage, &range) failed: Invalid operation or parameter
Actual VGA1 Gain: [bladeRF source] get_gain: Could not get gain for stage 'VGA1': Invalid operation or parameter
0 dB...
[ERROR @ host/libraries/libbladeRF/src/board/bladerf2/rfic_host.c:717] _rfic_host_get_gain_stage: dev->board->get_gain_stage_range(dev, ch, stage, &range) failed: Invalid operation or parameter
Actual VGA2 Gain: [bladeRF source] get_gain: Could not get gain for stage 'VGA2': Invalid operation or parameter
0 dB...

Actual Bandwidth: 1.8e+07 [Hz]...
RF Channels: 1
[bladeRF source] start: DEBUG: starting source

Below is my conf file:

; This is a GNSS-SDR configuration file
[GNSS-SDR]

;######### GLOBAL OPTIONS ##################
GNSS-SDR.internal_fs_sps=4000000
GNSS-SDR.telecommand_enabled=true
GNSS-SDR.telecommand_tcp_port=3333

;######## MONITOR CONFIG ###################
Monitor.enable_monitor=true
Monitor.decimation_factor=1
Monitor.client_addresses=127.0.0.1
Monitor.udp_port=1112

;######### SIGNAL_SOURCE CONFIG ############
SignalSource.implementation=Osmosdr_Signal_Source
SignalSource.item_type=gr_complex
SignalSource.sampling_frequency=4000000
SignalSource.freq=1575420000
;# RF Gain: LNA Gain {0, 3, 6}
SignalSource.gain=6
;# IF Gain: N/A
SignalSource.rf_gain=40
;# BB Gain: RX VGA1 + VGA2 [5, 60]
SignalSource.if_gain=48
SignalSource.AGC_enabled=false
SignalSource.samples=0
SignalSource.repeat=false
SignalSource.osmosdr_args=bladerf=0; This line enables the bladeRF
SignalSource.dump=false
SignalSource.dump_filename=./signal_source.dat

;######### SIGNAL_CONDITIONER CONFIG ############
SignalConditioner.implementation=Pass_Through

;######### DATA_TYPE_ADAPTER CONFIG ############
DataTypeAdapter.implementation=Pass_Through

;######### RESAMPLER CONFIG ############
Resampler.implementation=Pass_Through

;######### CHANNELS GLOBAL CONFIG ############
Channels_1C.count=8
Channels.in_acquisition=1
;######### ACQUISITION CONFIG FOR GPS L1 CHANNELS ############
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
Acquisition_1C.doppler_max=10000
Acquisition_1C.doppler_step=250
Acquisition_1C.threshold=3; this is set to 3 as when it is set lower we get many false positives, double-checked with gpredict
Acquisition_1C.coherent_integration_time_ms=1
Acquisition_1C.max_dwells=1

;######### TRACKING CONFIG FOR GPS L1 CHANNELS ############
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
Tracking_1C.item_type=gr_complex
Tracking_1C.pll_bw_hz=35.0
Tracking_1C.dll_bw_hz=2.0
Tracking_1C.dump=false
Tracking_1C.dump_filename=tracking_ch_

;######### TELEMETRY DECODER GPS CONFIG ############
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
TelemetryDecoder_1C.dump=false

;######### OBSERVABLES CONFIG ############
Observables.implementation=Hybrid_Observables
#Observables.enable_carrier_smoothing=true
Observables.dump=false
Observables.dump_filename=./observables.dat

;######### PVT CONFIG ############
PVT.implementation=RTKLIB_PVT
PVT.num_bands=1; forces L1 C/A single
#PVT.enable_pvt_kf=true ; apply a simple Kalman filter to the computed PVT solutions
PVT.positioning_mode=Single
PVT.output_rate_ms=20
PVT.display_rate_ms=500
PVT.rinexobs_rate_ms=100
PVT.rinexnav_rate_ms=100
PVT.iono_model=Broadcast ; Options: [OFF, Broadcast, Iono-Free-LC].
PVT.trop_model=Saastamoinen ; Options: [OFF, Saastamoinen, Estimate_ZTD, Estimate_ZTD_Grad]
PVT.flag_rtcm_server=false
PVT.flag_rtcm_tty_port=false
PVT.rtcm_dump_devname=/dev/pts/1
PVT.rtcm_tcp_port=2101
PVT.rtcm_MT1019_rate_ms=5000
PVT.rtcm_MT1077_rate_ms=1000
PVT.rinex_version=3
PVT.enable_monitor=true

SignalSource.osmosdr_args=bladerf,biastee=rx,agc_mode=manual,agc=0; this is at the bottom as biastee will not enable if put at the top
EmilyWilson
Posts: 3
Joined: Sun Apr 14, 2024 8:32 pm

Re: Osmocom source/GNSS-SDR and bladeRF manual gain failure

Post by EmilyWilson »

You've put a lot of effort into troubleshooting and understanding the basics. That's Not My Neighbor is a perfect choice!That's not my Neighbor
Post Reply