funtenna / REF_DESIGN

Funtenna reference design
www.funtenna.org
GNU General Public License v2.0
12 stars 6 forks source link

Funtenna: Reference Implementation

This repository contains the code for the reference funtenna implementation.

It transmits Hamming-coded data from a BeagleBone's GPIO pin, bit-banged at about 12.5 MHz. This data is received on a USRP2, then demodulated in GNU Radio.

Materials

Steps/setup

  1. Hook up a wire/antenna to pin 8.46 on the Beaglebone (consult the reference manual).

  2. Copy beaglebone/gpio to BeagleBone; compile the kernel module. This is a good resource for installing the dependencies necessary for compiling a kernel module and compiling. Once that's done, load the kernel module and begin transmitting.

    make insmod gpio.ko mknod /dev/gpio c 60 0

Now, the repeat executable will broadcast a 10101010 bit pattern over and over. This helps the AGC in the GNU Radio circuit adjust to the appropriate level.

  1. Power on and connect USRP.

  2. Compile and install GNU Radio blocks found in gr-cw_binary and gr-hamming directories (if this fails at any step, it's probably due to missing dependencies):

    cd gr-cw_binary mkdir build cd build

    NB: the install prefix option is important to make sure that GRC can find

    your blocks; look for /usr/share/gnuradio/grc (it might be in

    /usr/local/share/gnuradio/grc)

    cmake -D CMAKE_INSTALL_PREFIX=/usr ../ make make test sudo make install # if all looks good sudo ldconfig

  3. Start GNURadio companion. Open flow found in demod/online-demod.grc. Run the flow. Wait for the levels in the scope to settle.

  4. Tail /tmp/bitpattern.

  5. On the BeagleBone, ^C the repeat executable and run ./send_message 'test message here'. If all is well, the message should appear in /tmp/bitpattern.

Implementation Details

BeagleBone

The BeagleBone code is a kernel module that writes either alternating 10s or 00s to memory-mapped IO for the BeagleBone's GPIO pin 8.46. The number of repetitions can be set. The kernel module reads from a char array, toggling the pin for a nonzero value or holding the pin low for a zero. This broadcasts the given bit-pattern using on-off keying.

There are two userspace programs to broadcast data. One sends out a 10101010 bit pattern on repeat until interrupted; this allows the receiving end to adjust their levels. The other program encodes data it is given via the command line into packets:

The BeagleBone broadcasts at 12.5 MHz.

USRP

We used an Ettus Research USRP2 (discontinued) with a homemade antenna. We were able to observe a clear signal from at least 30 feet away before signal processing.

GNU Radio

We used GNU Radio for signal processing and demodulation; the flow graph includes the following: