Imported Upstream version 3.0
[debian/gnuradio] / gnuradio-examples / python / digital / README
1 Quick overview of what's here:
2
3 * benchmark_tx.py: generates packets of the size you
4 specify and sends them across the air using the USRP.  Known to work
5 well using the USRP with the RFX transceiver daughterboards.
6 You can specify the bitrate to use with the -r <bitrate> command line
7 parameter.  The default is 500k.  Some machines will do 1M or more.
8 You can select the modulation to use with the -m <modulation> command
9 line argument.  The legal values for <modulation> are gmsk, dbpsk and dqpsk.
10
11 * benchmark_tx.py: the receiver half of benchmark_tx.py.
12 Command line arguments are pretty much the same as rx.  Works well
13 with a USRP and RFX transceiver daughterboards.  Will also work
14 with TVRX daugherboard, but you'll need to fiddle with the gain.  See
15 below.  Prints a summary of each packet received and keeps a running
16 total of packets received, and how many of them were error free.
17 There are two levels of error reporting going on.  If the access code
18 (PN code) and header of a packet were properly detected, then you'll
19 get an output line.  If the CRC32 of the payload was correct you get
20 "ok = True", else "ok = False".  The "pktno" is extracted from the
21 received packet.  If there are skipped numbers, you're missing some
22 packets.  Be sure you've got a suitable antenna connected to the TX/RX
23 port on each board.  For the RFX-400, "70 cm" / 420 MHz antennas for ham
24 handi-talkies work great.  These are available at ham radio supplies,
25 etc.  The boards need to be at least 3m apart.  You can also try
26 experimenting with the rx gain (-g <gain> command line option).
27
28 Generally speaking, I start the rx first on one machine, and then fire
29 up the tx on the other machine.  The tx also supports a discontinous
30 transmission mode where it sends bursts of 5 packets and then waits 1
31 second.  This is useful for ensuring that all the receiver control
32 loops lock up fast enough.
33
34 * tunnel.py: This program provides a framework for building your own
35 MACs.  It creates a "TAP" interface in the kernel, typically gr0,
36 and sends and receives ethernet frames through it.  See
37 /usr/src/linux/Documentation/networking/tuntap.txt and/or Google for
38 "universal tun tap".  The Linux 2.6 kernel includes the tun module, you
39 don't have to build it.  You may have to "modprobe tun" if it's not
40 loaded by default.  If /dev/net/tun doesn't exist, try "modprobe tun".
41
42 To run this program you'll need to be root or running with the
43 appropriate capability to open the tun interface.  You'll need to fire
44 up two copies on different machines.  Once each is running you'll need
45 to ifconfig the gr0 interface to set the IP address.
46
47 This will allow two machines to talk, but anything beyond the two
48 machines depends on your networking setup.  Left as an exercise...
49
50 On machine A:
51
52   $ su
53   # ./tunnel.py --freq 423.0M --bitrate 500k
54   # # in another window on A, also as root...
55   # ifconfig gr0 192.168.200.1
56
57
58 On machine B:
59
60   $ su
61   # ./tunnel.py --freq 423.0M --bitrate 500k
62   # # in another window on B, also as root...
63   # ifconfig gr0 192.168.200.2
64
65 Now, on machine A you shold be able to ping machine B:
66
67   $ ping 192.168.200.2
68
69 and you should see some output for each packet in the
70 tunnel.py window if you used the -v option.
71
72 Likewise, on machine B:
73
74   $ ping 192.168.200.1
75
76 This now uses a carrier sense MAC, so you should be able to ssh
77 between the machines, web browse, etc.