Friday, January 8, 2016

"Software defined radio" is more about "software" than "radio"

I've been looking for some way to learn more about software-defined radio (SDR). After a bit of perusing around, I decided to purchase a HackRF One from Sparkfun. It's $300, but that's far less expensive than many other systems, which run into thousands of $. I ordered it just before Christmas, and it arrived a few days after the New Year. I've had it for just less than a week. Here's what I've learned thus far about the HackRF One:
  1. It will most likely not "just work". I first connected it up to my primary computer, a 64-bit Intel quad core running Linux Mint 17. I thought I'd try just some of the basic stuff first. The first thing they suggest is to try the "hackrf_info" command to make sure the USB connection is working. I was able to install the "hackrf" toolkit with no problem (sudo apt-get install hackrf). But every time, the output of the command stated, "hackrf_open() failed: HACKRF_ERROR_NOT_FOUND (-5)". Forget trying out any radio stuff. The box isn't even talking to the computer yet. I then tried it on another computer, also running Linux Mint 17. Same thing. And again with yet another computer running Ubuntu 14.04.03. Same as the others. According to one of the HackRF wiki pages, the suggested fix is to first check that you're running the latest version of "libhackrf" and "hackrf-tools". It would have been nice that they provided information on how to check what version of these programs are currently loaded. You can't just run a "libhackrf --version" command in the terminal and POOF! know the version. It doesn't work that way. The next thing is to try running the command "hackrf_info" as root, which means using "sudo hackrf_info". Guess what? That didn't work, either. No worries, because there are other things to try.
  2. "Software defined radio" is more about "software" and less about "radio". The next thing to try is to use the "LiveCD" option. This means using a thumb drive loaded with the provided Pentoo operating system as recommended on the "Getting Started" page. I was able to load the OS onto a thumb drive (a fairly new 4 GB one), then put it into an older Compaq Presario C500 laptop. It booted up fine, and I was able to run the "hackrf_info" command. It gave me a proper response, telling me the firmware version of my unit. Turns out the firmware is 2014.08.01. Considering that the current version (as of this writing) is 2015.07.02, it's a bit out of date. The "Getting Started" page also provides a link to the site to update the firmware. Which leads to the next problem. Where's the file to flash the memory of the HackRF One? The website says to either download it or create it from source. This leads me to a digression. I should have realized that "software defined radio" was going to be more about "software" and less about "radio". I'm a radio engineer by training. I can do, um, okay with basic computer stuff. I'm not a heavy programmer by any stretch. The thought that I would be able to get this device, hook it up, and start programming filters and signals now seems rather naive. The point of this digression is that the "LiveCD" isn't working with my Ethernet connection. This is a first. The one thing I've always been able to count upon with Linux was that it would work with any Ethernet connection with which it was presented. Not so here. This "Pentoo" OS sees my Ethernet connection, but there's an error message stating, "NetworkManager is not running..." In order to get the latest binary, I have to manually load it to my primary computer, store it to a thumb drive, then cross-load it to the laptop running Pentoo.
  3. Most programmers are terrible at writing human interfaces. I already know that the HackRF One is built on a lot of Python programming. I see a lot of people exalting how wonderful Python is, how "powerful" it is, how "easy" it is. The last time I actually had something that was both powerful and easy was a Halmatro tool known colloquially as the "Jaws of Life". Python is arcane, it's command structure is far from intuitive, and the whole concept of "object oriented" programming is even less intuitive. I'm not saying Python doesn't work. It does. I can see that. But trying to figure out how to make it work requires forgetting pretty much everything I've learned about programming before this, except for using a QWERTY keyboard. Getting back to my problem at hand, I was finally able to load the latest firmware onto the HackRF One. It's now running firmware 2015.07.02. Does that mean it will now work with a regular Linux box? Nope. Now I'm getting the error, "hackrf_open() failed: HACKRF_ERROR_LIBUSB (-1000)". You know what that means? It turns out that it's a "write permission error" with respect to the USB drivers. And that means I now have to delve into the whole concept of "udev" rules. What are those? Again, no fucking idea. I've already read a few things. I'm already concerned because one of the primary sites many people point to talks about how "udev rules are flexible". Great. In common parlance, it means the rules and syntax will be arcane and extremely difficult to understand for all but the most patient people. But I guess I'm going to have to learn. As I stated before, "software defined radio" is more about "software" than "radio".

No comments:

Post a Comment