ryanvolz / radioconda

Software radio distribution and installer for conda
Other
342 stars 39 forks source link

Document Environment activation on Windows better (was: HackRF not found by Soapy HackRF Sink or Osmocom Sink) #9

Open hsberger opened 2 years ago

hsberger commented 2 years ago

I am trying to get a HackRF to work with GNURadio that comes in the RadioConda (02/07/2022 release) running under Windows 10.

With the Soapy HackRF Sink get the following:

File "C:\ATSC_Testing\ATSC\uhd_atsc_tx_v2_HackRF.py", line 100, in init self.soapy_hackrf_sink_0 = soapy.sink(dev, "fc32", 1, '', RuntimeError: SoapySDR::Device::make() no match

With the Osmocom Sink get the following error:

File "C:\ATSC_Testing\ATSC\uhd_atsc_tx_v3_HackRF.py", line 137, in init self.osmosdr_sink_0 = osmosdr.sink( RuntimeError: No supported devices found (check the connection and/or udev rules).

As you can see, I am trying to run the uhd_atsc_tx flowgraph that is in the RadioConda package.

The HackRF can be accessed through the hackrf_info utility, which returns the following:

hackrf_info version: 2021.03.1 libhackrf version: 2021.03.1 (0.6) Found HackRF Index: 0 Serial number: 000000000000000087c867dc2b46455f Board ID Number: 2 (HackRF One) Firmware Version: 2021.03.1 (API:1.04) Part ID Number: 0xa000cb3c 0x00594f5a

I would appreciate help for getting GNURadio to connect to my HackRF.

ryanvolz commented 2 years ago

Hi! It's good that at least hackrf_info works. Unfortunately the osmosdr sink definitely won't work since that hasn't been re-compiled with HackRF support yet, so we're left with trying to get Soapy to work. What is the output of the following?:

SoapySDRUtil --info
SoapySDRUtil --find

or maybe

SoapySDRUtil --find="driver=hackrf"
hsberger commented 2 years ago

Thanks for the quick response. Here is what I get with those commands:

C:\ProgramData\radioconda220207\Library\bin>SoapySDRUtil --find ######################################################

Soapy SDR -- the SDR abstraction library

###################################################### ←[1m←[31m[ERROR] SoapySDR::loadModule(C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/uhdSupport.dll) LoadLibrary() failed: The specified module could not be found. ←[0m libusb: warning [init_root_hub] could not get node connection information (V2) for root hub 'USB\ROOT_HUB30\4&1393214F&0&0' port 15: [87] The parameter is incorrect. Found device 0 device = HackRF One driver = hackrf label = HackRF One #0 87c867dc2b46455f part_id = a000cb3c00594f5a serial = 000000000000000087c867dc2b46455f version = 2021.03.1

C:\ProgramData\radioconda220207\Library\bin>SoapySDRUtil --info ######################################################

Soapy SDR -- the SDR abstraction library

###################################################### Lib Version: v0.8.1-1 API Version: v0.8.0 ABI Version: v0.8 Install root: C:\ProgramData\radioconda220207\Library Search path: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8 Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/airspyhfSupport.dll (0.2.0) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/airspySupport.dll (0.2.0) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/HackRFSupport.dll (0.3.4) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/LMS7Support.dll (20.10.0) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/PlutoSDRSupport.dll (0.2.1) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/remoteSupport.dll (0.5.2) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/rtlsdrSupport.dll (0.3.0) Module found: C:\ProgramData\radioconda220207\Library/lib/SoapySDR/modules0.8/uhdSupport.dll LoadLibrary() failed: The specified module could not be found. Available factories... airspy, airspyhf, hackrf, lime, plutosdr, remote, rtlsdr Available converters...

ryanvolz commented 2 years ago

Strange. Aside from the UHD errors (which are interesting to me but don't effect your HackRF), it looks like Soapy detects the HackRF just fine. Do you get an error if you run the following?

python -c "from gnuradio import soapy; soapy.sink('driver=hackrf', 'fc32', 1, '', '', [''], [''])"
hsberger commented 2 years ago

Here is what I get when I enter that at the root directory and from the RadioConda directory:

C:>python -c "from gnuradio import soapy; soapy.sink('driver=hackrf', 'fc32', 1, '', '', [''], [''])"

Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases.

C:>cd ProgramData\radioconda220207

C:\ProgramData\radioconda220207>python -c "from gnuradio import soapy; soapy.sink('driver=hackrf', 'fc32', 1, '', '', [''], [''])"

Traceback (most recent call last): File "C:\ProgramData\radioconda220207\lib\site-packages\gnuradio\soapy__init__.py", line 17, in from .soapy_python import * ImportError: DLL load failed while importing soapy_python: The specified module could not be found.

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "C:\ProgramData\radioconda220207\lib\site-packages\gnuradio\soapy__init__.py", line 21, in from .soapy_python import * ImportError: DLL load failed while importing soapy_python: The specified module could not be found.

ryanvolz commented 2 years ago

Did you run these commands from the "Conda Prompt (radioconda)"? And if not, can you try that? Sorry for lack of clarity. The conda environment has to be "activated" for the commands to be on your path, and for Python modules to be found.

hsberger commented 2 years ago

I am glad to try it but am not sure what you mean by "Conda Prompt (radioconda)"? Do you mean going to the directory I have RadioConda installed in?

I also am not sure how the environment is "activated"? How do I either do that or check that it was done?

ryanvolz commented 2 years ago

You should have an entry in your Start menu that is called "Conda Prompt (radioconda)". It would be in the "radioconda" directory in the Start menu. Launch that to get your command line. If you don't have that entry, I'll have to look up how to activate the environment from a basic command line.

When the environment is activated, you should see the environment name at the beginning of your prompt, e.g.

(base) C:\Users\rvolz>

It will also have the %CONDA_PREFIX% environment variable defined, so that

echo %CONDA_PREFIX%

prints a path.

ryanvolz commented 2 years ago

To activate from a regular command prompt, see if

conda activate

works.

If it doesn't because the conda command is unknown, then you have to cd to the directory where you installed radioconda

cd C:\ProgramData\radioconda220207

then cd to the condabin subdirectory

cd condabin

then run

conda activate
hsberger commented 2 years ago

Either something is not right with my install or I am not understanding what you are telling me? When I go to the Windows start and enter "Conda Prompt (radioconda)" it points me to the internet and your instructions on loading RadioConda.

I have RadioConda installed in a directory C://ProgramData/radioconda220207.

Are you saying that I should go into the Windows Environment Variables and add this path there?

ryanvolz commented 2 years ago

To activate from a regular command prompt, see if

conda activate

works.

If it doesn't because the conda command is unknown, then you have to cd to the directory where you installed radioconda

cd C:\ProgramData\radioconda220207

then cd to the condabin subdirectory

cd condabin

then run

conda activate

Let's forget about "Conda Prompt" for now and try my quoted comment from a regular command prompt.

As an aside, do you remember changing any of the default selections when installing radioconda? Maybe you chose not to add icons to the Start menu? How have you been running GNU Radio Companion if not from a Start menu icon or the Conda Prompt?

hsberger commented 2 years ago

That didn't work from the default directory but it did after I changed directories. Below is the command and the response:

C:\ProgramData\radioconda220207\condabin>conda activate

(base) C:\ProgramData\radioconda220207\condabin>

I don't remember changing any of the default values but I did not get an icon on the desktop. The 'target' for the desktop icon I use to start GRC is:

C:\ProgramData\radioconda220207\python.exe C:\ProgramData\radioconda_2\cwp.py C:\ProgramData\radioconda_2 C:\ProgramData\radioconda220207\Scripts\gnuradio-companion.exe

ryanvolz commented 2 years ago

C:\ProgramData\radioconda220207\python.exe C:\ProgramData\radioconda_2\cwp.py C:\ProgramData\radioconda_2 C:\ProgramData\radioconda220207\Scripts\gnuradio-companion.exe

The potential issue with this is that it seems to refer to two separate installations, one at C:\ProgramData\radioconda220207 and one at C:\ProgramData\radioconda_2. You should modify those paths so that they all refer to the same installation directory, whichever it is that you want to use. Other than that, I think that should work for starting GRC.

Back to the Soapy debugging, now try running

python -c "from gnuradio import soapy; soapy.sink('driver=hackrf', 'fc32', 1, '', '', [''], [''])"

from the activated environment, i.e. after

C:\ProgramData\radioconda220207\condabin>conda activate

(base) C:\ProgramData\radioconda220207\condabin>
hsberger commented 2 years ago

I noticed something and found a way to get the HackRF to work. I have an installation of RadioConda for GRC 3.8. The desktop icon for that has: "C:\Program Files\GNURadio-3.8\bin\run_GRC.bat"

The install for the 2/7/22 release doesn't have a bin directory. Should it?

Using that GRC and Osmocom the HackRF works just find and transmits the simulated ATSC signal.

I would still like to get the 2/7/22 release working with the Soapy HackRF Sink, but at least there is a point of comparison.

Going to your last note, here is what I get when I enter the command now:

(base) C:\ProgramData\radioconda220207\condabin>python -c "from gnuradio import soapy; soapy.sink('driver=hackrf', 'fc32', 1, '', '', [''], [''])" [INFO] Opening HackRF One #0 a06063c825555c5f...

ryanvolz commented 2 years ago

I have an installation of RadioConda for GRC 3.8. The desktop icon for that has: "C:\Program Files\GNURadio-3.8\bin\run_GRC.bat"

Sorry to say that's not radioconda, but rather Geof Nieboer's Windows installer: http://www.gcndevelopment.com/gnuradio/index.htm. It's a different beast, so that explains the different directory structure, etc. At least it can confirm that your device works with some version of GNU Radio.

Going to your last note, here is what I get when I enter the command now:

(base) C:\ProgramData\radioconda220207\condabin>python -c "from gnuradio import soapy; soapy.sink('driver=hackrf', 'fc32', 1, '', '', [''], [''])" [INFO] Opening HackRF One #0 a06063c825555c5f...

So that finds and opens your HackRF One as desired, which means that your GNU Radio Companion flowgraph should work. The fact it doesn't means that GRC is being launched without a properly activated environment. You should be able to get it to work if you run gnuradio-companion from the same activated prompt that you ran that last command.

Other than that, I'd suspect that the mixed paths from your GRC icon are to blame:

C:\ProgramData\radioconda220207\python.exe C:\ProgramData\radioconda_2\cwp.py C:\ProgramData\radioconda_2 C:\ProgramData\radioconda220207\Scripts\gnuradio-companion.exe

The potential issue with this is that it seems to refer to two separate installations, one at C:\ProgramData\radioconda220207 and one at C:\ProgramData\radioconda_2. You should modify those paths so that they all refer to the same installation directory, whichever it is that you want to use.

hsberger commented 2 years ago

With that Soapy HackRF Sink is working!

Thanks for all your help!!

hsberger commented 2 years ago

Ryan,

Let me suggest we do one more thing before closing this comment. That is to summarize what I did wrong in the installation and so what should others do to avoid the same problems.

What I originally did was download and run the Windows .exe file to install RadioConda. I wasn’t sure what to do next. There was no desktop icon created. So I created an icon on my desktop connecting with instructions for launching GRC and connecting to the GRC logo. We now know that I should have activated the installation, but how should I have known to do that? Is there more I should have done originally?

My thought is we should summarize the lessons learned so that others can avoid making the same mistakes.

Best Regards,

Stephen Berger

ryanvolz commented 2 years ago

Yes, I agree that improving the documentation will help. There is some mention of activation in the README, but clearly it's not prominent enough. What docs did you read (the README here, GNU Radio wiki, etc.)? How far did you get before your eyes glazed over with too much information? Where would it be helpful to mention activation so that you would have caught it?

I would hope most users would avoid this specific problem because they get a Start Menu icon and just use that, and I don't know why the installation failed to do that for you. But that's a mystery that I doubt we'll be able to figure out.

hsberger commented 2 years ago

Ryan,

You helped me a lot this week. Let me thank you again for being so generous and quick with your responses. I am very open to contributing where I can to your project and GNURadio more generally.

Let me think about your questions and look again at the documentation that does exist. I will get back with you as soon as I have a thoughtful response.

Best Regards,

Stephen Berger

hsberger commented 2 years ago

Ryan,

Here are my suggestions on helping others avoid the mistakes I made.

First, I would add a lessons learned to close the incident report. It doesn’t have to be long, perhaps only points to the right place for instructions on installation.

I recommend adding a pointer to the installation instructions in the Windows section of the releases page. Perhaps something as simple as saying “Make sure the read the following before running the Windows exe file:

https://github.com/ryanvolz/radioconda/releases

The README file seems a logical place to put instructions but it could also go in the wiki. I think the important thing is to have prominent pointers to it so that a newbe is likely to learn about it.

I would also suggest adding instructions on how to add OOT projects. Most of the instructions I see on this are for Linux but RadioConda can be running on Windows, like I am using it, or MacOS. How does a user add in some OOT project then?

A YouTube tutorial comparable to this one is another thing that would be helpful:

https://www.youtube.com/watch?v=0xuP1GQLPpI

Best Regards,

Stephen Berger

hsberger commented 2 years ago

Ryan,

This morning I was on a call of ANSI C63 SC7, chaired by Jason Coder of NIST (copied on this note). The use of GNURadio for spectrum research and various testing efforts came up. It turns out that some of the folks at NIST have recently setup RadioConda and also suggest some improvement to the setup instructions. Perhaps we have a small working group that is interested in helping others setup and run GNURadio under Windows.

Jason agreed to have a call on the topic after the meeting, which I am sure we will be doing soon.

Best Regards,

Stephen Berger

hsberger commented 2 years ago

Yesterday I found the attached installation instructions for RadioConda from someone in the Groupe swissATV. I like these a great deal. They are step-by-step instructions with lots of screenshots. Unfortunately it is in French, but I ran translations and put those, along with the URL, in the attached TXT file.

My thought is that an English translation of these instructions does most of what is needed. I am sure all of us will have suggestions for further improving these instructions. I have a couple of suggestions but overall I like what is done here.

Best Regards,

Stephen Berger

The following instructions were found at: https://home.swissatv.ch/wp-content/uploads/2021/06/radioconda-installation-v0.pdf

Translation of text:

Procédure d’installation de radioconda sur windows 10 Procedure for installing radioconda on windows 10

Le fichier d’installation pour Windows se trouve sur le GitHub de Ryan Volz ici: The installation file for Windows can be found on Ryan Volz's GitHub here:

ou directement depuis le lien ci-dessous : or directly from the link below:

Une fois télécharger, exécuter le fichier. Once downloaded, run the file.

Si tout c’est bien passé… If everything went well...

Dans le Start Menu de Windows, il y a deux nouveaux répertoires qui s’appellent : l’un GNU Radio. In the Windows Start Menu, there are two new directories that are called: one GNU Radio.

L’autre : radioconda The other: radioconda

Contrôle si les drivers sont bien présents pour le Lime Mini et le Adalm-Pluto Check if the drivers are present for the Lime Mini and the Adalm-Pluto

Dans le Window Start Menu, dans le répertoire radioconda, cliquer sur Conda Prompt (radioconda). In the Window Start Menu, in the radioconda directory, click Conda Prompt (radioconda).

Une fenêtre s’ouvre, taper et exécuter la commande suivante : soapysdrutil --find A window opens, type and run the following command: soapysdrutil --find

Le résultat est, si les drivers sont installés : The result is, if the drivers are installed:

et l’on peut exécuter depuis le Start Menu de Windows, dans le répertoire GNU Radio, GNU Radio companion (radioconda) and one can run from the Windows Start Menu, in the GNU Radio directory, GNU Radio companion (radioconda)

hsberger commented 2 years ago

Stephen,

The people working on this on the NIST side are Vu Le and John Ladbury. Both are cc'ed on this email.

In our case, we ran into issues with Radioconda and went a different route, but we're still struggling verifying the basic functionality of a basic communications system (source - modulator - channel - demodulator - sink).

We'd be happy to chat with you and Ryan about the issues we ran into and our thoughts on a guide for getting started in GNUradio.

-Jason

From: @. @.> Sent: Tuesday, February 15, 2022 9:07 AM To: 'ryanvolz/radioconda' @.>; 'ryanvolz/radioconda' @.>; Coder, Jason B. (Fed) @.> Cc: 'Author' @.> Subject: Improved Installation Instructions for RadioConda

Yesterday I found the attached installation instructions for RadioConda from someone in the Groupe swissATV. I like these a great deal. They are step-by-step instructions with lots of screenshots. Unfortunately it is in French, but I ran translations and put those, along with the URL, in the attached TXT file.

My thought is that an English translation of these instructions does most of what is needed. I am sure all of us will have suggestions for further improving these instructions. I have a couple of suggestions but overall I like what is done here.

Best Regards, Stephen Berger TEM Consulting, LP Web Site - www.temconsulting.comhttps://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.temconsulting.com%2F&data=04%7C01%7Cjason.coder%40nist.gov%7Cabbfceed65c349e539d508d9f09d7073%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637805381324124973%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=fCc0SHxuj8VxF09as0h4RjyJQ7%2FX%2F4kCxwdlpja0Uvs%3D&reserved=0 E-MAIL - @.**@.> Phone - (512) 864-3365<tel:(512)%20864-3365> Mobile - (512) 466-0833<tel:(512)%20466-0833> FAX - (512) 869-8709<tel:(512)%20869-8709>

From: Ryan Volz @.**@.>> Sent: Saturday, February 12, 2022 2:33 PM To: ryanvolz/radioconda @.**@.>> Cc: hsberger @.**@.>>; Author @.**@.>> Subject: Re: [ryanvolz/radioconda] HackRF not found by Soapy HackRF Sink or Osmocom Sink (Issue #9)

Yes, I agree that improving the documentation will help. There is some mention of activation in the README, but clearly it's not prominent enough. What docs did you read (the README here, GNU Radio wiki, etc.)? How far did you get before your eyes glazed over with too much information? Where would it be helpful to mention activation so that you would have caught it?

I would hope most users would avoid this specific problem because they get a Start Menu icon and just use that, and I don't know why the installation failed to do that for you. But that's a mystery that I doubt we'll be able to figure out.

- Reply to this email directly, view it on GitHubhttps://github.com/ryanvolz/radioconda/issues/9#issuecomment-1037458336, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALWU43NPHL3QH3NS2H37W2DU227YTANCNFSM5OEV7PAA. Triage notifications on the go with GitHub Mobile for iOShttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fapps.apple.com%2Fapp%2Fapple-store%2Fid1477376905%3Fct%3Dnotification-email%26mt%3D8%26pt%3D524675&data=04%7C01%7Cjason.coder%40nist.gov%7Cabbfceed65c349e539d508d9f09d7073%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637805381324124973%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=gawAYTs11wLzh%2BuQGKqj7F%2FkDu%2BN2eDRWotTmd3pRwM%3D&reserved=0 or Androidhttps://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fplay.google.com%2Fstore%2Fapps%2Fdetails%3Fid%3Dcom.github.android%26referrer%3Dutm_campaign%253Dnotification-email%2526utm_medium%253Demail%2526utm_source%253Dgithub&data=04%7C01%7Cjason.coder%40nist.gov%7Cabbfceed65c349e539d508d9f09d7073%7C2ab5d82fd8fa4797a93e054655c61dec%7C1%7C0%7C637805381324124973%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=VVqLuHpK9IFYbQ9Dtt5ApWMvRNk8RU15eRDG3HJ9%2FCk%3D&reserved=0. You are receiving this because you authored the thread.Message ID: @.**@.>>