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.
Hook up a wire/antenna to pin 8.46 on the Beaglebone (consult the reference manual).
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.
Power on and connect USRP.
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
cmake -D CMAKE_INSTALL_PREFIX=/usr ../ make make test sudo make install # if all looks good sudo ldconfig
Start GNURadio companion. Open flow found in demod/online-demod.grc
. Run
the flow. Wait for the levels in the scope to settle.
Tail /tmp/bitpattern
.
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
.
The BeagleBone code is a kernel module that writes either alternating 10
s or
00
s 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:
0xaaaaaaaacccc
The BeagleBone broadcasts at 12.5 MHz.
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.
We used GNU Radio for signal processing and demodulation; the flow graph includes the following: