Can I use GNU Radio software with FlexRadio hardware?

  • 2
  • Question
  • Updated 3 years ago
  • Answered
I would like to experiment with GNU Radio Companion or python code using the GNU Radio library.   Is this possible?  Does anyone have experience with this?
Photo of James Cosby

James Cosby

  • 1 Post
  • 0 Reply Likes

Posted 4 years ago

  • 2
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Hi, also currently working on the project myself
Found out that you can download the Flex radio API form the website
and create a new wavwform API using https://github.com/n5ac/smartsdr-dsp
Photo of KD4HSO

KD4HSO

  • 53 Posts
  • 3 Reply Likes
It would be nice to have a gr-osmosdr driver for the 6000. I'm in the process of learning C++, and hope to try to do it.

http://sdr.osmocom.org/trac/wiki/GrOs...
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Maybe a good point to start from might be to first get the IQ Data ( https://community.flexradio.com/flexradio/topics/how-to-use-flexlib-api-iqstream ) and a Vita-49 UDP Source GNU Radio block? No Idea if that is the right path, but I'm about to give it a try :) Anyone already created that Vita-49 UDP Source GNU Radio block like in this doc: https://www.ettus.com/kb/detail/building-a-32-channel-system-with-the-qr210
(Edited)
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Not as cool as a gr-osmosdr driver but - Proof of concept :) 

Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
That's awesome, how do you link the IP address of the generated data stream in C++ to your source block. Sorry, couldn't review the code properly.
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 56 Posts
  • 27 Reply Likes
It's C# running on the windows machine. Currently not the smartest way of transporting and packing the data but enough for a proof of concept...

Socket sock = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp);IPAddress serverAddr = IPAddress.Parse("<<GRC Machine IP here>>");
IPEndPoint endPoint = new IPEndPoint(serverAddr, <<"GRC udp source" port here>>);

In the dataReadyEvent: 

sock.SendTo(<<<IQ data byte[]>>>> , endPoint);
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Another prototype, only linux involved now.  No windows box or proxy between. Using Mono... 

            var stream = ConnectedRadio.CreateAudioStream(1);
            stream.RXDataReady += rxdataReady;
            stream.RequestAudioStreamFromRadio();
            var IQ = ConnectedRadio.CreateIQStream (1);
            IQ.DataReady += IQ_DataReady;
            IQ.RequestIQStreamFromRadio ();
            var IQ2 = ConnectedRadio.CreateIQStream (2);
            IQ2.DataReady += IQ2_DataReady;
            IQ2.RequestIQStreamFromRadio (); 

pushing the float[] into FIFOs, IQ directly into Gnu Radio, The audio goes to aplay -r 48000 -f  FLOAT_LE out.raw 

Writing is just like: 
foreach (var rx in data) {
                write2.Write (BitConverter.GetBytes(rx));            
            }
            write2.Flush();  


Performing fine, guess that's the right way to go for Audio / IQ. CAT will be pretty simple. Rendering Panadapters / Waterfalls will be HTML5.... not yet tried to get the Opus stream.


 
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Nice, so when you get data streams from the flex radio do you just create a gnu radio block that decodes using the code.
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
It's just taking the raw floats from the 2 IQ channels, that I've subscribed and does a FFT on it. The audio is  DAX Audio channel #1, goes via fifo into aplay. It's more about exploring how to continue. Experimenting, and trying to first bring the DAX client to linux/PULSEAUDIO :) The result should look ~ like:  

Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Hi, On your Dax IQ data to Gnu radio proof of concept do you run the SmartSDR software on windows then the Gnu radio GRC on linux. Im kinda conflicted because my SmartSDR only runs on Windows while my GRC runs on my linux. If I wanted to perform data stream setup for the UDP socket I can't view my IQ data waterfall and also run GRC on linux simultaneously.
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
No, no SmartSDR, just the API. I'll publish an utility very soon, that can be used as a starting point.
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Started to push things to Github. A first small sample is published, to sned DAX IQ data to an UDP socket: 

https://github.com/krippendorf/FlexlibMono

Descriptions in the repo.

Impressions: GRC & Baudline: 





(Edited)
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Awesome, how do you generate the
Im guessing you use this window to input the util for pushing data to gnu radio
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
oh sorry, i didn't communicate my question well.
I meant if I wanted to start using the util for pushing data into gnu radio, how I begin. 
I already downloaded the github files you posted but confused at the part where you say "start the util in a shell".
Don't know what shell your referring to.  
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Sorry, guess what I'm saying is how do I run the SampleFlexWrapper.cs code on linux. When I run the code I get an error at Using flex.util, Using flex.smoothlake.flexlib and Using ZeroMQ. At line 23, 24 and 25 of the code.
How do you get those to work. Thank you.
(Edited)
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
I'll update the readme tonight, you have to compile the code, to run it. Details soon. What you'll need is the latest version of mono: http://www.mono-project.com/download/
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
I keep getting an error when compiling
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
sorry not made it today, just a short hint again: latest mono version, fresh git clone / post the full build log then please
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
ok Thanks.
I currently have the latest mono version, a fresh git clone.
I then progress to the src file then open the FlexlibMono.sln
I then click on build all on the monodevelop window
Then I get the error from the SampleFlexWrapper.cs code
This is the area I'm stuck at
Also the PresentationCore and PresentationFramework references arent available
(Edited)
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
ok, might simply be the build order. Travis on Github also has no issues. That is one reason, why I setup the Travis CI...

To resolve: Click each proj (Vita, Util, UiW... first ) and press F7 to build on each, Flexlib/Queryutil last. Then rebuild the Solution. It's a very common Situation with sln files. Hope, that helps.
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Thanks I was able to generate the code. I am receiving packet from the radio but my gnu radio"udp source block" doesnt seem to be receiving the waveforms as seen below
(Edited)
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Have you selected DAX channel 1 on the panadapter, that you want to stream? Its in SmartSDR on the panadapter (top left). Should be easy to get this running now ;) 
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
yeah, i did make my DAX channel= 1 on panadapter. 
I used wireshark to confirm that my computer Ip address receive VITA 49 packets but the UDP block in grc doesnt seem to receive those packets or at least generate a waveform
Photo of D Major

D Major

  • 13 Posts
  • 2 Reply Likes
Hi Frank, do you by any chance have the VITA49 UDP block or packet. I think the radio only send packet in this form and an ordinary UDP can't read the packets. Thanks
Photo of Frank, HB9FXQ

Frank, HB9FXQ

  • 58 Posts
  • 27 Reply Likes
Well, I don't have that VITA49 block, but have just now verified, that my code is working. I'll try to push a version on the weekend with more debug output, to see what's going on. Have you tried to set a breakpoint to see what actually happens?

Stay tuned for an updated. Work in progress :)

For now: I've just quickly pushed a commit to github, so that you'll see an info on the console, that IQ data is actually being send.

Maybe you also want to try to replace 127.0.0.1 with your local IP address.

(Edited)