0

I'm trying to demodulate a GFSK signal coming from an nRF24L01+ transceiver chip (hooked up to my Arduino). I've followed this guide so far: https://www.bitcraze.io/2015/06/sniffing-crazyflies-radio-with-hackrf-blue/#comment-38046

..and managed to manually demodulate a package (the address and the message I sent 'martijn' are clearly recoverable): https://drive.google.com/open?id=0B9CJ42CGPiF2TWoyelRmWldZcU0

However, now I want to receive packets and decode them as they come in. Someone already made a decoder for this job, but somehow it fails to find my nRF24 packets: https://wiki.bitcraze.io/misc:hacks:hackrf

My Arduino code for sending the packets is as followed:

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>
#include <RF24_config.h>

RF24 radio(9,10);
const uint64_t pipe = 0xe7e7e7e7e7;

char package[] = "martijn";

void setup() {
  Serial.begin(9600);
  radio.begin();
  radio.setDataRate(RF24_1MBPS);
  radio.setChannel(95);
  radio.openWritingPipe(pipe);
  radio.enableDynamicPayloads();
  radio.setAutoAck(true);
  radio.powerUp();
}

void loop() {

  radio.write(&package, strlen(package));
  delay(1);

}

Basically I just want to use GNU Radio Companion to obtain the nRF24 packets, and send their binary data into a file. I'm fine with writing my own decoder. However, I have no clue on how to get this binary data from the incoming signals.

(The comments at the bitcraze site are also mine)

I've be very happy if someone could help me (or even point me in the right direction). Thanks in advance!

Cake
  • 318
  • 6
  • 20

1 Answers1

1

After the Quadrature Demod you have to use a Clock recovery block. The M&M Clock Recovery of GNU Radio should do the job. This block will dramatically increase the performance of the decoding.

However you have to take care some parameters that this block requires. The most important is the 'omega'. 'Omega' roughly speaking corresponds to the number of samples per symbol. For example, if your GFSK baudrate is 9600 and your incoming signal from the hardware is 96000, each symbol corresponds to 10 samples. The omega can be any float number. Note however, that clock recovery does not work for large omega values. So try to keep the omega up to 8.0. To do that, either adjust properly the hardware sampling rate or do some resampling.

After the Clock Recover just use a 'Binary Slicer' block. This will convert the floats to bits of 0's and 1's. Using the Pack K bits block you can convert the bit stream into byte stream, that can easily saved to file with a 'File Sink'.

Here is a good step-by-step tutorial for an FSK receiver. GFSK adds only a Gaussian filter so the procedure is quite the same for both of them.

Manos
  • 2,136
  • 17
  • 28
  • Thanks! I can't seem to figure out how to do the resampling. Lowering the hardware sample rate to as low as 70k doesn't work. Also, what should the Pack K bits value be? Here's my current setup: https://drive.google.com/open?id=0B9CJ42CGPiF2NHVSYXU3Z0xwMWM And would you happen to know why the second Low pass filter they added in the tutorial you mentioned doesn't work for me? It only messes up my plot. Without that second filter the signal looks fine already. – Cake Jul 29 '16 at 13:52
  • Most of the hardware out there support only some predefined sampling rates. By resampling the incoming signal, you change the sampling rate to a desired rate. Why the filter is doesn't work is hard to say. Maybe it cutoff the signal of interest. A FFT plot of the original signal from the hardware may help a lot. – Manos Jul 29 '16 at 14:00
  • Here's the FFT sink (after a low pass filter). I'm using 2M as sample rate here: https://drive.google.com/open?id=0B9CJ42CGPiF2Zm9SWUJDUFBtMlk I've tried adding a Rational Resampler (Dec. 20M to Int. 70k) after the filter, but then the file sink stays empty. How should I resample the data? – Cake Jul 31 '16 at 14:31
  • The resolution bandwidth of your scope is quite low. So I can not figure out what is happening there. The parameters of the rational resampler that you used, seems to me totally wrong. You want to downsample the signal from 2M to 70k. The least common multiple of 2M and 70k is 14M. So you have to interpolate the signal by 14M/2M=7 and then decimate it by 14M/70k=200. However, a rational resampler with such configuration will create internally a filter of 200 taps for the downsampling. This may require significant amount of processing power. – Manos Aug 07 '16 at 08:10
  • If I were you, I would first use a Xlating FIR low pass filter with decimation 20. The output of this filter would be 100k which is very close to target. Then using the Polyphase Arbitrary resampling block, the signal could be easily downsampled to 70k. – Manos Aug 07 '16 at 08:15