HackRF Node Stream Spectrum Painter

Folks were playing around with Hellschreiber encoding in the #hackrf channel on Freenode last week using hackrf_transfer

Which then made me remember a tweet from @maxogden playing around with a hackrf node module at the CCC 2015 camp.

And using a hackrf via node is something I’ve wanted since before it was even a thing.

Spectrum Painter

Use Spectrum Painter to create an IQ stream:

python spectrum_painter/img2iqstream.py examples/gareth.png --samplerate 8000000 --format hackrf > gareth.raw

Then test with hackrf_transfer:

hackrf_transfer -f 915000000 -s 3700000 -t gareth.raw -x 20

Show the transmission on a second machine with gqrx:

GQRX is a multi-platform software reciever with waterfall plot.

You might need to tweak some of the sample rate / fft settings in both hackrf_transfer & gqrx to get the correct aspect ratio but it’s not difficult.

FFT: 8192
Rate: 50fps
Filter Width: Normal
Filter Shape: Normal
Mode: Narrow/FM
AGC: Fast

HackRF for Node

So I wrote something straight from my brain using hackrf-stream

var devices = require('hackrf-stream')
var fs = require('fs')

var radio = devices(0).open(0)



var tx = radio.createWriteStream()

fs.readFile('./gareth.raw', function (err, data) {
  if (err) {
    throw err

… and it worked.

First test I managed to capture the very first code test. While in utter shock it actually worked!

Current interests: