Hacker News new | past | comments | ask | show | jobs | submit login
BladeRF-wiphy: Open-source, software defined radio modem (nuand.com)
292 points by nuand on Jan 17, 2021 | hide | past | favorite | 55 comments



Impressive project. Writing all the VHDL including the FFT and Viterbi decoder... I'm genuinely curious where the ROI on a project like comes from? Selling hardware and training materials? I'm assuming there must have been significant interest from customers, or maybe this is an ambitious employees side project?

Can't wait to see a demo or some pictures of it running.

Would love to see more details about the DSSS demod using the 20MHz rate, specifically regarding the correlation. Any references on this?

(I'm a happy owner of the x115, been looking at the 2.0 for awhile now)


Oddly enough, some folks like doing this because of the dopamine hit of really understanding how something works. FWIW I'm that kind of person :-). But I certainly understand it isn't for everyone.

The platform I've been using to explore stuff like this is an Ultra96 board with a LimeSDR as the receiver. The Ultra96 has the Zynq Ultrascale FPGA on it. Given that USB3 latency is < 10 uSec I am guessing (hoping?) I can implement it in the Ultrascale fabric which is fed IQ data from the USB 3.1 port.


Heh I’m that kind of person too. All my free time is spend building things!


Yup, I love that feeling, I'm currently working on a software 3d renderer, I've always understood in principle how they work, but getting to actually implement one is really fun.


Afaik USB3 latency is same as USB2, uSOFs every 125us, lowest round trip 2*125us


For DSSS demod, my guess is a 20 tap match filter designed from a resampled RRC filtered barker sequence. Haven’t looked at the VHDL, but that’s how I’d do it.


Speaking of radios, I’ve been trying to understand light recently and it’s difficult. I find that for most things, I have a visual intuitive model to reason about things. But I have a hard time visualizing RF light. There aren’t any good videos out there of just a straight forward visualization of RF light. It’s all abstractions with a sine wave, but no visceral visualizations, rendered or otherwise. The closest thing I’ve found is thought emporium visualizing wifi.

And also, why can visible light pass through other visible light without causing interference? Why can’t they make visible light with an antenna? Why are large arrays of RF receivers not more widely used for small-scale RF imaging?


> Why can’t they make visible light with an antenna?

You can. The antennae are the size of molecules. LEDs emit light, your retinas receive them. The retinal dye molecules are tuned for specific frequencies just like you'd tune a macroscopic antenna.


Richard Feynman has a short book on Quantum electrodynamics for dummys. Otherwise known as QED: The Strange Theory of Light and Matter. Read that as many times as you need to break you of any preconceived notions about how light works.

As for sin waves etc. It's better think of light oscillation between it's energy as an electric field and a magnetic field at right angles to each other. Although I think that's kinda gross and wrong.

As for an antenna producing visible light, in theory there isn't any reason. Because radio waves are light. The problem is practicalities.


> But I have a hard time visualizing RF light.

The best things I can recommend is to play with GnuRadio, IQ data, false color representation of a freq or set of frequencies bound to color/decibel strength, and ParaView and importing said IQ data for graphing.

Think of the frequency of light as its color, and dB strength of how bright it is. However at cm and m wavelengths, voids happen much more regularly. That light can 'bend' around, and go through objects.

> There aren’t any good videos out there of just a straight forward visualization of RF light.

There's quite a few false color images. If you look at hydrogen line radioastrometry, there's a ton of false color images. There's also this HackADay that mapped wifi for a wide area covered by their CNC gantry https://hackaday.com/2015/02/17/mapping-wifi-signals-in-3-di...

> And also, why can visible light pass through other visible light without causing interference?

EM primarily only directly affect things with an electric charge. EM radiation itself doesn't have an electric charge, therefore EM usually doesn't affect other EM. However, if we include gamma (+10^19 Hz), then if those collide, they can create an electron and a positron. But that's only theorized with energy vector diagrams and not actually seen.

> Why can’t they make visible light with an antenna?

You can... You just have to pump enough energy in it to make it glow! /hahaha

> Why are large arrays of RF receivers not more widely used for small-scale RF imaging?

That's primarily a cost issue. Go look how much a single RF frontend chip and an a/d chip costs. (Price gets to stupid levels at, say 24 bit A/D).

Now instead, lets look at human vision. Humans can see (eyes are receptors of radio from 380nM to 720nM). When converted to Hz, we're talking 372.55 THz wide spectrum vision.

My SDR on the table can see 112 MHz, or .0000112 THz

Now, in order to replicate what's going on in the eye, you'd need millions of antennas AND data acquisition (of some sort). And then, even with current SDRs, these generate 60GB/min - you need the disk, memory, and CPU to do stuff with that. It's NOT a trivial problem.

Now there are some RF arrays out there. KerberosSDR is one such array. However, its max bandwidth is 3 MHz @ 8 bit. And it can only do 4 inputs, which is enough to do geographical tracking of radio signals (within 24MHz to 1.7GHz). I know of one person who's trying to do some VR work with a KerberosSDR.

The other problem, once you have the millions of antennas and data acquisition, is a matter of synchronization. Timing is also another stupidly hard area, which increases geometrically with more sensors. And remember that 1nS = 11.8 inches deviation.. So whatever processing you're doing had better be time consistent and local to the device.

Eventually, we'll get to what you're proposing. A lot of us are wanting that. But we're decades away.


> Why can’t they make visible light with an antenna?

Why can't an oscillator and antenna emit matter? Is some matter transparent to other matter in the same way that some matter is transparent to light? This idea that matter and energy are equivalent and that the same wave physics underlies it all doesn't seem to be true in reality. Instead it seems that phenomena are divided into regimes and in each regime behavior is very different. Sure it's tough to build an oscillator at the frequency of matter, but is it really impossible to build a matter emitter? I only have a BA in physics but I remember while learning (and in later reviews of physics) that it seems like theory doesn't always scale and there are a lot of very weird assumptions and "explanations".


You can (for the most part) produce bosons (e.g. photons, aka light), individually or in big piles, out of thin air. You cannot produce fermions (e.g. electrons, protons, neutrons) out of thin air like this. To make an electron, you need to also produce a positron or do something else that satisfies the various conservation laws. You can make an electron-positron pair in a collider, but doing this in large amounts takes absurd amounts of energy.


> And also, why can visible light pass through other visible light without causing interference?

Radio passing through radio doesn't interfere with thr signal. Its just more likely that the interfering signal will also be picked up by a receiver.

Think about a bright white lighbulb next to a small red LED; you won't be able to see the small LED.

The other part is that out eyes are essentially 2d grids that are fairly large in both directions with respect to thr wavelength of light. Radio receivers are essentially a single point.

We can also bend and focus light with lenses fairly easily with many different substances, due to the refraction index of the material.

If you move the red LED away, you will be able to see it more easily. This is because we can focus the light onto more than just a point receiver so that the the bright light doesn't entirely overwhelm all the sensors. If you do photography, you know that overexposure is problematic and can cause areas around bright areas to be overexposed as well.

While we cant use glass to bend radio waves, they can be be bent in the same way as visible light. Ham radio operators do this all the time by using the ionosphere to bounce radio off of to make long distance contacts that are beyond normal line-of-sight.

Radio and visible waves are also subject to gravitational lensing.

They are also both subject to diffraction, where the light will bend slightly around the endge of an object. Ham radio operators also make use of this to make contacts near the edge of obstructions, like mountains.

Visible light can be used in fiber-optic cables, and waveguides are a similar device used for microwave-frequency light.

> Why can’t they make visible light with an antenna?

In terms of normal radio antenna designs, you could, I think, but antennas need to be sized proportional to the wave length of the light.

However, since visible light is higher energy than radio light, and near many of the transition energy found in atoms, we make extensive use of that additional energy when detecting (e.g. photoreceptors in our eyes and photodiodes), emitting (e.g. LEDs and incadescence), and using (e.g. photo etching and film photography) visible light.

> Why are large arrays of RF receivers not more widely used for small-scale RF imaging?

You can only image something down to a resolution of the wavelength used.

You do see some applications of this, viz millimeter wave imaging at airports.

I can't find the link, but a week or some ago, there was an article on hackernews about radio imaging of cities from satellites? If I find it I'll edit it in. Resolution on the order of meters is adequate for that purpose. (For reference: WiFi is roughly 12½cm. Fm radio stations are roughly 3m. Am radio is roughly 300m.)

Also, this is a limitation of visible light microscopes as well. We can't imagine, say, molecules, because theyre smaller than the wavelengths of visible light.

----

One of the biggest difference between visible light and radio light when it comes to thinking about propogation is what absorbs it. Your WiFi router can be on the otherside of a wooden wall because wood doesn't absorb or reflect substantial amounts of rf energy; a metal wall does. 5ghz doesn't propogate as well as 2.4 because it's absorbed by water in the air and things more than 2.4ghz is. Visible light is absorbed by most things some amount.

So, the big differences are how the physical world affects the light, but in broad strokes it behaves the same way to the same situations, its just that those situations (e.g. what can reflect, refract, diffract, and absorb it) are frequency/wavelength dependent.


>> Why can’t they make visible light with an antenna? > In terms of normal radio antenna designs, you could, I think, but antennas need to be sized proportional to the wave length of the light.

There is also one more difference to mention. For antenna design in radio frequencies the metals are taken as perfect conductors—meaning that the fields inside the metal are zero. This assumption relies on the fact that electrons in the metal respond the electric field basically instantaneously. However, the optical frequencies are significantly higher, so the movement of the electron cloud in the metal is no longer instantaneous relative to the outside fields. As a result metals at frequencies of visible light are way less "metal-like" when looking from the perspective of RF antenna design, so you can't directly use the exact same approaches for designing antennas.


Thanks for that explanation. This radio stuff is heavy duty!


I remember the hate that closed-source Winmodem got back in the 90s but software-defined modems can be far superior to hardware. Case in point: direwolf. I think it decodes APRS better than any hardware solution.

https://github.com/wb2osz/direwolf


If you like direwolf you might want to take a peek at the M17 project[1]. They're looking to do the same thing with what's happened with proprietary radio protocols and looks really promising:

> M17 is a new digital radio protocol in development as an alternative to those currently available, with freedom in mind. Freedom in the code, protocol, voice codecs, and hardware. The goal is to provide a better option for digital radios in the future.

[1] https://m17project.org/


Veeery impressive! Side note: By pure coincidence I spent 5-6 hours this weekend playing around with an sdr dongle and a raspberry pi (specifically sending images over fm). And I have to say, the ecosystem around sdr's is annoyingly poor on linux(unsure about other os-es but it does seem windows has it better).


I feel like it's easier to toy around on Windows, but if you want to do anything (and I mean anything) serious, you'll need Linux. That's been my experience anyway.


In my experience, most of the signal decoders are Windows only (WXtoIMG to decode NOAA satellite images and DSD+ to decode digital walkie talkie signals comes to mind) but for actual real time RF DSP work, most of it is done in GNU Radio, and its practically Linux only even if it can be installed on Windows. And we haven't talked about transmit yet


> WXtoIMG

Haven’t used it but found this from doing a web search https://wxtoimgrestored.xyz/downloads/ which is available for not just Windows but also Linux and some older versions of MacOS X. It’s not open source and it’s not being updated but it might be worth checking out?


Hey lazy question, so if you buy this and program it is it already FCC / CE certified for say 802.11a? And could you sell it like how companies sell RPis pre-packaged up with some software?


This is a guess, but it is a good one: no. It may not even be possible to get it certified (wrong interpretation of the law to me, but the government has more lawyers than anybody else). Many SDR boards don't have the power required to do actual transmission as it is hard to design a front end that pleases everyone, but equally as important, any real transmit power could mean the device is construed as non test equipment.

Why do you care? Just buy it and flash the bitstream to it, no one will ever find out.


Military and Police branches were one of the first big buyers of SDR products (ettus sold tens to hundreds of million of the stuff solely to those two). How do they handle certifications? Are they exempt?


It would matter to anyone who might want to build it in to a product.


This would be a horrible way to make a product which isn't a piece of test equipment. The power consumption and manufacturing cost is orders of magnitude higher than a specific purpose device.


I maintain that the original question was valid and it’s up to the product designer to determine whether the trade offs are worth it. I mentioned it because I am designing a farming robot where a very reliable Wifi device might be worth the cost and power consumption. I don’t know if this product is “very reliable” but lots of Wifi isn’t. I’m already considering that exact software defined radio for our robot so it could actually represent cost savings if it replaced the Wifi adapter.

Moreover I disliked the tone of the reply “why would you need to know the answer to your question, just do it and no one will notice.” It was a perfectly fine question to ask and I find it unreasonable to suggest it wasn’t worth asking without getting more information from the person asking it.


Sorry, I didn't mean to offend.

Making a wifi adapter out of a software defined radio is going to be a less than ideal way to enable wifi to a product. The power consumption will be tremendously higher than a dedicated device. The cost for the electronics will be tremendously higher than a dedicated device. The cost to get an SDR which transmits certified for sale as a wifi device in every country you wish to sell it in will be expensive, especially compared to a dedicated wifi dongle which already has modular certifications.

Based on my experience, expect to pay upwards of $5k for an FCC compliance test report from a lab for a not intentionally emitting device which incorporates a certified wifi module. Expect to pay upwards of $25k for an FCC compliance test report for a device which is an intentional emitter (ie: you put an SDR inside your product as a wifi radio). If you want to sell outside of the USA, the ratio of costs is (in my experience) fairly similar for many other countries/regions of the world.

If you feel that you cannot find a reliable off the shelf pre-certified wifi module for your product, I think you would be best served to contact some lower volume wifi module vendors and to speak with them about why you feel their offerings are not reliable. They will likely be happy to help you, especially if they're competing with a multi-hundred dollar SDR for the design win.


I did give you a reasonable answer to your reasonable question: no. But this device is pretty much going to not be reliable by definition.

As for getting more complicated, and "can you in general build an SDR into an end product" it's my understanding this is not a settled question. I don't see why not, but the FCC can more or less make laws and has previously shown it does not like the fact that you can put OpenWRT on your router.


Curious if anyone will use this to more capably fuzz the 802.11 stack in commodity equipment.



Nice one Nuand, the BladeRF v2 looks like a very interesting alternative SDR modem to the cheaper Adalm Pluto educational kit by Analog Devices, the manufacturer of the transceiver chip being used by the BladeRF v2.

There is another alternative open source WiFi stack, openwifi and it has been discussed in HN before [2][3].

[1]https://www.analog.com/en/design-center/evaluation-hardware-...

[2 ]https://github.com/open-sdr/openwifi

[3]https://news.ycombinator.com/item?id=24273919


Related projects:

- https://github.com/bastibl/gr-ieee802-11 (gnuradio transceiver by the amazing Bastian Bloessl)

- https://github.com/open-sdr/openwifi (efforts to make a low-cost SDR Wi-Fi transceiver)

From my point of view, cool projects, all the hardware I have access to is closed source and sometimes I really wish I could just change some low level parameters in my Wi-Fi cards.


But are you willing to part with $720 to play with it?


Weirdly they keep saying 802.11 but apparently it's 802.11a/g.


It is somewhat natural to just refer to 802.X standards as 802.X when implementing them as that is the correct name of the standard and you need to read most of it in order to implement it. If you want to talk about distinct added features it makes sense to use the name of TG (ie. 802.[number][letter]) that drafted the specification of said feature, but it is mostly only an handy shorthand.


congratulations to the team for the hard work and dedication to taking one step closer to a truly open source ap.

but BladeRF is pushing...a thousand dollars...too rich for most :(


https://www.nuand.com/product/bladerf-xa4/ $480 for the smallest.

And while too rich for most is one way to look at it, another is that $1K would not even buy you a proper monitor all that long ago, and that this is a very low volume production. I think the price point is actually quite impressive, I expected it to cost substantially more, especially given the BOM, there are some pretty impressive bits on there, and those connectors and PCB are also not exactly free.


I do not think wiphy runs on the xA4 because the FPGA is not powerful enough. So if you want to run this project, you'll need to shell out at least $720 for the xA9. I probably will.


My very limited knowledge of SDR’s from when I was researching a project is that for a lot of use cases, the cheap ones just don’t have the bandwidth or frequency range. I ended up getting a limesdr which was enough to serve my needs, but it was still around $400 for the usb version.


This is one of the best single-page descriptions of wifi implementation at the packet and Linux kernel level I've ever seen. Very good.


Wow, this looks like a very powerful tool. Always wondered what a fully open wifi stack would look like


Nice. There goes another 3 weeks of my life :-).


What app are they using for the amplitude-v-time plots?



How is it that an SDR is being praised for a $1K price-point, but I can buy an FM/AM radio for single-digit $ - yet I pay $1,000 for a cell phone today and it doesnt have a native FM/AM radio on it?

People keep saying "just use data" - which is what I think to be a fn bullshit response. give me a device that has actual FM/AM capabilities natively.

Seriously - the most high-tech wireless device in my pocket MUST include the *least* complex wifi capabilities which is over 100 years old by *DEFAULT*

Assume you are out if signal range - there are FEW places out of FM/AM range...


While receiving analog radio is trivial for the processing required, it is fairly low frequency transmission which requires antenna sizes which are not entirely practical for phone-like device. I would even assume that many phones contain the required hardware (which usually involve using headset cable as antenna) but don't have any kind of software support for it because of combination of minimal demand for such a feature and the fact that the entire experience is not exactly user friendly. Notably, Raspberry Pi uses wifi/BT radio which apparently either includes FM radio or used to in previous revisions (and apparently the radio chip is capable of receiving FM and directly sending the audio to BT headset, which is somewhat interesting feature given the usual requirement of wired headset as antenna).


I think the main reason that phones don't have broadcast AM and FM enabled (even though the hardware is present in the chips), is because the digital chips in the phone (micro-processor etc) would generate so much interference (at these relatively low frequencies) that it would be unworkable. To sufficiently shield the main PCB would require a huge effort, which means weight, size and cost.

To get an idea, you only need to hold your AM/FM radio near your PC or Laptop.


FM radio works pretty well on a lot of smartphones.


An antenna perhaps as long as a pair of headphone wires?


I figured it would come down to antennas.... but I am still disappointed...


AM/FM is really up to the handset manufacturer, some phones have the hardware turned off by the manufacturer.


A number of phones, including my Samsung Galaxy S10e, have the built-in FM radio enabled. It needs to have a earphone plugged in, which it uses as the antenna. The app is NextRadio.


I had a very cheap Android phone for a while that had this. Unfortunately, later flagship phones I got seemingly did not.


Dope - is there any IOS equiv app? (or is this avail om IOS?)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: