I got it running on Windows.
Hi Vitor,
Excellent news. Did you have to struggle a lot, or was it effortless?
Here my feedback:
1) The pluto-ip parameter does not seem to work. I had to change the Pluto's IP address back to 192.168.2.1 to run your scripts.
At one point I had to add the "ip:"-prefix into the Pluto address in order to be able to connect to Pluto, so I left it there. I didn't try without the prefix after that. Good observation!
2) The spectrum sweep is slow. Very slow. Like 2 samples per seconds! That is samples, not sweeps!
Yes, that is so true, unfortunately. There are two main reasons for that:
1. I am still learning GNU radio, so I had to "single step" the graph using start() and stop() between the frequency steps in order to be able to read the RMS-value of the received signal without memory corruption. When I figure out how to keep the GNU radio graph running constantly and how to read the values from the graph blocks without memory corruption the sweep time can be increased significantly.
2. The main cause of the slonwess comes from this: The design does not use FFT for the spectrum processing, but uses more conventional approach used in traditional spectrum analyzers. Since I wanted to use Pluto as a tracking generator, using FFT didn't quite make much of a sense in that regard. However, it is quite easy to modify the GRC-graph to contain an FFT block, too, and step the RF LO frequency quickly after each FFT computation.
By implementing this FFT approach, one could sweep the frequency ranges like 2 MHz - 3 MHz at a time, compute the FFT, and change the RX LO frequency fast. The 2 MHz l- 3 MHz imitation comes from the fact that the USB-connection will start losing samples at higher bandwidths. I have tried the maximum 56 MHz with GRQX, but the audio is very choppy. If losing samples during sweeps is not a problem, one could try to use this maximum 56 MHz sweep intervals.
I do not know yet at this point how to read the output of the GNU radio FFT block in a correct way without corrupting the memory, though. There are some GNU radio blocks that are used for interprocess communication, but I haven't had time to study then more closely yet. Of course, one can always try to step the graph by start() and stop(), and then read the FFT data from the graph.
I will update the project source code as soon as I am able to run the system without start()/stop() stepping.
Your script is cool and useful - don't get me wrong! I just imagined it would be as fast as hackrf_sweep (a sweep is almost instantaeous).
If this could be speeded up, i.e. by using C++ instead of Python, perhaps a link to my software would be possible. As it is, I won't bother, as it is not usable for me.
The apparent slowness comes from the facts stated above and the current implementation. It should not be too difficult to modify the GNC-graph to contain needed FFT block, and then read the data in the main script after each LO step.
The main achievement of my approach was to be able to set the TX and RX LO parameters on the fly - fast - using the IIO. Unfortunately I had to single step the graph because my lack of knowledge on how to do process GNU radio data properly "on the fly". So, its is not Python which slows down the process, and changing to C++ would not help as the problem is in the interprocess communication which I need to study next so that I can control the GNU radio graph from my process when the graph is running.
But again - your script is great and does have interesting applications.
Kind regards,
Vitor
Thanks, Vitor! The program works quite nicely, although it has some shortcomings. At least Pluto can be used as a spectrum analyzer and a tracking generator, which was my initial intention after all. I was able to measure my Moxon antenna, and I found out that it was bit off on both 2m and 70cm bands. Luckily the antenna was resonant at too low frequencies, so cutting a few millimeters from the elements should fix the tuning.
Br,
Kalvin