start	end	text
0	3440	A little late. Technical difficulties and all that.
4140	8480	HackRF, you guys hopefully have seen a little bit of.
8480	13060	And if you haven't seen the fancy new enclosure,
13060	15080	here's one.
16160	20200	So, you know, there it is. And there are a few people around here
20200	24300	who have some. And if you back HackRF on Kickstarter,
24300	26740	it's in the mail to you already.
26740	31900	And there's one that people can win. Wireless CTF, right?
33420	35360	Wireless CTF, HackRF.
35360	37100	Somebody can win one, right?
37100	40420	Yeah, do that.
43840	47620	So go out, go forth and win a HackRF.
47840	51420	So this is SDR Tricks with HackRF. I've given this talk once before
51420	54300	at Recon. It's just a short talk.
54300	58460	And the second half of the hour is going to be Jared Boone talking about
58460	61300	the HackRF Portapak, which is super cool.
62500	65320	It was Tau Day at the time that
67240	70620	I gave this talk at Recon. You know, June 28th.
70620	74440	Everybody should know the number Tau. 6.2831853, etc.
74440	78320	Right? Woo! Yeah, old school people
78320	82900	call it 2 Pi. But Tau is the new hotness. Pi is old and busted.
82900	86780	So I actually received for the first time in my life
86960	90680	a happy Tau Day card from Dominic here.
91580	95820	So that was pretty awesome.
97460	99020	So this is
99020	102640	HackRF1 without the swank case.
103060	106820	It's an SDR peripheral that operates from 10 megahertz
106820	110840	to 6 gigahertz officially. Unofficially is
110840	114640	part of what I'm going to talk about today. 20 megahertz bandwidth
116580	118920	and that's a function of the
118920	122980	20 mega sample per second ADC. And it's a half
122980	127080	duplex software defined radio transceiver. It can transmit and receive
127080	130860	but it can't do both at the same time. And so I'm talking about kind of
130860	134920	the top level capabilities. Like the high level
134920	139120	overview of what the capabilities are. And in this talk I'm going to talk primarily about
139120	142480	getting around these capabilities in various ways.
143220	146880	Sorry, getting around the limitations of these capabilities
146880	150960	in various ways. So just a little bit of an overview
150960	155020	of the hardware design so you can understand what I'm talking about. The architecture
155020	158460	of HackRF. At the antenna on the left
159860	163020	we have signals that are in the range of
163020	167140	10 megahertz to 6 gigahertz. Actually this slide is really old. Back when we thought
167140	171020	we would only go down to 100 megahertz. But we keep lowering
171020	174720	that lower spec. And
174720	179240	there's a wideband front end that has a mixer in it that converts the frequency
179240	183300	so it shifts the frequency from anywhere in that range
183300	186940	that wide range into the intermediate
186940	191540	frequency range which is the 2.3 to 2.7 gigahertz
191540	195540	actually now it's about 2.15 to 2.75
195540	199440	gigahertz. But it's right in that 2 gigahertz band
199440	203000	right around 2.5 gigahertz we have an intermediate frequency
203180	207280	and then there's an intermediate frequency transceiver that converts
207280	211340	between the intermediate frequency and baseband
211340	215060	where baseband is the vicinity of 0 hertz. So
215060	219680	we have dual conversion. We convert the frequency once
219680	223780	between RF and IF and then we convert the frequency
224200	227180	a second time between IF and baseband
227620	231720	and then we have an analog to digital converter and everything is digital from there
231720	235940	on out. On the transmit side it's the exact
235940	239800	reverse. Same thing we go digital to
239800	243680	analog baseband around 0 hertz and then it gets converted
243680	247300	to the intermediate frequency and then it gets converted to the RF
247300	251940	which is at whatever you configure it to between 10 megahertz
251940	256080	and 6 gigahertz. So now that you're a little bit familiar with the architecture
257720	259740	the first thing I want to show you
259740	264100	is tapping into the baseband directly. Tapping
264100	268020	into the analog baseband signals. So going back
268020	272080	here what we're doing is bypassing all this radio
272080	275940	stuff and just talking to the
275940	280220	ADC or DAC on this analog baseband connection
280220	284380	directly. So we put a header there. HackRF Jawbreaker
284380	288320	if you have one of the beta units didn't have this little
288320	292080	baseband header but HackRF1 we thought
292080	296140	well it would be nice to add some expansion capabilities
296140	300260	and this is one cool way to do that. So in
300260	303940	this example I'm just plugging in two wires
303940	308300	into the analog to digital converter so that
308300	312520	I can use the HackRF to directly sample some external
312520	316560	electrical signal. And for example I might use something
318520	320300	well I might use something
320300	324260	like a Hot Wheels radar gun. Which is one of my favorite
324260	327540	toys. The Hot Wheels radar gun has
329400	332180	multiple components in it and if you buy one from eBay
332180	336360	it might be broken. But most likely the part that's broken is
336360	340420	that board you see there with the two red controls
340420	343220	on it. It's the control board and LCD
343860	348460	and that's completely separate from the actual radio part. The actual radar
348460	352340	that's within the Hot Wheels radar gun. So if you
352340	355980	want to just use this thing for your own project
355980	360200	you just rip that part off and connect it directly to the radar
360200	364360	with these three leads. All you have to do is get a power supply and you get an analog
364360	368340	baseband radar return signal that you can plug into your oscilloscope
368340	371460	or you can plug it into your HackRF.
371640	376220	And what we get is two channels. We have two ADCs
376940	379700	and each one is a differential
380360	383920	signaling with one volt peak to peak and the
383920	388620	common mode voltage needs to be like around the middle of
388620	392260	the supply voltage. So it's around 1.5 volts
392260	396100	and there's no anti-aliasing filter on there so you have to kind of provide
396100	400240	that on your own if you want. So it's a little bit tricky to interface
400240	404260	with if you don't have much experience with electronics. It's not as easy
404260	408420	to use as say an oscilloscope. But in this particular example
408420	412140	I was able to directly plug in
412140	416080	the Hot Wheels radar gun with nothing other than
416080	420240	just some wire going from the radar gun to the
420240	424280	HackRF baseband header. And I was able
424280	428120	to just like wave my hand around in front of the Hot Wheels
428120	431500	radar gun and I could see like in canoe radio
432500	435540	exactly what I expected to see and
435540	439400	I could measure distances or I could measure speed
440090	444330	very easily. In addition, there's a
444760	447960	direct to digital to analog converter so you could
447960	451960	use the HackRF kind of as a
453820	456040	general purpose function generator
456580	461460	similar to how you could use it as a general purpose oscilloscope.
461460	464520	It's again a little bit tricky to interface with
464520	468840	because it's differential signaling and it puts out a maximum
468840	473020	of about 800 millivolts peak to peak. And again there's no anti-aliasing
473020	476080	filter so you would need to provide that yourself if you were going to design
476240	479620	a circuit to connect to this. In the future
479620	484180	it would be really cool to have, and I kind of started working
484180	488160	on this but it's a ways off probably, it would be really cool
488160	492040	to have a little add-on board for HackRF
492040	496420	that kind of takes care of some of these details for you, adds the filtering
496420	499320	adds like a differential amplifier
500140	504320	so that you could just say for example plug in
504320	508040	an off-the-shelf oscilloscope probe or plug in
508040	511960	or use this thing just like you would use a bench
511960	516080	oscilloscope or function generator kind of all in one. It wouldn't take
516080	520180	very much circuitry. All the complicated stuff is already on
520180	522940	HackRF on the main board.
525360	527840	Which is what this slide is about.
528320	532340	It would just make it a little bit easier to use. And oh, and one thing
532340	535760	the reason I put this slide here is to remind me that
536340	540260	you could interface with an external RF
540260	544400	front end this way. And this is one of the most
544400	548240	exciting possibilities for this kind of expansion
548240	552380	whether you use this baseband expansion board that
552380	556220	may exist in the future or whether you design your own circuit yourself
556220	560500	to plug into the analog baseband header. One of the best
560500	564620	uses for that maybe would be to experiment
564620	568760	with a separate RF section. A separate
568760	572840	radio other than the RF section of HackRF.
572840	576660	If you just want to use HackRF to be the
576660	580580	computer interface to your radio, this would be
580580	584660	an excellent solution. Full duplex.
584660	588080	Now HackRF is half duplex and
589240	592140	but the everything actually
592140	595860	from the USB connector through the microcontroller
595860	599900	into the analog to digital converters and digital to analog converters is
599900	603760	actually full duplex. So from that analog
603760	608300	baseband header to the host computer, all of that
608300	611980	bi-directionally, you could operate in full duplex
611980	615520	mode in theory at reduced sample rates.
615520	619660	And so this is an interesting option if you were to
619660	623460	connect your own radio front end to it that you
623460	627340	could actually use it in full duplex mode or maybe
627340	631740	you'll just put, maybe we'd just add a second RF
631740	635460	section like a transmit only RF section that we'd plug into
635460	638680	the baseband header and then you could use the onboard
640480	643800	RF section for receive or vice versa.
645940	648300	The operating frequency of HackRF
648300	651640	the design, at first we decided
652180	655840	that we wanted something to work from 100MHz to 6GHz
655840	659820	and we weren't sure if we would really meet that goal. But once
659820	663640	we kind of got the design on the drawing board, we thought, hey, we should
663640	667860	probably be able to do 30MHz to 6GHz. And then when
667860	671880	we actually started testing things, it was clear that
671880	675860	it was working pretty well down to about 10MHz. And
675860	679900	at that point, I started experimenting with different components to see if
679900	683440	I could enhance that low frequency behavior
683440	688520	without affecting the high frequency performance adversely.
688520	691820	And I've had quite a bit of success. And
691820	696080	I haven't talked about this much yet, and I haven't
696080	699100	figured out what I can guarantee. But
699640	702760	a little bit of a review before we start
702760	706840	before I show you the results. Remember that we have two different
706840	711020	mixers that are shifting the frequency. And
711020	715300	so the local oscillator
715300	718740	that goes to each mixer is
718740	723160	the amount that the frequency gets shifted. So if we wanted to tune
723160	727160	to 6GHz in the RF, and
727160	731100	our intermediate frequency is 2.5GHz. Well, 6GHz
731100	735160	minus 2.5GHz, that's
736020	739200	3.5GHz. So we have a
739200	743660	3.5GHz local oscillator right there. And then
743660	747360	we'll have a 2.5GHz local oscillator right here. Because
747360	751880	that's shifting between 2.5GHz and 0GHz. So
751880	754980	what affects the primary limitation on
754980	759100	what frequencies we can tune to, is the range
759100	762700	of frequencies that we can tune these two local oscillators.
763080	767960	The range that we can tune this one to is only in that 2GHz band.
767960	771040	But the range that we can tune that front-end oscillator,
771900	775460	it's a range from like 85MHz
775460	778980	up to, I think the
778980	783080	data sheet, or the advertisement for the part is something
783080	786360	like 4.somethingGHz, but
787140	791560	it turns out you can actually configure it up to 5.4GHz.
791560	795080	So, theoretically, we can tune this up to
795080	799800	2.7GHz, and we can tune that up to 5.4GHz,
799800	802800	add those two together, and
803640	807480	what's that, 8.1GHz? So we can configure
807480	812340	it to tune anywhere from 0Hz to 8.1GHz.
812340	816260	It's a really wide range. It doesn't perform well over
816260	819980	that whole range, of course, but that's the range that it can be
819980	824680	configured to. Now, I went ahead and tried this,
824680	828480	and this is a plot showing the maximum,
828480	832420	absolute maximum transmit power on the antenna port
832420	836080	from 0 to 10MHz. So
836080	840560	10MHz, it's putting out about 15dBm,
840560	844840	and that's our advertised minimum frequency.
844840	848620	But as you can see, it works quite well way
848620	852520	below 10MHz. More like 1MHz is
852520	855840	kind of where it starts taking a dive. And
857500	860700	I've used this, for example, to tune to AM radio
860700	864640	stations, shortwave radio stations. I've literally put a long
864640	868620	piece of wire and just stuffed the end of it into the SMA
868620	872200	connector on a hack RF and listened to radio
873100	876860	Havana, Cuba, shortwave radio
876860	880500	station at 5MHz
881380	884800	at my house in Colorado. I do
884800	888800	live on a mountain, that's true. Although my lab is in a valley.
890700	893080	So here's an extreme
893080	896640	example. I wanted to see what the lowest frequency thing
896640	900280	was that I could pick up with hack RF through the RF port.
900620	904660	So I got a spool of wire and I just
904660	908260	clipped to the leads and plugged that into the RF
908260	912640	port. And... oh,
912640	916800	shoot, I don't have a good screen shot of this. And what I did was
916800	920500	I held it up to a low frequency RFID reader.
921000	924700	And I was able to sniff low frequency RFID
924700	928920	packets. So I know a lot of people were excited when I first announced
928920	932500	that hack RF could go down to 10MHz because they said, oh,
932500	937320	that's now 13.5MHz is in our range.
937320	940740	We can do high frequency RFID. Well, two orders
940740	944540	of magnitude lower in frequency is low frequency
944540	948660	RFID tags operating at 125kHz.
948660	952680	And that is way down by this, the bottom
952680	956740	of the valley on the left, right? And I was
956740	961400	actually able to pick up those RFID tags very easily.
961400	964840	I can't show you the little demo of it because
964840	968680	I'm short on time and my laptop isn't working. So
969580	972180	you'll just have to take my word for it.
973620	976720	What's that? Oh, I won't worry too much about time, but
976720	980800	still, my laptop isn't working. So if anybody wants to
980800	985080	see later one-on-one, I do have on my
985080	988820	laptop like a saved waveform that I can
988820	992860	show you a little replay of this. I just can't put it
992860	996660	up on screen. But I was totally
996660	1000880	able to do this just by clipping in a loop of wire to
1000880	1004820	my RF port, holding the loop of wire up to
1004820	1008860	an RFID reader and then holding an RFID tag next
1008860	1013100	to it. I got a very clean signal that I could decode
1013100	1017560	in software with no problem. Now this is a receive only solution.
1017560	1021080	I can't spoof a tag. I can't transmit
1021080	1025080	to the reader because the way low frequency RFID works
1025080	1028840	is that I would have to be able to modulate
1028840	1032840	the power of
1032840	1036800	the signal, the 125 kHz signal going
1036800	1040760	through the coil of wire that's within the reader. And I don't have enough
1040760	1044880	output power to do anything like that. If I were going to do
1044880	1048780	that, I would need some kind of small external active circuit
1048780	1052860	like a one transistor circuit for example to actually be able
1052860	1056660	to modulate and spoof a tag. It
1056660	1060940	could literally be as simple as a one transistor circuit or a one diode
1060940	1064640	circuit. But I would need some kind of external
1064640	1068820	circuit to actually spoof a tag. Sniffing tags
1068820	1072760	though, no problem with just a loop of wire. And even
1072760	1076820	though it's way down at the edge of
1077680	1081320	well below the good operating range,
1081320	1084540	the amount of power that I get
1084540	1088760	coming in on that direct coupling with this
1088760	1092760	big loop of wire held right against the reader, it's so much power
1092760	1096720	that it overcomes the losses that are in the
1096720	1100980	hack RF receive chain in the
1100980	1104680	analog section at those very low frequencies. So I thought that was pretty exciting
1104680	1109080	that I could actually do something way below 1 MHz.
1110200	1112320	Now I want to show you something about
1112320	1115740	operating way above 6 GHz. So
1116600	1120660	the highest frequency test equipment I have in my lab is this
1120660	1124660	spectrum analyzer that goes up to 7 GHz. I don't
1124660	1128620	have anything that goes up to 8.1 GHz which is the highest frequency that I can
1128620	1132740	tune a hack RF to or I can configure it to, but I can at least show you
1132740	1136660	things up to 7 GHz. So the yellow
1136660	1140940	line, just look at the yellow trace for a little bit, that's showing the maximum
1140940	1144860	output power that I'm getting directly out of the RF port
1144860	1148640	from hack RF tuned to 4 GHz to
1148640	1152480	7 GHz. So 4 at the left side to
1152480	1156420	7 on the right. And this is the maximum output power in
1156420	1160260	DBM. Now this little marker here, right there,
1160260	1164200	that's 6 GHz. So that's the edge of the advertised
1164200	1168220	operating frequency range. As you can see,
1168220	1173300	as you go up in frequency, overall the performance declines.
1173300	1176800	There's a little bit of a hump around 5.5
1176800	1180680	GHz, like it gets a little better in the 5 GHz band and then
1180780	1184620	a little worse. And then just a little bit above 6 GHz, it
1184620	1188540	starts dropping precipitously. And our output power
1188540	1192980	up at 7 GHz is barely measurable
1192980	1196500	with the way I have this spectrum analyzer configured. So it's
1196500	1200880	not really useful up here. But it certainly could be useful in the low
1200880	1204920	6 GHz band, above 6 GHz.
1204920	1208620	Now, then I did this again
1209900	1213040	configuring the HackRF in a completely different way.
1213040	1216660	And that's how I got this blue trace. What I did was
1216660	1220580	I configured, I basically
1220580	1224520	bypassed the entire front end mixer. And I sent
1224520	1228620	the intermediate frequency right out directly
1228620	1233180	through the front end amplifier to the antenna.
1233180	1236300	And this is a normal configuration. This is how
1237180	1241400	we tune to things like around 2.4 GHz,
1241400	1245240	2.5 GHz. That's how we normally tune to things in that 2 GHz
1245240	1249240	band. The intermediate frequency band is by bypassing the front end mixer.
1249320	1253300	So I bypass the front end mixer and then I look at the output power
1253900	1257340	maximum output power. I'm really maxing it out as much
1257340	1261360	as I can. But I'm
1261360	1265460	looking at the output power as I sweep the intermediate
1265460	1269820	frequency from 2.15 to
1269820	1273440	2.75 GHz. I sweep that frequency
1273440	1277500	and then I got this blue line in the 4
1277500	1281540	to 7 GHz band. So why do we have these big peaks
1282400	1285360	in this region from here to here
1285360	1289580	and then from this region from here off beyond my measured
1289580	1293560	frequency range? It's because they are harmonics of the intermediate
1293560	1297260	frequency. So this range right here is
1297260	1301480	twice the intermediate frequency. 2.15 times
1301480	1305300	2 is 4.25 GHz and that's where this
1305300	1309440	blue region starts here. And then
1309440	1313900	three times that starts here. So this is the second harmonic
1313900	1316980	and the third harmonic. Now notice that
1317700	1321200	especially way up here around 6.5
1321200	1324720	to 7 GHz, this actually allows us to get
1324720	1328440	much more output power than we are able to by
1328900	1332740	properly using the wideband front end and configuring it
1332740	1335840	to operate like the way you would expect up here.
1335840	1340900	The question is am I still dumping tons
1340900	1345420	of power out at 2.4 GHz? Absolutely, I certainly am.
1345420	1349560	But by exploiting the harmonics, and if you were going to do this
1349560	1352320	in real life, you would use a filter. You can take
1352320	1357580	an off-the-shelf external filter that you can plug in
1357580	1361900	between the hack RF and antenna. You could actually operate at 7 GHz
1361900	1365540	by filtering out everything below that would include
1365540	1369320	all that power you are putting out in the 2 GHz band.
1370120	1373420	It's a pretty dirty trick, but it's
1373420	1376980	something that can be done. And it's actually not too
1376980	1381540	uncommon a trick for people who typically build equipment
1381540	1385160	or use equipment in the many GHz.
1385360	1389020	So, one thing to note
1389020	1393400	is that the frequency response is extremely non-flat
1393400	1397560	of this blue curve, especially note that gigantic peak
1397560	1401020	around 4.9 GHz. The reason that it is so
1401020	1405400	non-flat is because I am actually over-driving
1405400	1407860	the front-end amplifier.
1408680	1413420	And so, it's just like over-driving a guitar amplifier
1413420	1416700	and getting that distortion. That distortion
1417720	1420980	increases the harmonics that you get. So that
1420980	1424760	when we look at the harmonics, if we are over-driving that front-end amplifier,
1424760	1428900	we are able to get some extra peaks in those harmonics
1428900	1432360	at certain frequencies where things just
1432760	1436860	over-drive the amplifier a little bit more. So that's why we get a really
1436860	1440820	good peak around 4.9 or 5 GHz. And that's probably
1440820	1444920	why this is increasing and not decreasing in this
1444920	1449000	region below 7 GHz. So what this does from 7 to 8.1, I don't
1449000	1453040	know, but what I would expect is that
1453040	1456760	the yellow curve drops off and becomes
1456760	1460480	totally unusable if it's not already. And that the blue curve
1460480	1463800	probably goes up and down a little bit and eventually
1464560	1468320	maybe traces something similar to this curve, but
1468320	1472800	less so. So that's kind of a dirty trick you can use
1472800	1477220	to do some fun things at very high frequencies.
1477700	1480740	And one
1480740	1484640	other thing I wanted to note, I talked a little bit about kind of overcoming
1484640	1488480	the limitations of the operating frequency range. I talked about overcoming
1488480	1492080	the limitations of half-duplex if you use that
1492080	1496480	baseband header. But another thing I want to note is that theoretically you could
1496480	1500600	overcome limitations of the sample rate.
1500840	1504260	We have a sampler that is specced
1504260	1508660	to run up to 22 MS per second, but we always figured
1508660	1512460	it was wishful thinking that we'd just barely get up to 20 MHz
1512460	1517400	or 20 MS per second on our USB interface.
1517400	1520640	So as it turns out, at least on some
1520640	1524860	USB host controllers we can actually exceed that. Like on my laptop
1524860	1528480	I can reliably run at a maximum sample rate
1528480	1532660	of 21.5 MS per second. So just a little bit higher
1532660	1536800	than 20 million samples per second. Which is 43 MB
1536800	1540660	per second going over USB. That's a lot to go
1540660	1544640	over high speed USB. I've actually never seen any other USB device
1544640	1549280	go that fast. Except for super speed USB devices of course.
1549560	1552840	And additionally
1552840	1556600	if you were to do processing on the ARM instead
1556600	1560560	of on the host computer and not
1560560	1564700	worry about the limitation of USB, you might even be able to go a little
1564700	1567800	bit faster. And if you want to learn about
1567800	1571800	running code on the ARM, stick around for the next half hour
1571800	1575440	to listen to Jared. And
1576920	1579720	there is a little, there is some header
1579720	1583940	there's an extra header that you can install on HackRF1 that gives you
1583940	1587800	direct access to pins on the CPLD which is
1587800	1592240	just some little logic glue between the ARM and the ADCDAC.
1592240	1595900	So you could completely bypass the ARM and
1595900	1599960	stream your samples in and out of those CPLD pins like if you
1599960	1603920	had an external FPGA board or something like that. And you might even
1603920	1607400	be able to get a little bit more sample rate out that way.
1607600	1612160	The ADCDAC chip is spec to run at 22 million
1612160	1615900	samples per second. But I believe it can be overclocked
1615900	1620520	in many cases. And it can also be replaced with a
1620520	1623580	pin compatible replacement chip that runs up to
1623580	1627480	I think 40 mega samples or 60 mega samples. I'm pretty sure
1627480	1631520	it's just the same chip that they just bin. And so
1631520	1635700	the ones that they sell as 22 mega samples maybe didn't test as very well
1635700	1639180	at 40. But they probably operate somewhat faster than
1639180	1643560	22 in most cases or can. And additionally there's an analog
1643560	1647660	baseband filter in the intermediate frequency transceiver
1647660	1652180	that can be configured to a maximum of about 30 megahertz.
1652180	1656240	So that's kind of the limiting factor at that point if you kind of use those
1656240	1659180	tricks to bypass USB and bypass the arm
1660660	1664180	and at the extreme actually replace that ADCDAC
1664700	1667960	chip with a faster one. Your limiting factor would be that
1667960	1672800	baseband filter that gets you up to about 30 megahertz instead of 20 megahertz.
1673120	1676220	And that's SDR tricks with HackRF. Thanks for listening.
1676220	1679940	And I hope you'll stick around to hear Jared talk about the HackRF PortaPak.
1679940	1680680	Thank you.
