hackrf icon indicating copy to clipboard operation
hackrf copied to clipboard

Using the hackrf on a conda environment

Open NicolasCaseau opened this issue 4 years ago • 17 comments

Hello,

I'm trying to use the hackrf on a conda environnement, I installed gr-osmosdr but I still need the Library libhackrf to be able to use the card. Do you know if I can install this Library using conda ? Or could you tell me if there is another way ?

Thanks and have a good day :)

Nicolas

NicolasCaseau avatar Apr 09 '21 08:04 NicolasCaseau

I am in the same situation. My conda install on Windows 10 is not recognizing the HackRF. When I install on Windows from the binaries, it recognizes it. But I need to run from a conda environment. Update - Funcube Pro is not recognized either

PureRockets avatar Apr 30 '21 04:04 PureRockets

Sorry I haven't responded to this issue in a timely manner. I'm not familiar with Conda, so I'm going to try to follow along with your experience and get HackRF to work in this environment. Can you send me your steps to install Conda, what OS you tried to install Conda on, and any other relevant details?

straithe avatar Oct 29 '21 19:10 straithe

straithe, you can install anaconda from the official site https://www.anaconda.com/products/individual As far as I understand there are guys on conda-forge channel who maintain gnuradio and some additional blocks, including osmosdr. Unfortunately it is built without hackrf support. But with support of soapy. I believe to support hackrf it's necessary to make recipes for libhackrf and soapy hackrf module. All dependencies for libhackrf are already on conda-forge. I've tried to build it and succied, even thouth few patches for cmake files are needed. I believe all dependencies to build soapy module are also there (except libhackrf). But I have no experience with soapy though and not sure about it.

denis-sp avatar Nov 12 '21 02:11 denis-sp

What conda-forge channel are you talking about, @denis-sp? I don't have reference for where this channel would be. I'd really like to check it out. I also don't have any experience with soapy either, so I'll get to learn lots of things trying to work this out. Thank you!

straithe avatar Nov 12 '21 02:11 straithe

Anaconda has a channel system. Channels are kind of repositories. You can install packages from there. Conda-forge is the biggest repository with unofficial packages. https://anaconda.org/conda-forge

denis-sp avatar Nov 12 '21 02:11 denis-sp

@straithe https://github.com/denis-sp/conda-hackrf-recipe Here is a recipe I made.. I'm not sure if everything as it should be, but it seems working for me. It's for Windows only though.

denis-sp avatar Nov 14 '21 19:11 denis-sp

Thank you for the update! I won't have access to my Windows computer for a few weeks. The soonest I will be able to try this out is early December. For now I am going to tag this as help wanted so members from the community might see and step in to help out.

straithe avatar Nov 14 '21 19:11 straithe

@straithe I've changed a bit previous recipe and made a recipe for hackrf soapy module https://github.com/denis-sp/conda-soapysdr-module-hackrf It seems working. But for some reason I have narrow band there. gr-hackrf .

denis-sp avatar Nov 14 '21 23:11 denis-sp

There is a bandwidth option there. I haven't try anything real yet, but I believe it works fine.

denis-sp avatar Nov 15 '21 00:11 denis-sp

@NicolasCaseau, I believe the recipe provided by @denis-sp solves your issue. Can you please try this solution and confirm?

straithe avatar Nov 16 '21 21:11 straithe

Related: https://ham.stackexchange.com/questions/20359/the-transmission-and-reception-block-for-the-hackrf-does-not-work-windows-11/20365#20365

I'd honestly love to see both the hackrf as well as the soapysdr-module-hackrf package of @denis-sp being extended to more than just windows (that's mostly copying bld.bat to build.sh, and replacing a few %variables% with ${variable}, far as I can see), and to become part of conda-forge (which is mostly a short PR against a single repo).

Doing that would make the hackRF accessible through the gr-soapy blocks that are available by default in modern conda-based installations of GNU Radio (and conda is by now probably the most popular way to get GNU Radio on Windows, but certainly not the only one; the GNU Radio wiki recommends it for Windows to get current versions, thanks to @ryanvolz' extensive work on conda packaging).

marcusmueller avatar Jan 02 '22 13:01 marcusmueller

I'm happy to help get these packages on conda-forge, and add Linux + macOS support. With the existing Windows recipes it should be straightforward. It's been on my to-do list for a while, but I don't personally have a hackrf to test with so I didn't want to try to support something without at least some willing testers. Seems like they've been here all along!

ryanvolz avatar Jan 02 '22 16:01 ryanvolz

I'd be happy to test things out on Linux (specifically Ubuntu), @ryanvolz! Let me know how I can help.

straithe avatar Jan 02 '22 19:01 straithe

Hey all, I haven't forgotten about this. I've got a pull request in to add hackrf packages to conda-forge here, and I have the soapy module package almost ready to go once that one is merged. I'll ping this issue again when things are ready to get some testing.

ryanvolz avatar Jan 14 '22 19:01 ryanvolz

Thanks for the update!

straithe avatar Jan 14 '22 19:01 straithe

The packages are now on conda-forge!

For testing, I'm partial to the CondaInstall guide I wrote on GNU Radio's wiki, but the key part is to install a base conda distribution like Miniforge and then you'll be able to install hackrf and soapysdr-module-hackrf from the conda-forge channel.

Let me know if you find any problems with the packages. I plan on adding them to my Radioconda installer soon, so it would be good to head off any problems before I do that.

ryanvolz avatar Jan 31 '22 20:01 ryanvolz

Thank you for the update! @NicolasCaseau would you be interested in helping test?

straithe avatar Jan 31 '22 20:01 straithe

Hi @straithe, I am using GNU Radio under conda environment on my Windows machine. After I have installed miniforge, I created an environment and installed GNU Radio and soapysdr-module-hackrf package into my environment as @ryanvolz's conda install guide. Then I was able to use my HackRF within GNU Radio Companion successfully.
HackRFTx

murat-sever avatar Oct 30 '22 19:10 murat-sever

That's fantastic to hear! Thank you for the review @murat-sever. And thank you for your work @ryanvolz. I'm closing this issue as completed. 🎉

straithe avatar Nov 01 '22 17:11 straithe