In this post we will discuss the issue of changing the frequency or gain of the Adalm-Pluto SDR in real time in a GNU Radio application. Indeed, the Pluto is disturbed for a small second at each change of one of its parameters. In the waterfall below, we update the frequency of the local oscillator every 5s. This results in the output of Pluto by beautiful horizontal bars.
This is a phenomenon that we observe with the Pluto but not with an RTL-SDR or a HackRF One.
The PlutoSDR Source block at each change of frequency would, according to my research, reset all the parameters which results in a disturbance of the processing in progress very annoying.
The solution lies in the use of the ‘IIO Attribute Sink’ and ‘IIO Attribute Updater’ blocks which allow only the selected parameter to be touched without disturbing the processing in progress.
Programming is tricky because you have to find:
- the device: ad9361-phy
- the direction: input or output
- the channel: alvoltage0 or voltage0
- the attribute: frequency or harwaregain
in a very small online documentation.
By connecting to the pluto it is possible to extract information.
In terminal mode enter: iio_info -u ip:192.168.2.1
iio:device1: ad9361-phy 9 channels found: altvoltage0: RX_LO (output) 8 channel-specific attributes found: attr 0: external value: 0 attr 1: fastlock_load value: 0 ...... attr 5: frequency value: 144999998 attr 6: frequency_available value: [70000000 1 6000000000] attr 7: powerdown value: 0 altvoltage1: TX_LO (output) 8 channel-specific attributes found: attr 0: external value: 0 ...... attr 5: frequency value: 144941178 attr 6: frequency_available value: [46875001 1 6000000000] ..... voltage0: (output) 10 channel-specific attributes found: attr 0: filter_fir_en value: 1 attr 1: hardwaregain value: 0.000000 dB attr 2: hardwaregain_available value: [-89.750000 0.250000 0.000000] ..... voltage0: (input) 15 channel-specific attributes found: attr 0: bb_dc_offset_tracking_en value: 1 ...... attr 4: hardwaregain value: 36.000000 dB attr 5: hardwaregain_available value: [-1 1 73]
To facilitate programming, I have grouped these blocks together in a small GNU Radio Companion application, which uses sliders to modify the reception frequency and the gain of Adalm-Pluto.
Be careful with the gain, the values are between 0 and 72. Beyond that, the system crashes.
We find the same difficulties on the transmitter channel. Note that when changing a parameter in the transmission chain, if you act directly on the PlutoSDR Sink block, the reception chain is disturbed.
In the example proposed to solve this difficulty, the sampling frequency is at 1.2 MHz. It is necessary in practice to use the same one as in the chain of reception if it works. We modify for the ad9361-phi device:
- the frequency
- channel: altvoltage1
- attribut: frequency
- the attenuation
- channel: voltage 0
Attention for the attenuation / harwaregain the values are negative between 0 and -89 in steps of 0.25. Unlike the PlutoSDR sink block where we speak of attenuation by putting positive values.
Another delicate point is that the IIO Attribute Update refresh interval should not be less than 1000 ms.
Likewise for the transmission chain, I have grouped these blocks in a small GNU Radio Companion application which uses sliders to modify the transmission frequency and the attenuation of Adalm-Pluto.
The proposed modification responds to the problem on the sole condition of being well centred in frequency. There is no longer any visual impact on a waterfall as seen with Remote SDR. However, on the NBFM audio channel each time the SDR frequency value is refreshed, every second, a small click is heard if you are more than 100Hz next to the carrier. As Pluto is not precise on its working frequency, it is necessary to compensate for the error in frequency, with the manual correction in Remote SDR. Once properly centred, the click disappears.
Posts on Adalm-Pluto SDR
- Remote SDR V5 -Raspberry 4B or Orange Pi Image Installation
- Remote SDR v5 – Manual Installation
- Remote SDR v5
- SDR Selection
- Launch of Remote SDR
- Introduction to Remote SDR
- Remote SDR v4
- Remote SDR V4 – Raspberry Pi 4B or Orange Pi Zero 2 image installation
- Remote SDR v4 – Manual Installation
- Remote SDR v2 – Raspberry 4B image installation
- Remote SDR – Examples of realization
- Remote SDR v2 – Orange Pi One Plus or Orange Pi Zero 2 image installation
- Remote SDR V2 – Manual installation
- Remote SDR V2
- SDR Pluto Frequency Update
- NBFM Transceiver with Pluto SDR and GNU Radio
- Frequency extension of Pluto SDR
- SDR Adalm-Pluto setup