2

I need to move a .grc file from my Windows machine to my Linux machine. However they seem to save .grc files in a different manner – Linux saves using XML, and Windows saves using some sort of format that I've never seen, here is an example of the saved code from Windows:

- name: blocks_throttle_0
  id: blocks_throttle
  parameters:
    affinity: ''
    alias: ''
    comment: ''
    ignoretag: 'True'
    maxoutbuf: '0'
    minoutbuf: '0'
    samples_per_second: samp_rate
    type: complex
    vlen: '1'

When I move the .grc file saved in the format above to a Linux machine, GNU Radio Companion doesn't recognize it because the Linux GNU Radio Companion is expecting a file in XML format.

Here's what I've tried and why it hasn't worked

  1. Just redoing the project on Linux

    This failed because I have a custom Python block in my code. When I try to hit the "use default editor" in the GUI, nothing happens. I followed the directions here. However this did not work for me, so my custom block cannnot be added.

  2. Just redoing the project but adding my custom Python block straight to the .grc file

    This failed because in the Python code > is present, which makes the XML processing expect a tag there, causing the code to fail.

How can I properly convert my existing .grc files to a file format understood by the Linux version of GNU Radio Companion?

mkrieger1
  • 19,194
  • 5
  • 54
  • 65
Trov4
  • 21
  • 2

2 Answers2

1

That has nothing to do with windows or linux, but with the version of GNU Radio you're running.

On windows, you seem to be running an old GNU Radio 3.7, and on Linux something newer.

Modern GRC comes with a built-in converter from the old XML format to the new YAML, but it requires some libraries that aren't necessarily already installed. You'll want to read exactly what the console says when opening your XML flow graph.

This failed because in the python code there is ">" present, which makes the XML processing expect a tag there--causing the code to fail.

That doesn't sound right. If that's actually the case, please open a bug report on https://github.com/gnuradio/gnuradio

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94
  • Yes, it was a version issue--I upgraded the older version and got it resolved. Thanks for your help! – Trov4 Mar 03 '20 at 02:11
0

Here is the identified problem I was running into and some possible solutions:

Problem: the version between the two different GNURadio companions was different. My windows machine was running the v8.0.0 Beta and the Linux machine was running v3.7.13.5. The Beta v8.0.0 is the first version to output .grc files in the format above (still unsure on what that is called), while 3.7.13.5 and earlier output .grc files in an xml format.

Solutions:
1.) match versions
This takes some time to redownload and you might loose any special plugins you had on your version of GNU radio companion

2.) You can add your own python block directly to the .grc file
To do this you must make sure you use the XML special character guidelines for greater-than or less-than than symbols found here. Using &lt and &gt is what worked for me.

Trov4
  • 21
  • 2